4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
117 /** Integer property for filtering based on package info*/
118 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_PRIVILEGE "PMINFO_APPINFO_PROP_PRIVILEGE"
149 /** Integer property for filtering app support mode */
150 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
175 /** will be updated*/
176 /** string property for filtering based on pkg info*/
177 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
179 /* For multiuser support */
180 const char *getIconPath(uid_t uid, bool readonly);
181 char *getUserPkgParserDBPath(void);
182 char *getUserPkgParserDBPathUID(uid_t uid);
183 char *getUserPkgCertDBPath(void);
184 const char *getUserManifestPath(uid_t uid, bool readonly);
187 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
188 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
189 * @brief This API gets list of installed packages
191 * @par This API is for package-manager client application
192 * @par Sync (or) Async : Synchronous API
193 * @param[in] pkg_list_cb iteration function for list
194 * @param[in] user_data user data to be passed to callback function
195 * @param[in] uid the addressee user id of the instruction
196 * @return 0 if success, error code(<0) if fail
197 * @retval PMINFO_R_OK success
198 * @retval PMINFO_R_EINVAL invalid argument
199 * @retval PMINFO_R_ERROR internal error
203 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
207 pkgid1 = (char *)user_data;
208 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
209 if (strcmp(pkgid1, pkgid2) == 0) {
216 static int list_pkgs()
219 char *name = "helloworld";
220 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
221 if (ret != PMINFO_R_OK) {
228 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
229 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
232 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
233 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
234 * @brief This API gets list of disabled packages
236 * @par This API is for package-manager client application
237 * @par Sync (or) Async : Synchronous API
238 * @param[in] pkg_list_cb iteration function for list
239 * @param[in] user_data user data to be passed to callback function
240 * @param[in] uid the addressee user id of the instruction
241 * @return 0 if success, error code(<0) if fail
242 * @retval PMINFO_R_OK success
243 * @retval PMINFO_R_EINVAL invalid argument
244 * @retval PMINFO_R_ERROR internal error
248 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
249 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
252 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
253 * @brief This API creates the package information handle from db which is not disabled
255 * @par This API is for package-manager client application
256 * @par Sync (or) Async : Synchronous API
258 * @param[in] pkgid pointer to package ID
259 * @param[in] uid the addressee user id of the instruction
260 * @param[out] handle pointer to the package info handle.
261 * @return 0 if success, error code(<0) if fail
262 * @retval PMINFO_R_OK success
263 * @retval PMINFO_R_EINVAL invalid argument
264 * @retval PMINFO_R_ERROR internal error
266 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
267 * @see pkgmgrinfo_pkginfo_get_pkgid()
268 * @see pkgmgrinfo_pkginfo_is_removable()
270 static int get_pkg_type(const char *pkgid)
274 pkgmgrinfo_pkginfo_h handle;
275 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
276 if (ret != PMINFO_R_OK)
278 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
279 if (ret != PMINFO_R_OK) {
280 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
283 printf("pkgtype: %s\n", type);
284 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
289 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
290 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
293 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
294 * @brief This API creates the disabled package information handle from db
296 * @par This API is for package-manager client application
297 * @par Sync (or) Async : Synchronous API
299 * @param[in] pkgid pointer to package ID
300 * @param[in] uid the addressee user id of the instruction
301 * @param[out] handle pointer to the package info handle.
302 * @return 0 if success, error code(<0) if fail
303 * @retval PMINFO_R_OK success
304 * @retval PMINFO_R_EINVAL invalid argument
305 * @retval PMINFO_R_ERROR internal error
307 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
308 * @see pkgmgrinfo_pkginfo_get_pkginfo()
310 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
311 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
314 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
315 * @brief This API creates the package information handle from db regardless of its disable or storage status
317 * @par This API is for package-manager client application
318 * @par Sync (or) Async : Synchronous API
320 * @param[in] pkgid pointer to package ID
321 * @param[in] uid the addressee user id of the instruction
322 * @param[out] handle pointer to the package info handle.
323 * @return 0 if success, error code(<0) if fail
324 * @retval PMINFO_R_OK success
325 * @retval PMINFO_R_EINVAL invalid argument
326 * @retval PMINFO_R_ERROR internal error
328 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
329 * @see pkgmgrinfo_pkginfo_get_pkgid()
330 * @see pkgmgrinfo_pkginfo_is_removable()
332 static int get_pkg_type(const char *pkgid)
336 pkgmgrinfo_pkginfo_h handle;
337 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
338 if (ret != PMINFO_R_OK)
340 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
341 if (ret != PMINFO_R_OK) {
342 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
345 printf("pkgtype: %s\n", type);
346 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
351 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
352 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
355 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
356 * @brief This API gets the package name from the package ID
358 * @par This API is for package-manager client application
359 * @par Sync (or) Async : Synchronous API
361 * @param[in] handle pointer to package info handle
362 * @param[out] pkg_name pointer to hold package name
363 * @return 0 if success, error code(<0) if fail
364 * @retval PMINFO_R_OK success
365 * @retval PMINFO_R_EINVAL invalid argument
366 * @retval PMINFO_R_ERROR internal error
367 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
368 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
369 * @see pkgmgrinfo_pkginfo_get_type()
370 * @see pkgmgrinfo_pkginfo_is_removable()
372 static int get_pkg_name(const char *pkgid)
375 char *pkgname = NULL;
376 pkgmgrinfo_pkginfo_h handle;
377 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
378 if (ret != PMINFO_R_OK)
380 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
381 if (ret != PMINFO_R_OK) {
382 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
385 printf("pkgname: %s\n", pkgname);
386 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
391 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
394 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
395 * @brief This API gets the package id from the package ID
397 * @par This API is for package-manager client application
398 * @par Sync (or) Async : Synchronous API
400 * @param[in] handle pointer to package info handle
401 * @param[out] pkgid pointer to hold package id
402 * @return 0 if success, error code(<0) if fail
403 * @retval PMINFO_R_OK success
404 * @retval PMINFO_R_EINVAL invalid argument
405 * @retval PMINFO_R_ERROR internal error
406 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
407 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
408 * @see pkgmgrinfo_pkginfo_get_type()
409 * @see pkgmgrinfo_pkginfo_is_removable()
411 static int get_pkgid(const char *pkgid)
415 pkgmgrinfo_pkginfo_h handle;
416 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
417 if (ret != PMINFO_R_OK)
419 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
420 if (ret != PMINFO_R_OK) {
421 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
424 printf("pkg id: %s\n", pkg_id);
425 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
430 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
433 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
434 * @brief This API gets the package type from the package ID
436 * @par This API is for package-manager client application
437 * @par Sync (or) Async : Synchronous API
439 * @param[in] handle pointer to package info handle
440 * @param[out] type pointer to hold package type
441 * @return 0 if success, error code(<0) if fail
442 * @retval PMINFO_R_OK success
443 * @retval PMINFO_R_EINVAL invalid argument
444 * @retval PMINFO_R_ERROR internal error
445 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
446 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
447 * @see pkgmgrinfo_pkginfo_get_pkgid()
448 * @see pkgmgrinfo_pkginfo_is_removable()
450 static int get_pkg_type(const char *pkgid)
454 pkgmgrinfo_pkginfo_h handle;
455 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
456 if (ret != PMINFO_R_OK)
458 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
459 if (ret != PMINFO_R_OK) {
460 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
463 printf("pkgtype: %s\n", type);
464 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
469 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
472 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
473 * @brief This API gets the package version from the package ID
475 * @par This API is for package-manager client application
476 * @par Sync (or) Async : Synchronous API
478 * @param[in] handle pointer to package info handle
479 * @param[out] version pointer to hold package version
480 * @return 0 if success, error code(<0) if fail
481 * @retval PMINFO_R_OK success
482 * @retval PMINFO_R_EINVAL invalid argument
483 * @retval PMINFO_R_ERROR internal error
484 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
485 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
486 * @see pkgmgrinfo_pkginfo_get_pkgid()
487 * @see pkgmgrinfo_pkginfo_is_removable()
489 static int get_pkg_version(const char *pkgid)
492 char *version = NULL;
493 pkgmgrinfo_pkginfo_h handle;
494 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
495 if (ret != PMINFO_R_OK)
497 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
498 if (ret != PMINFO_R_OK) {
499 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
502 printf("pkg version: %s\n", version);
503 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
508 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
511 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
512 * @brief This API gets the package api_version from the package ID
514 * @par This API is for package-manager client application
515 * @par Sync (or) Async : Synchronous API
517 * @param[in] handle pointer to package info handle
518 * @param[out] api_version pointer to hold package api_version
519 * @return 0 if success, error code(<0) if fail
520 * @retval PMINFO_R_OK success
521 * @retval PMINFO_R_EINVAL invalid argument
522 * @retval PMINFO_R_ERROR internal error
523 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
524 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
525 * @see pkgmgrinfo_pkginfo_get_pkgid()
526 * @see pkgmgrinfo_pkginfo_is_removable()
528 static int get_pkg_api_version(const char *pkgid)
531 char *api_version = NULL;
532 pkgmgrinfo_pkginfo_h handle = NULL;
533 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
534 if (ret != PMINFO_R_OK)
536 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
537 if (ret != PMINFO_R_OK) {
538 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
541 printf("pkg api_version: %s\n", api_version);
542 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
547 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
550 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
551 * @brief This API gets tep(tizen expansion package) file name associated with the package
553 * @par This API is for package-manager client application
554 * @par Sync (or) Async : Synchronous API
556 * @param[in] handle pointer to the pkginfo handle.
557 * @param[out] tep_name pointer to hold tep name
558 * @return 0 if success, error code(<0) if fail
559 * @retval PMINFO_R_OK success
560 * @retval PMINFO_R_EINVAL invalid argument
561 * @retval PMINFO_R_ERROR internal error
562 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
563 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
564 * @see pkgmgrinfo_pkginfo_get_pkgid()
566 static int get_tep_name(const char *pkgid)
569 char *tep_name = NULL;
570 pkgmgrinfo_pkginfo_h handle = NULL;
571 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
572 if (ret != PMINFO_R_OK)
574 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
575 if (ret != PMINFO_R_OK) {
576 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
579 printf("TEP name is: %s\n", tep_name);
580 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
585 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
588 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
589 * @brief This API gets package mount point path associated with the package
590 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
592 * @par This API is for package-manager client application
593 * @par Sync (or) Async : Synchronous API
595 * @param[in] handle pointer to the pkginfo handle.
596 * @param[out] zip_mount_file pointer to hold zip mount file
597 * @return 0 if success, error code(<0) if fail
598 * @retval PMINFO_R_OK success
599 * @retval PMINFO_R_EINVAL invalid argument
600 * @retval PMINFO_R_ERROR internal error
601 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
602 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
603 * @see pkgmgrinfo_pkginfo_get_pkgid()
605 static int get_zip_mount_file(const char *pkgid)
608 char *zip_mount_file = NULL;
609 pkgmgrinfo_pkginfo_h handle = NULL;
610 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
611 if (ret != PMINFO_R_OK)
613 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
614 if (ret != PMINFO_R_OK) {
615 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
618 if (zip_mount_file != NULL)
619 printf("Zip mount path is: %s\n", zip_mount_file);
620 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
625 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
628 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
629 * @brief This API gets package external image path associated with the package
630 * if package is installed in external storage.
631 * Otherwise, the return value will be PMINFO_R_ENOENT.
633 * @par This API is for package-manager client application
634 * @par Sync (or) Async : Synchronous API
636 * @param[in] handle pointer to the pkginfo handle.
637 * @param[out] ext_image_path pointer to hold external image path
638 * @return 0 if success, error code(<0) if fail
639 * @retval PMINFO_R_OK success
640 * @retval PMINFO_R_EINVAL invalid argument
641 * @retval PMINFO_R_ERROR internal error
642 * @revall PMINFO_R_ENOENT no valid data
643 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
644 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
645 * @see pkgmgrinfo_pkginfo_get_pkgid()
647 static int get_external_image_path(const char *pkgid)
650 char *ext_image_path = NULL;
651 pkgmgrinfo_pkginfo_h handle = NULL;
652 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
653 if (ret != PMINFO_R_OK)
655 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
656 if (ret != PMINFO_R_OK) {
657 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
660 printf("external image path is: %s\n", ext_image_path);
661 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
666 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
669 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
670 * @brief This API gets the package install location from the package ID
672 * @par This API is for package-manager client application
673 * @par Sync (or) Async : Synchronous API
675 * @param[in] handle pointer to package info handle
676 * @param[out] location pointer to hold package install location
677 * @return 0 if success, error code(<0) if fail
678 * @retval PMINFO_R_OK success
679 * @retval PMINFO_R_EINVAL invalid argument
680 * @retval PMINFO_R_ERROR internal error
681 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
682 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
683 * @see pkgmgrinfo_pkginfo_get_pkgid()
684 * @see pkgmgrinfo_pkginfo_is_removable()
686 static int get_pkg_install_location(const char *pkgid)
689 pkgmgrinfo_install_location location;
690 pkgmgrinfo_pkginfo_h handle;
691 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
692 if (ret != PMINFO_R_OK)
694 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
695 if (ret != PMINFO_R_OK) {
696 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
699 printf("pkg install location: %d\n", location);
700 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
705 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
708 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
709 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
710 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
711 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
713 * @par This API is for package-manager client application
714 * @par Sync (or) Async : Synchronous API
716 * @param[in] handle pointer to package info handle
717 * @param[out] size pointer to hold package size
718 * @return 0 if success, error code(<0) if fail
719 * @retval PMINFO_R_OK success
720 * @retval PMINFO_R_EINVAL invalid argument
721 * @retval PMINFO_R_ERROR internal error
722 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
723 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
724 * @see pkgmgrinfo_pkginfo_get_pkgid()
725 * @see pkgmgrinfo_pkginfo_is_removable()
727 static int get_pkg_size(const char *pkgid)
731 pkgmgrinfo_pkginfo_h handle;
732 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
733 if (ret != PMINFO_R_OK)
735 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
736 if (ret != PMINFO_R_OK) {
737 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
740 printf("pkgsize: %d\n", size);
741 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
746 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
749 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
750 * @brief This API gets the package icon from the package ID
752 * @par This API is for package-manager client application
753 * @par Sync (or) Async : Synchronous API
755 * @param[in] handle pointer to package info handle
756 * @param[out] icon pointer to hold package icon
757 * @return 0 if success, error code(<0) if fail
758 * @retval PMINFO_R_OK success
759 * @retval PMINFO_R_EINVAL invalid argument
760 * @retval PMINFO_R_ERROR internal error
761 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
762 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
763 * @see pkgmgrinfo_pkginfo_get_pkgid()
764 * @see pkgmgrinfo_pkginfo_is_removable()
766 static int get_pkg_icon(const char *pkgid)
770 pkgmgrinfo_pkginfo_h handle;
771 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
772 if (ret != PMINFO_R_OK)
774 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
775 if (ret != PMINFO_R_OK) {
776 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
779 printf("pkg icon: %s\n", icon);
780 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
785 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
788 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
789 * @brief This API gets the package label from the package ID
791 * @par This API is for package-manager client application
792 * @par Sync (or) Async : Synchronous API
794 * @param[in] handle pointer to package info handle
795 * @param[out] label pointer to hold package label
796 * @return 0 if success, error code(<0) if fail
797 * @retval PMINFO_R_OK success
798 * @retval PMINFO_R_EINVAL invalid argument
799 * @retval PMINFO_R_ERROR internal error
800 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
801 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
802 * @see pkgmgrinfo_pkginfo_get_pkgid()
803 * @see pkgmgrinfo_pkginfo_is_removable()
805 static int get_pkg_label(const char *pkgid)
809 pkgmgrinfo_pkginfo_h handle;
810 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
811 if (ret != PMINFO_R_OK)
813 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
814 if (ret != PMINFO_R_OK) {
815 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
818 printf("pkg label: %s\n", label);
819 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
824 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
827 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
828 * @brief This API gets the package description from the package ID
830 * @par This API is for package-manager client application
831 * @par Sync (or) Async : Synchronous API
833 * @param[in] handle pointer to package info handle
834 * @param[out] description pointer to hold package description
835 * @return 0 if success, error code(<0) if fail
836 * @retval PMINFO_R_OK success
837 * @retval PMINFO_R_EINVAL invalid argument
838 * @retval PMINFO_R_ERROR internal error
839 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
840 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
841 * @see pkgmgrinfo_pkginfo_get_pkgid()
842 * @see pkgmgrinfo_pkginfo_is_removable()
844 static int get_pkg_description(const char *pkgid)
847 char *description = NULL;
848 pkgmgrinfo_pkginfo_h handle;
849 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
850 if (ret != PMINFO_R_OK)
852 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
853 if (ret != PMINFO_R_OK) {
854 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
857 printf("pkg description: %s\n", description);
858 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
863 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
866 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
867 * @brief This API gets the package's author name from the package ID
869 * @par This API is for package-manager client application
870 * @par Sync (or) Async : Synchronous API
872 * @param[in] handle pointer to package info handle
873 * @param[out] author_name pointer to hold package author name
874 * @return 0 if success, error code(<0) if fail
875 * @retval PMINFO_R_OK success
876 * @retval PMINFO_R_EINVAL invalid argument
877 * @retval PMINFO_R_ERROR internal error
878 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
879 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
880 * @see pkgmgrinfo_pkginfo_get_pkgid()
881 * @see pkgmgrinfo_pkginfo_is_removable()
883 static int get_pkg_author_name(const char *pkgid)
886 char *author_name = NULL;
887 pkgmgrinfo_pkginfo_h handle;
888 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
889 if (ret != PMINFO_R_OK)
891 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
892 if (ret != PMINFO_R_OK) {
893 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
896 printf("pkg author name: %s\n", author_name);
897 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
902 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
905 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
906 * @brief This API gets the package's author email from the package ID
908 * @par This API is for package-manager client application
909 * @par Sync (or) Async : Synchronous API
911 * @param[in] handle pointer to package info handle
912 * @param[out] author_email pointer to hold package author email
913 * @return 0 if success, error code(<0) if fail
914 * @retval PMINFO_R_OK success
915 * @retval PMINFO_R_EINVAL invalid argument
916 * @retval PMINFO_R_ERROR internal error
917 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
918 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
919 * @see pkgmgrinfo_pkginfo_get_pkgid()
920 * @see pkgmgrinfo_pkginfo_is_removable()
922 static int get_pkg_author_email(const char *pkgid)
925 char *author_email = NULL;
926 pkgmgrinfo_pkginfo_h handle;
927 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
928 if (ret != PMINFO_R_OK)
930 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
931 if (ret != PMINFO_R_OK) {
932 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
935 printf("pkg author email: %s\n", author_email);
936 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
941 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
944 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
945 * @brief This API gets the package's author href from the package ID
947 * @par This API is for package-manager client application
948 * @par Sync (or) Async : Synchronous API
950 * @param[in] handle pointer to package info handle
951 * @param[out] author_href pointer to hold package author href
952 * @return 0 if success, error code(<0) if fail
953 * @retval PMINFO_R_OK success
954 * @retval PMINFO_R_EINVAL invalid argument
955 * @retval PMINFO_R_ERROR internal error
956 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
957 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
958 * @see pkgmgrinfo_pkginfo_get_pkgid()
959 * @see pkgmgrinfo_pkginfo_is_removable()
961 static int get_pkg_author_href(const char *pkgid)
964 char *author_href = NULL;
965 pkgmgrinfo_pkginfo_h handle;
966 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
967 if (ret != PMINFO_R_OK)
969 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
970 if (ret != PMINFO_R_OK) {
971 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
974 printf("pkg author href: %s\n", author_href);
975 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
980 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
983 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
984 * @brief This API gets the package installed storagae value from the package ID
986 * @par This API is for package-manager client application
987 * @par Sync (or) Async : Synchronous API
989 * @param[in] handle pointer to package info handle
990 * @param[out] storage pointer to hold package installed storage
991 * @return 0 if success, error code(<0) if fail
992 * @retval PMINFO_R_OK success
993 * @retval PMINFO_R_EINVAL invalid argument
994 * @retval PMINFO_R_ERROR internal error
995 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
996 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
997 * @see pkgmgrinfo_pkginfo_get_pkgid()
998 * @see pkgmgrinfo_pkginfo_is_removable()
1000 static int get_pkg_installed_storage(const char *pkgid)
1003 pkgmgrinfo_installed_storage storage;
1004 pkgmgrinfo_pkginfo_h handle;
1005 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1006 if (ret != PMINFO_R_OK)
1008 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1009 if (ret != PMINFO_R_OK) {
1010 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1013 printf("pkg installed storage: %d\n", storage);
1014 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1019 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1022 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1023 * @brief This API gets the installed time of package from the package ID
1025 * @par This API is for package-manager client application
1026 * @par Sync (or) Async : Synchronous API
1028 * @param[in] handle pointer to package info handle
1029 * @param[out] installed_time pointer to hold installed time of package
1030 * @return 0 if success, error code(<0) if fail
1031 * @retval PMINFO_R_OK success
1032 * @retval PMINFO_R_EINVAL invalid argument
1033 * @retval PMINFO_R_ERROR internal error
1034 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1035 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1036 * @see pkgmgrinfo_pkginfo_get_pkgid()
1037 * @see pkgmgrinfo_pkginfo_is_removable()
1039 static int get_pkg_installed_time(const char *pkgid)
1042 int installed_time = 0;
1043 pkgmgrinfo_pkginfo_h handle;
1044 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1045 if (ret != PMINFO_R_OK)
1047 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1048 if (ret != PMINFO_R_OK) {
1049 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1052 printf("installed_time: %d\n", installed_time);
1053 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1058 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1061 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1062 * @brief This API creates the update info handle
1064 * @par This API is for package-manager client application
1065 * @par Sync (or) Async : Synchronous API
1067 * @param[out] handle pointer to package update info handle
1068 * @return 0 if success, error code(<0) if fail
1069 * @retval PMINFO_R_OK success
1070 * @retval PMINFO_R_EINVAL invalid argument
1071 * @retval PMINFO_R_ERROR internal error
1072 * @post pkgmgrinfo_updateinfo_destroy()
1073 * @see pkgmgrinfo_updateinfo_set_pkgid()
1074 * @see pkgmgrinfo_updateinfo_set_version()
1075 * @see pkgmgrinfo_updateinfo_set_type()
1076 * @see pkgmgr_client_register_pkg_updateinfo()
1078 static int updateinfo_handle_create()
1082 pkgmgrinfo_updateinfo_h handle;
1083 ret = pkgmgrinfo_updateinfo_create(&handle);
1084 if (ret != PMINFO_R_OK)
1086 pkgmgrinfo_update_infodestroy(handle);
1091 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1094 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1095 * @brief This API destroy the update info handle
1097 * @par This API is for package-manager client application
1098 * @par Sync (or) Async : Synchronous API
1100 * @param[in] handle pointer to package update info handle
1101 * @return 0 if success, error code(<0) if fail
1102 * @retval PMINFO_R_OK success
1103 * @retval PMINFO_R_EINVAL invalid argument
1104 * @pre pkgmgrinfo_updateinfo_create()
1105 * @see pkgmgr_client_register_pkg_updateinfo()
1107 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1111 ret = pkgmgrinfo_updateinfo_destroy(handle);
1112 if (ret != PMINFO_R_OK)
1118 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1121 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1122 * @brief This API creates the package update information handle from db
1124 * @par This API is for package-manager client application
1125 * @par Sync (or) Async : Synchronous API
1127 * @param[in] pkgid pointer to package ID
1128 * @param[in] uid the addressee user id of the instruction
1129 * @param[out] update_handle pointer to the package update info handle.
1130 * @return 0 if success, error code(<0) if fail
1131 * @retval PMINFO_R_OK success
1132 * @retval PMINFO_R_EINVAL invalid argument
1133 * @retval PMINFO_R_ERROR internal error
1135 * @post pkgmgrinfo_updateinfo_destroy()
1136 * @see pkgmgrinfo_updateinfo_get_pkgid()
1137 * @see pkgmgrinfo_updateinfo_get_version()
1138 * @see pkgmgrinfo_updateinfo_get_update_type()
1140 static int get_pkg_update_info(const char *pkgid)
1144 pkgmgrinfo_updateinfo_h handle;
1145 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1146 if (ret != PMINFO_R_OK)
1148 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1149 if (ret != PMINFO_R_OK) {
1150 pkgmgrinfo_updateinfo_destroy(handle);
1153 printf("pkg update version: %s\n", version
1154 pkgmgrinfo_updateinfo_destroy(handle);
1159 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1160 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1163 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1164 * @brief This API sets given pkgid into handle
1166 * @par This API is for package-manager client application
1167 * @par Sync (or) Async : Synchronous API
1169 * @param[in] handle pointer to package update info handle
1170 * @param[in] pkgid package id
1171 * @return 0 if success, error code(<0) if fail
1172 * @retval PMINFO_R_OK success
1173 * @retval PMINFO_R_EINVAL invalid argument
1174 * @retval PMINFO_R_ERROR internal error
1176 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1180 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1181 if (ret != PMINFO_R_OK)
1187 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1190 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1191 * @brief This API sets given version into handle
1193 * @par This API is for package-manager client application
1194 * @par Sync (or) Async : Synchronous API
1196 * @param[in] handle pointer to package update info handle
1197 * @param[in] version update version
1198 * @return 0 if success, error code(<0) if fail
1199 * @retval PMINFO_R_OK success
1200 * @retval PMINFO_R_EINVAL invalid argument
1201 * @retval PMINFO_R_ERROR internal error
1203 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1207 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1208 if (ret != PMINFO_R_OK)
1214 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1217 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1218 * @brief This API sets given update type into handle
1220 * @par This API is for package-manager client application
1221 * @par Sync (or) Async : Synchronous API
1223 * @param[in] handle pointer to package update info handle
1224 * @param[in] type update type
1225 * @return 0 if success, error code(<0) if fail
1226 * @retval PMINFO_R_OK success
1227 * @retval PMINFO_R_EINVAL invalid argument
1228 * @retval PMINFO_R_ERROR internal error
1230 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1234 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1235 if (ret != PMINFO_R_OK)
1241 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1244 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1245 * @brief This API retrieves the pkgid from given update info
1247 * @par This API is for package-manager client application
1248 * @par Sync (or) Async : Synchronous API
1250 * @param[in] handle pointer to package update info handle
1251 * @param[out] pkgid package id
1252 * @return 0 if success, error code(<0) if fail
1253 * @retval PMINFO_R_OK success
1254 * @retval PMINFO_R_EINVAL invalid argument
1255 * @retval PMINFO_R_ERROR internal error
1257 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1262 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1263 if (ret != PMINFO_R_OK)
1269 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1272 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1273 * @brief This API retrieves the version from given update info
1275 * @par This API is for package-manager client application
1276 * @par Sync (or) Async : Synchronous API
1278 * @param[in] handle pointer to package update info handle
1279 * @param[out] version update version
1280 * @return 0 if success, error code(<0) if fail
1281 * @retval PMINFO_R_OK success
1282 * @retval PMINFO_R_EINVAL invalid argument
1283 * @retval PMINFO_R_ERROR internal error
1285 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1290 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1291 if (ret != PMINFO_R_OK)
1297 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1300 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1301 * @brief This API retrieves the update type from given update info
1303 * @par This API is for package-manager client application
1304 * @par Sync (or) Async : Synchronous API
1306 * @param[in] handle pointer to package update info handle
1307 * @param[out] type update type
1308 * @return 0 if success, error code(<0) if fail
1309 * @retval PMINFO_R_OK success
1310 * @retval PMINFO_R_EINVAL invalid argument
1311 * @retval PMINFO_R_ERROR internal error
1313 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1316 pkgmgrinfo_updateinfo_update_type *type;
1318 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1319 if (ret != PMINFO_R_OK)
1325 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1329 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1330 * @brief This API retrieve the update informations and invoke given callback for it.
1332 * @par This API is for package-manager client application
1333 * @par Sync (or) Async : Synchronous API
1335 * @param[in] callback callback to be invoked for each retrieved informations
1336 * @param[in] user_data user data to be passed to callback
1337 * @return 0 if success, error code(<0) if fail
1338 * @retval PMINFO_R_OK success
1339 * @retval PMINFO_R_EINVAL invalid argument
1340 * @retval PMINFO_R_ERROR internal error
1342 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1346 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1347 if (ret != PMINFO_R_OK)
1353 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1354 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1357 * @fn int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name, bool *is_executed);
1358 * @brief This API checkes whether given plugin had been executed with given package ID and application ID or not.
1360 * @par This API is for package-manager client application
1361 * @par Sync (or) Async : Synchronous API
1363 * @param[in] pkgid package ID
1364 * @param[in] appid application ID
1365 * @param[in] plugin_type plugin type to be checked
1366 * @param[in] plugin_name plugin name to be checked
1367 * @param[out] is_executed check result
1368 * @return 0 if success, error code(<0) if fail
1369 * @retval PMINFO_R_OK success
1370 * @retval PMINFO_R_EINVAL invalid argument
1371 * @retval PMINFO_R_ERROR internal error
1373 static bool check_execute_info(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name)
1378 ret = pkgmgrinfo_plugininfo_is_executed(pkgid, appid, plugin_type, plugin_name, &is_executed);
1379 if (ret != PMINFO_R_OK)
1381 printf("is checked is [%d]\n", is_executed);
1386 int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid,
1387 const char *plugin_type, const char *plugin_name, bool *is_executed);
1390 * @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);
1391 * @brief This API retrieve the previous plugin execution info and invoke callbacks each of it.
1393 * @par This API is for package-manager client application
1394 * @par Sync (or) Async : Synchronous API
1396 * @param[in] pkgid package ID
1397 * @param[in] plugin_type type of plugin
1398 * @param[in] plugin_name name of plugin
1399 * @param[in] plugin_list_cb callback to be invoked for each plugin execution info
1400 * @param[out] user_data user data to be passed to callback
1401 * @return 0 if success, error code(<0) if fail
1402 * @retval PMINFO_R_OK success
1403 * @retval PMINFO_R_EINVAL invalid argument
1404 * @retval PMINFO_R_ERROR internal error
1406 static int foreach_pkg_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb callback)
1410 ret = pkgmgrinfo_plugininfo_foreach_plugininfo(pkgid, plugin_type, plugin_name, callback, NULL);
1411 if (ret != PMINFO_R_OK)
1417 int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
1418 const char *plugin_type, const char *plugin_name,
1419 pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1422 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1423 * @brief This API gets the launch mode of package from the package ID
1425 * @par This API is for package-manager client application
1426 * @par Sync (or) Async : Synchronous API
1428 * @param[in] handle pointer to package info handle
1429 * @param[out] mode pointer to hold launch mode of package
1430 * @return 0 if success, error code(<0) if fail
1431 * @retval PMINFO_R_OK success
1432 * @retval PMINFO_R_EINVAL invalid argument
1433 * @retval PMINFO_R_ERROR internal error
1434 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1435 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1436 * @see pkgmgrinfo_pkginfo_get_pkgid()
1437 * @see pkgmgrinfo_pkginfo_is_removable()
1439 static int get_pkg_launch_mode(const char *pkgid)
1442 char *launch_mode = NULL;
1443 pkgmgrinfo_pkginfo_h handle;
1444 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1445 if (ret != PMINFO_R_OK)
1447 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1448 if (ret != PMINFO_R_OK) {
1449 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1452 printf("launch mode: %s\n", mode);
1453 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1458 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1461 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1462 * @brief This API gets the store client id of package from the package ID
1464 * @par This API is for package-manager client application
1465 * @par Sync (or) Async : Synchronous API
1467 * @param[in] handle pointer to package info handle
1468 * @param[out] storeclientid pointer to hold store client id of package
1469 * @return 0 if success, error code(<0) if fail
1470 * @retval PMINFO_R_OK success
1471 * @retval PMINFO_R_EINVAL invalid argument
1472 * @retval PMINFO_R_ERROR internal error
1473 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1474 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1475 * @see pkgmgrinfo_pkginfo_get_pkgid()
1476 * @see pkgmgrinfo_pkginfo_is_removable()
1478 static int get_pkg_storeclientid(const char *pkgid)
1481 char *storeclientid = 0;
1482 pkgmgrinfo_pkginfo_h handle;
1483 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1484 if (ret != PMINFO_R_OK)
1486 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1487 if (ret != PMINFO_R_OK) {
1488 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1491 printf(store client id: %s\n", storeclientid);
1492 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1497 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1500 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1501 * @brief This API gets the main app id of package from the package ID
1503 * @par This API is for package-manager client application
1504 * @par Sync (or) Async : Synchronous API
1506 * @param[in] handle pointer to package info handle
1507 * @param[out] mainappid pointer to hold main app id of package
1508 * @return 0 if success, error code(<0) if fail
1509 * @retval PMINFO_R_OK success
1510 * @retval PMINFO_R_EINVAL invalid argument
1511 * @retval PMINFO_R_ERROR internal error
1512 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1513 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1514 * @see pkgmgrinfo_pkginfo_get_pkgid()
1515 * @see pkgmgrinfo_pkginfo_is_removable()
1517 static int get_pkg_mainappid(const char *pkgid)
1520 char *mainappid = 0;
1521 pkgmgrinfo_pkginfo_h handle;
1522 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1523 if (ret != PMINFO_R_OK)
1525 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1526 if (ret != PMINFO_R_OK) {
1527 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1530 printf(main app id: %s\n", mainappid);
1531 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1536 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1539 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1540 * @brief This API gets the url of package from the package ID
1542 * @par This API is for package-manager client application
1543 * @par Sync (or) Async : Synchronous API
1545 * @param[in] handle pointer to package info handle
1546 * @param[out] url pointer to hold url of package
1547 * @return 0 if success, error code(<0) if fail
1548 * @retval PMINFO_R_OK success
1549 * @retval PMINFO_R_EINVAL invalid argument
1550 * @retval PMINFO_R_ERROR internal error
1551 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1552 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1553 * @see pkgmgrinfo_pkginfo_get_pkgid()
1554 * @see pkgmgrinfo_pkginfo_is_removable()
1556 static int get_pkg_url(const char *pkgid)
1560 pkgmgrinfo_pkginfo_h handle;
1561 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1562 if (ret != PMINFO_R_OK)
1564 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1565 if (ret != PMINFO_R_OK) {
1566 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1569 printf("url : %s\n", url);
1570 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1575 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1578 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1579 * @brief This API gets the root path of package
1581 * @par Sync (or) Async : Synchronous API
1583 * @param[in] handle pointer to package info handle
1584 * @param[out] path pointer to hold root path of package
1585 * @return 0 if success, error code(<0) if fail
1586 * @retval PMINFO_R_OK success
1587 * @retval PMINFO_R_EINVAL invalid argument
1588 * @retval PMINFO_R_ERROR internal error
1590 static int get_root_path(const char *pkgid)
1594 pkgmgrinfo_pkginfo_h handle;
1595 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1596 if (ret != PMINFO_R_OK)
1599 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1600 if (ret != PMINFO_R_OK) {
1601 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1604 printf("path : %s\n", path);
1605 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1615 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1616 * @brief This API gets the csc path of package
1618 * @par Sync (or) Async : Synchronous API
1620 * @param[in] handle pointer to package info handle
1621 * @param[out] path pointer to hold csc path of package
1622 * @return 0 if success, error code(<0) if fail
1623 * @retval PMINFO_R_OK success
1624 * @retval PMINFO_R_EINVAL invalid argument
1625 * @retval PMINFO_R_ERROR internal error
1627 static int get_csc_path(const char *pkgid)
1631 pkgmgrinfo_pkginfo_h handle;
1632 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1633 if (ret != PMINFO_R_OK)
1636 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1637 if (ret != PMINFO_R_OK) {
1638 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1641 printf("path : %s\n", path);
1642 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1648 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1651 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1652 * @brief This API gets the support_mode of package
1654 * @par Sync (or) Async : Synchronous API
1656 * @param[in] handle pointer to package info handle
1657 * @param[out] support_mode pointer to hold support_mode of package
1658 * @return 0 if success, error code(<0) if fail
1659 * @retval PMINFO_R_OK success
1660 * @retval PMINFO_R_EINVAL invalid argument
1661 * @retval PMINFO_R_ERROR internal error
1663 static int get_support_mode(const char *pkgid)
1666 int support_mode = 0;
1667 pkgmgrinfo_pkginfo_h handle = NULL;
1668 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1669 if (ret != PMINFO_R_OK)
1672 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1673 if (ret != PMINFO_R_OK) {
1674 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1677 printf("support_mode : %s\n", support_mode);
1678 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1684 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1687 * @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)
1688 * @brief This API compare the cert information from given package id
1690 * @par This API is for package-manager client application
1691 * @par Sync (or) Async : Synchronous API
1693 * @param[in] lhs_package_id pointer to first package ID
1694 * @param[in] rhs_package_id pointer to second package ID
1695 * @param[out] compare_result pointer to the compare result.
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 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1702 * @see pkgmgrinfo_pkginfo_get_pkgid()
1703 * @see pkgmgrinfo_pkginfo_is_removable()
1705 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1708 pkgmgrinfo_cert_compare_result_type_e result;
1710 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1711 if (ret != PMINFO_R_OK) {
1714 printf("result: %d\n", result);
1719 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);
1720 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);
1722 * @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)
1723 * @brief This API compare the cert information from given app id
1725 * @par This API is for package-manager client application
1726 * @par Sync (or) Async : Synchronous API
1728 * @param[in] lhs_app_id pointer to first app ID
1729 * @param[in] rhs_app_id pointer to second app ID
1730 * @param[out] compare_result pointer to the compare result.
1731 * @return 0 if success, error code(<0) if fail
1732 * @retval PMINFO_R_OK success
1733 * @retval PMINFO_R_EINVAL invalid argument
1734 * @retval PMINFO_R_ERROR internal error
1736 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1737 * @see pkgmgrinfo_pkginfo_get_pkgid()
1738 * @see pkgmgrinfo_pkginfo_is_removable()
1740 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1743 pkgmgrinfo_cert_compare_result_type_e result;
1745 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1746 if (ret != PMINFO_R_OK) {
1749 printf("result: %d\n", result);
1754 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);
1755 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);
1757 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1758 * @brief This API gets the package 'removable' value from the package ID
1760 * @par This API is for package-manager client application
1761 * @par Sync (or) Async : Synchronous API
1763 * @param[in] handle pointer to package info handle
1764 * @param[out] removable pointer to hold package removable value
1765 * @return 0 if success, error code(<0) if fail
1766 * @retval PMINFO_R_OK success
1767 * @retval PMINFO_R_EINVAL invalid argument
1768 * @retval PMINFO_R_ERROR internal error
1769 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1770 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1771 * @see pkgmgrinfo_pkginfo_get_pkgid()
1772 * @see pkgmgrinfo_pkginfo_is_readonly()
1774 static int get_pkg_removable(const char *pkgid)
1778 pkgmgrinfo_pkginfo_h handle;
1779 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1780 if (ret != PMINFO_R_OK)
1782 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1783 if (ret != PMINFO_R_OK) {
1784 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1787 printf("pkg removable: %d\n", removable);
1788 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1793 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1796 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1797 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1799 * @par This API is for package-manager client application
1800 * @par Sync (or) Async : Synchronous API
1802 * @param[in] handle pointer to package info handle
1803 * @param[out] movable pointer to hold package movable state
1804 * @return 0 if success, error code(<0) if fail
1805 * @retval PMINFO_R_OK success
1806 * @retval PMINFO_R_EINVAL invalid argument
1807 * @retval PMINFO_R_ERROR internal error
1808 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1809 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1810 * @see pkgmgrinfo_pkginfo_get_pkgid()
1812 static int get_pkg_movable(const char *pkgid)
1816 pkgmgrinfo_pkginfo_h handle;
1817 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1818 if (ret != PMINFO_R_OK)
1820 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1821 if (ret != PMINFO_R_OK) {
1822 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1825 printf("pkg movable: %d\n", movable);
1826 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1831 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1834 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1835 * @brief This API gets the package 'preload' value from the package ID
1837 * @par This API is for package-manager client application
1838 * @par Sync (or) Async : Synchronous API
1840 * @param[in] handle pointer to package info handle
1841 * @param[out] preload pointer to hold package preload value
1842 * @return 0 if success, error code(<0) if fail
1843 * @retval PMINFO_R_OK success
1844 * @retval PMINFO_R_EINVAL invalid argument
1845 * @retval PMINFO_R_ERROR internal error
1846 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1847 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1848 * @see pkgmgrinfo_pkginfo_get_pkgid()
1849 * @see pkgmgrinfo_pkginfo_is_readonly()
1851 static int get_pkg_preload(const char *pkgid)
1855 pkgmgrinfo_pkginfo_h handle;
1856 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1857 if (ret != PMINFO_R_OK)
1859 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1860 if (ret != PMINFO_R_OK) {
1861 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1864 printf("pkg preload: %d\n", preload);
1865 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1870 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1873 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1874 * @brief This API gets the value for given handle is system or not
1876 * @par This API is for package-manager client application
1877 * @par Sync (or) Async : Synchronous API
1879 * @param[in] handle pointer to package info handle
1880 * @param[out] system pointer to hold system is or not
1881 * @return 0 if success, error code(<0) if fail
1882 * @retval PMINFO_R_OK success
1883 * @retval PMINFO_R_EINVAL invalid argument
1884 * @retval PMINFO_R_ERROR internal error
1885 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1886 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1887 * @see pkgmgrinfo_pkginfo_get_pkgid()
1888 * @see pkgmgrinfo_pkginfo_is_readonly()
1890 static int get_pkg_system(const char *pkgid)
1893 bool system = false;
1894 pkgmgrinfo_pkginfo_h handle = NULL;
1895 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1896 if (ret != PMINFO_R_OK)
1898 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1899 if (ret != PMINFO_R_OK) {
1900 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1903 printf("pkg system: %d\n", system);
1904 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1909 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1912 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1913 * @brief This API gets the package 'readonly' value from the package ID
1915 * @par This API is for package-manager client application
1916 * @par Sync (or) Async : Synchronous API
1918 * @param[in] handle pointer to package info handle
1919 * @param[out] readonly pointer to hold package readonly value
1920 * @return 0 if success, error code(<0) if fail
1921 * @retval PMINFO_R_OK success
1922 * @retval PMINFO_R_EINVAL invalid argument
1923 * @retval PMINFO_R_ERROR internal error
1924 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1925 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1926 * @see pkgmgrinfo_pkginfo_get_pkgid()
1927 * @see pkgmgrinfo_pkginfo_is_removable()
1929 static int get_pkg_readonly(const char *pkgid)
1933 pkgmgrinfo_pkginfo_h handle;
1934 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1935 if (ret != PMINFO_R_OK)
1937 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1938 if (ret != PMINFO_R_OK) {
1939 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1942 printf("pkg readonly: %d\n", readonly);
1943 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1948 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1952 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1953 * @brief This API gets the package 'upate' value from the package ID
1955 * @par This API is for package-manager client application
1956 * @par Sync (or) Async : Synchronous API
1958 * @param[in] handle pointer to package info handle
1959 * @param[out] update pointer to hold package update value
1960 * @return 0 if success, error code(<0) if fail
1961 * @retval PMINFO_R_OK success
1962 * @retval PMINFO_R_EINVAL invalid argument
1963 * @retval PMINFO_R_ERROR internal error
1964 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1965 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1966 * @see pkgmgrinfo_pkginfo_get_pkgid()
1968 static int get_pkg_update(const char *pkgid)
1972 pkgmgrinfo_pkginfo_h handle;
1973 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1974 if (ret != PMINFO_R_OK)
1976 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1977 if (ret != PMINFO_R_OK) {
1978 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1981 printf("pkg update: %d\n", update);
1982 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1987 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1990 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1991 * @brief This API gets the package 'support_disable' value from the package ID
1993 * @par This API is for package-manager client application
1994 * @par Sync (or) Async : Synchronous API
1996 * @param[in] handle pointer to package info handle
1997 * @param[out] support_disable pointer to hold package support_disable value
1998 * @return 0 if success, error code(<0) if fail
1999 * @retval PMINFO_R_OK success
2000 * @retval PMINFO_R_EINVAL invalid argument
2001 * @retval PMINFO_R_ERROR internal error
2002 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2003 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2004 * @see pkgmgrinfo_pkginfo_get_pkgid()
2006 static int get_pkg_support_disable(const char *pkgid)
2009 bool support_disable;
2010 pkgmgrinfo_pkginfo_h handle = NULL;
2011 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2012 if (ret != PMINFO_R_OK)
2014 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2015 if (ret != PMINFO_R_OK) {
2016 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2019 printf("pkg support_disable: %d\n", support_disable);
2020 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2025 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2028 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2029 * @brief This API gets whethere the given package is global package or user package
2031 * @par This API is for package-manager client application
2032 * @par Sync (or) Async : Synchronous API
2034 * @param[in] handle pointer to package info handle
2035 * @param[in] global pointer to hold package global value
2036 * @return 0 if success, error code(<0) if fail
2037 * @retval PMINFO_R_OK success
2038 * @retval PMINFO_R_EINVAL invalid argument
2039 * @retval PMINFO_R_ERROR internal error
2040 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2041 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2042 * @see pkgmgrinfo_pkginfo_get_pkgid()
2043 static int get_pkg_support_disable(const char *pkgid)
2047 pkgmgrinfo_pkginfo_h handle = NULL;
2048 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2049 if (ret != PMINFO_R_OK)
2051 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2052 if (ret != PMINFO_R_OK) {
2053 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2056 printf("pkg is_global: %d\n", global);
2057 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2062 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2065 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2066 * @brief This API gets the package 'accessible' value from the package ID
2068 * @par This API is for package-manager client application
2069 * @par Sync (or) Async : Synchronous API
2071 * @param[in] handle pointer to package info handle
2072 * @param[out] accessible pointer to hold package accessible value
2073 * @return 0 if success, error code(<0) if fail
2074 * @retval PMINFO_R_OK success
2075 * @retval PMINFO_R_EINVAL invalid argument
2076 * @retval PMINFO_R_ERROR internal error
2077 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2078 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2079 * @see pkgmgrinfo_pkginfo_get_pkgid()
2080 * @see pkgmgrinfo_pkginfo_is_readonly()
2082 static int get_pkg_accessible(const char *pkgid)
2086 pkgmgrinfo_pkginfo_h handle;
2087 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2088 if (ret != PMINFO_R_OK)
2090 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2091 if (ret != PMINFO_R_OK) {
2092 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2095 printf("pkg accessible: %d\n", accessible);
2096 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2101 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2104 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2105 * @brief This API destroys the package information handle freeing up all the resources
2107 * @par This API is for package-manager client application
2108 * @par Sync (or) Async : Synchronous API
2110 * @param[in] handle pointer to the package info handle
2111 * @return 0 if success, error code(<0) if fail
2112 * @retval PMINFO_R_OK success
2113 * @retval PMINFO_R_EINVAL invalid argument
2114 * @retval PMINFO_R_ERROR internal error
2115 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2117 * @see pkgmgrinfo_pkginfo_get_pkgid()
2118 * @see pkgmgrinfo_pkginfo_is_removable()
2120 static int get_pkg_type(const char *pkgid)
2124 pkgmgrinfo_pkginfo_h handle;
2125 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2126 if (ret != PMINFO_R_OK)
2128 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2129 if (ret != PMINFO_R_OK) {
2130 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2133 printf("pkgtype: %s\n", type);
2134 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2139 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2142 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2143 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2144 The query will search the entire package information collected from the manifest file of all the installed packages
2146 * @par This API is for package-manager client application
2147 * @par Sync (or) Async : Synchronous API
2149 * @param[out] handle pointer to the package info filter handle.
2150 * @return 0 if success, error code(<0) if fail
2151 * @retval PMINFO_R_OK success
2152 * @retval PMINFO_R_EINVAL invalid argument
2153 * @retval PMINFO_R_ERROR internal error
2155 * @post pkgmgrinfo_pkginfo_filter_destroy()
2156 * @see pkgmgrinfo_pkginfo_filter_count()
2157 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2159 static int get_tpk_pkg_count()
2163 pkgmgrinfo_pkginfo_filter_h handle;
2164 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2165 if (ret != PMINFO_R_OK)
2167 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2168 if (ret != PMINFO_R_OK) {
2169 pkgmgrinfo_pkginfo_filter_destroy(handle);
2172 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2173 if (ret != PMINFO_R_OK) {
2174 pkgmgrinfo_pkginfo_filter_destroy(handle);
2177 printf("No of tpk pkgs: %d\n", count);
2178 pkgmgrinfo_pkginfo_filter_destroy(handle);
2183 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2186 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2187 * @brief This API destroys the package information filter handle freeing up all the resources
2189 * @par This API is for package-manager client application
2190 * @par Sync (or) Async : Synchronous API
2192 * @param[in] handle pointer to the package info filter handle.
2193 * @return 0 if success, error code(<0) if fail
2194 * @retval PMINFO_R_OK success
2195 * @retval PMINFO_R_EINVAL invalid argument
2196 * @retval PMINFO_R_ERROR internal error
2197 * @pre pkgmgrinfo_pkginfo_filter_create()
2199 * @see pkgmgrinfo_pkginfo_filter_count()
2200 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2202 static int get_tpk_pkg_count()
2206 pkgmgrinfo_pkginfo_filter_h handle;
2207 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2208 if (ret != PMINFO_R_OK)
2210 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2211 if (ret != PMINFO_R_OK) {
2212 pkgmgrinfo_pkginfo_filter_destroy(handle);
2215 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2216 if (ret != PMINFO_R_OK) {
2217 pkgmgrinfo_pkginfo_filter_destroy(handle);
2220 printf("No of tpk pkgs: %d\n", count);
2221 pkgmgrinfo_pkginfo_filter_destroy(handle);
2226 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2229 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2230 * @brief This API adds a boolean filter property to the filter handle
2232 * @par This API is for package-manager client application
2233 * @par Sync (or) Async : Synchronous API
2235 * @param[in] handle pointer to the package info filter handle.
2236 * @param[in] property boolean property name.
2237 * @param[in] value value corresponding to the property.
2238 * @return 0 if success, error code(<0) if fail
2239 * @retval PMINFO_R_OK success
2240 * @retval PMINFO_R_EINVAL invalid argument
2241 * @retval PMINFO_R_ERROR internal error
2242 * @pre pkgmgrinfo_pkginfo_filter_create()
2243 * @post pkgmgrinfo_pkginfo_filter_destroy()
2244 * @see pkgmgrinfo_pkginfo_filter_count()
2245 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2247 static int get_preload_pkg_count()
2251 pkgmgrinfo_pkginfo_filter_h handle;
2252 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2253 if (ret != PMINFO_R_OK)
2255 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2256 if (ret != PMINFO_R_OK) {
2257 pkgmgrinfo_pkginfo_filter_destroy(handle);
2260 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2261 if (ret != PMINFO_R_OK) {
2262 pkgmgrinfo_pkginfo_filter_destroy(handle);
2265 printf("No of preload pkgs: %d\n", count);
2266 pkgmgrinfo_pkginfo_filter_destroy(handle);
2271 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2272 const char *property, const bool value);
2275 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2276 * @brief This API adds an integer filter property to the filter handle
2278 * @par This API is for package-manager client application
2279 * @par Sync (or) Async : Synchronous API
2281 * @param[in] handle pointer to the package info filter handle.
2282 * @param[in] property integer property name.
2283 * @param[in] value value corresponding to the property.
2284 * @return 0 if success, error code(<0) if fail
2285 * @retval PMINFO_R_OK success
2286 * @retval PMINFO_R_EINVAL invalid argument
2287 * @retval PMINFO_R_ERROR internal error
2288 * @pre pkgmgrinfo_pkginfo_filter_create()
2289 * @post pkgmgrinfo_pkginfo_filter_destroy()
2290 * @see pkgmgrinfo_pkginfo_filter_count()
2291 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2293 static int get_pkg_count()
2297 pkgmgrinfo_pkginfo_filter_h handle;
2298 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2299 if (ret != PMINFO_R_OK)
2301 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2302 if (ret != PMINFO_R_OK) {
2303 pkgmgrinfo_pkginfo_filter_destroy(handle);
2306 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2307 if (ret != PMINFO_R_OK) {
2308 pkgmgrinfo_pkginfo_filter_destroy(handle);
2311 printf("No of preload pkgs: %d\n", count);
2312 pkgmgrinfo_pkginfo_filter_destroy(handle);
2317 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2318 const char *property, const int value);
2321 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2322 * @brief This API adds a string filter property to the filter handle
2324 * @par This API is for package-manager client application
2325 * @par Sync (or) Async : Synchronous API
2327 * @param[in] handle pointer to the package info filter handle.
2328 * @param[in] property string property name.
2329 * @param[in] value value corresponding to the property.
2330 * @return 0 if success, error code(<0) if fail
2331 * @retval PMINFO_R_OK success
2332 * @retval PMINFO_R_EINVAL invalid argument
2333 * @retval PMINFO_R_ERROR internal error
2334 * @pre pkgmgrinfo_pkginfo_filter_create()
2335 * @post pkgmgrinfo_pkginfo_filter_destroy()
2336 * @see pkgmgrinfo_pkginfo_filter_count()
2337 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2339 static int get_tpk_pkg_count()
2343 pkgmgrinfo_pkginfo_filter_h handle;
2344 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2345 if (ret != PMINFO_R_OK)
2347 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2348 if (ret != PMINFO_R_OK) {
2349 pkgmgrinfo_pkginfo_filter_destroy(handle);
2352 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2353 if (ret != PMINFO_R_OK) {
2354 pkgmgrinfo_pkginfo_filter_destroy(handle);
2357 printf("No of tpk pkgs: %d\n", count);
2358 pkgmgrinfo_pkginfo_filter_destroy(handle);
2363 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2364 const char *property, const char *value);
2367 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2368 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2370 * @par This API is for package-manager client application
2371 * @par Sync (or) Async : Synchronous API
2373 * @param[in] handle pointer to the package info filter handle.
2374 * @param[in] pkg_cb callback function.
2375 * @param[in] user_data user data to be passed to the callback function
2376 * @return 0 if success, error code(<0) if fail
2377 * @retval PMINFO_R_OK success
2378 * @retval PMINFO_R_EINVAL invalid argument
2379 * @retval PMINFO_R_ERROR internal error
2380 * @pre pkgmgrinfo_pkginfo_filter_create()
2381 * @post pkgmgrinfo_pkginfo_filter_destroy()
2382 * @see pkgmgrinfo_pkginfo_filter_count()
2384 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2387 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2388 printf("pkg id : %s\n", pkgid);
2392 static int get_tpk_pkg_list()
2395 pkgmgrinfo_pkginfo_filter_h handle;
2396 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2397 if (ret != PMINFO_R_OK)
2399 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2400 if (ret != PMINFO_R_OK) {
2401 pkgmgrinfo_pkginfo_filter_destroy(handle);
2404 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2405 if (ret != PMINFO_R_OK) {
2406 pkgmgrinfo_pkginfo_filter_destroy(handle);
2409 pkgmgrinfo_pkginfo_filter_destroy(handle);
2414 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2415 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2416 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2417 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2420 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2421 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2422 * @brief This API counts the package that satisfy the filter conditions
2424 * @par This API is for package-manager client application
2425 * @par Sync (or) Async : Synchronous API
2427 * @param[in] handle pointer to the package info filter handle.
2428 * @param[in] count pointer to store the count value.
2429 * @param[in] uid the addressee user id of the instruction
2430 * @return 0 if success, error code(<0) if fail
2431 * @retval PMINFO_R_OK success
2432 * @retval PMINFO_R_EINVAL invalid argument
2433 * @retval PMINFO_R_ERROR internal error
2434 * @pre pkgmgrinfo_pkginfo_filter_create()
2435 * @post pkgmgrinfo_pkginfo_filter_destroy()
2436 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2438 static int get_tpk_pkg_count()
2442 pkgmgrinfo_pkginfo_filter_h handle;
2443 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2444 if (ret != PMINFO_R_OK)
2446 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2447 if (ret != PMINFO_R_OK) {
2448 pkgmgrinfo_pkginfo_filter_destroy(handle);
2451 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2452 if (ret != PMINFO_R_OK) {
2453 pkgmgrinfo_pkginfo_filter_destroy(handle);
2456 printf("No of tpk pkgs: %d\n", count);
2457 pkgmgrinfo_pkginfo_filter_destroy(handle);
2462 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2463 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2466 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2467 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2468 * @brief This API gets the list of privilege for a particular package
2470 * @par This API is for package-manager client application
2471 * @par Sync (or) Async : Synchronous API
2472 * @param[in] handle pointer to the package info handle.
2473 * @param[in] privilege_func callback function for list
2474 * @param[in] user_data user data to be passed to callback function
2475 * @return 0 if success, error code(<0) if fail
2476 * @retval PMINFO_R_OK success
2477 * @retval PMINFO_R_EINVAL invalid argument
2478 * @retval PMINFO_R_ERROR internal error
2479 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2480 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2482 int privilege_func(const char *name, void *user_data)
2484 if (strcmp(name, (char *)user_data) == 0)
2490 static int list_privilege(const char *package, char *privilege)
2493 pkgmgrinfo_pkginfo_h handle;
2494 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2495 if (ret != PMINFO_R_OK)
2497 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2498 if (ret != PMINFO_R_OK) {
2499 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2502 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2507 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2508 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2511 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2512 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2513 * @brief This API gets the list of appdefined privilege for a particular package
2515 * @par This API is for package-manager client application
2516 * @par Sync (or) Async : Synchronous API
2517 * @param[in] handle pointer to the package info handle.
2518 * @param[in] privilege_func callback function for list
2519 * @param[in] user_data user data to be passed to callback function
2520 * @return 0 if success, error code(<0) if fail
2521 * @retval PMINFO_R_OK success
2522 * @retval PMINFO_R_EINVAL invalid argument
2523 * @retval PMINFO_R_ERROR internal error
2524 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2525 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2527 int privilege_func(const char *name, const char *license_path, void *user_data)
2529 printf("appdefined privilege : %s", name);
2531 printf("licensed privilege, lecense path : %s", license_path);
2535 static int list_appdefined_privilege(const char *package)
2538 pkgmgrinfo_pkginfo_h handle;
2539 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2540 if (ret != PMINFO_R_OK)
2542 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2543 if (ret != PMINFO_R_OK) {
2544 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2547 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2552 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2553 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2556 * @fn int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2557 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2558 * @brief This API gets the list of plugin execution info for a particular package
2560 * @par This API is for package-manager client application
2561 * @par Sync (or) Async : Synchronous API
2562 * @param[in] handle pointer to the package info handle.
2563 * @param[in] plugin_func callback function for list
2564 * @param[in] user_data user data to be passed to callback function
2565 * @return 0 if success, error code(<0) if fail
2566 * @retval PMINFO_R_OK success
2567 * @retval PMINFO_R_EINVAL invalid argument
2568 * @retval PMINFO_R_ERROR internal error
2569 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2570 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2572 int plugin_func(const char *pkgid, const char *appid,
2573 const char *plugin_type, const char *plugin_name,
2576 printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2581 static int list_plugin(const char *package)
2584 pkgmgrinfo_pkginfo_h handle;
2585 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2586 if (ret != PMINFO_R_OK)
2588 ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2589 if (ret != PMINFO_R_OK) {
2590 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2593 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2598 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2599 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2601 /* TODO: add doxygen comment here */
2602 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2605 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2606 * @brief This API copy the application information handle
2608 * @par This API is for package-manager client application
2609 * @par Sync (or) Async : Synchronous API
2611 * @param[in] handle pointer to the package info handle.
2612 * @param[out] handle pointer to the package info handle.
2613 * @return 0 if success, error code(<0) if fail
2614 * @retval PMINFO_R_OK success
2615 * @retval PMINFO_R_EINVAL invalid argument
2616 * @retval PMINFO_R_ERROR internal error
2618 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2620 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2624 pkgmgrinfo_pkginfo_h clone;
2626 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2627 if (ret != PMINFO_R_OK)
2631 printf("package: %s\n", clone->package);
2632 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2637 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2641 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2642 pkgmgrinfo_app_list_cb app_func, void *user_data)
2643 * @brief This API gets list of installed applications for a particular package
2645 * @par This API is for package-manager client application
2646 * @par Sync (or) Async : Synchronous API
2647 * @param[in] handle package info handle
2648 * @param[in] component application component
2649 * @param[in] app_func iteration function for list
2650 * @param[in] user_data user data to be passed to callback function
2651 * @return 0 if success, error code(<0) if fail
2652 * @retval PMINFO_R_OK success
2653 * @retval PMINFO_R_EINVAL invalid argument
2654 * @retval PMINFO_R_ERROR internal error
2655 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2656 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2658 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2661 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2662 printf("appid : %s\n", appid);
2666 static int list_apps(const char *pkgid)
2669 pkgmgrinfo_pkginfo_h handle;
2670 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2671 if (ret != PMINFO_R_OK)
2673 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2674 if (ret != PMINFO_R_OK) {
2675 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2678 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2683 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2684 pkgmgrinfo_app_list_cb app_func, void *user_data);
2685 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2686 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2689 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2690 * @brief This API gets list of installed applications from all packages with minimum informaion.
2692 * @par This API is for package-manager client application
2693 * @par Sync (or) Async : Synchronous API
2694 * @param[in] app_func iteration function for list
2695 * @param[in] user_data user data to be passed to callback function
2696 * @return 0 if success, error code(<0) if fail
2697 * @retval PMINFO_R_OK success
2698 * @retval PMINFO_R_EINVAL invalid argument
2699 * @retval PMINFO_R_ERROR internal error
2703 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2705 char *pkgid1 = NULL;
2706 char *pkgid2 = NULL;
2707 pkgid1 = (char *)user_data;
2708 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2709 if (strcmp(pkgid1, pkgid2) == 0) {
2716 static int list_apps()
2719 char *name = "helloworld";
2720 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2721 if (ret != PMINFO_R_OK) {
2728 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2729 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2732 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2733 * @brief This API gets list of installed applications from all packages.
2735 * @par This API is for package-manager client application
2736 * @par Sync (or) Async : Synchronous API
2737 * @param[in] app_func iteration function for list
2738 * @param[in] user_data user data to be passed to callback function
2739 * @return 0 if success, error code(<0) if fail
2740 * @retval PMINFO_R_OK success
2741 * @retval PMINFO_R_EINVAL invalid argument
2742 * @retval PMINFO_R_ERROR internal error
2746 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2748 char *pkgid1 = NULL;
2749 char *pkgid2 = NULL;
2750 pkgid1 = (char *)user_data;
2751 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2752 if (strcmp(pkgid1, pkgid2) == 0) {
2759 static int list_apps()
2762 char *name = "helloworld";
2763 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2764 if (ret != PMINFO_R_OK) {
2771 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2772 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2775 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2776 * @brief This API creates the disabled application information handle from db
2778 * @par This API is for package-manager client application
2779 * @par Sync (or) Async : Synchronous API
2781 * @param[in] appid pointer to appid
2782 * @param[out] handle pointer to the application info handle.
2783 * @return 0 if success, error code(<0) if fail
2784 * @retval PMINFO_R_OK success
2785 * @retval PMINFO_R_EINVAL invalid argument
2786 * @retval PMINFO_R_ERROR internal error
2788 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2789 * @see pkgmgrinfo_appinfo_get_pkgid()
2790 * @see pkgmgrinfo_appinfo_is_multiple()
2792 static int get_disabled_app_type(const char *appid)
2796 pkgmgrinfo_appinfo_h handle;
2797 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2798 if (ret != PMINFO_R_OK)
2800 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2801 if (ret != PMINFO_R_OK) {
2802 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2805 printf("apptype: %s\n", type);
2806 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2811 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2812 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2815 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2816 * @brief This API creates the application information handle from db
2818 * @par This API is for package-manager client application
2819 * @par Sync (or) Async : Synchronous API
2821 * @param[in] appid pointer to appid
2822 * @param[out] handle pointer to the application info handle.
2823 * @return 0 if success, error code(<0) if fail
2824 * @retval PMINFO_R_OK success
2825 * @retval PMINFO_R_EINVAL invalid argument
2826 * @retval PMINFO_R_ERROR internal error
2828 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2829 * @see pkgmgrinfo_appinfo_get_pkgid()
2830 * @see pkgmgrinfo_appinfo_is_multiple()
2832 static int get_app_type(const char *appid)
2836 pkgmgrinfo_appinfo_h handle;
2837 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2838 if (ret != PMINFO_R_OK)
2840 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2841 if (ret != PMINFO_R_OK) {
2842 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2845 printf("apptype: %s\n", type);
2846 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2851 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2852 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2855 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2856 * @brief This API creates the application information handle from db regardless of its disable or storage status
2858 * @par This API is for package-manager client application
2859 * @par Sync (or) Async : Synchronous API
2861 * @param[in] appid pointer to appid
2862 * @param[out] handle pointer to the application info handle.
2863 * @return 0 if success, error code(<0) if fail
2864 * @retval PMINFO_R_OK success
2865 * @retval PMINFO_R_EINVAL invalid argument
2866 * @retval PMINFO_R_ERROR internal error
2868 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2869 * @see pkgmgrinfo_appinfo_get_pkgid()
2870 * @see pkgmgrinfo_appinfo_is_multiple()
2872 static int get_app_type(const char *appid)
2876 pkgmgrinfo_appinfo_h handle;
2877 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2878 if (ret != PMINFO_R_OK)
2880 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2881 if (ret != PMINFO_R_OK) {
2882 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2885 printf("apptype: %s\n", type);
2886 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2891 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2892 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2895 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2896 * @brief This API gets the application ID
2898 * @par This API is for package-manager client application
2899 * @par Sync (or) Async : Synchronous API
2901 * @param[in] handle pointer to the application info handle.
2902 * @param[out] appid pointer to hold appid
2903 * @return 0 if success, error code(<0) if fail
2904 * @retval PMINFO_R_OK success
2905 * @retval PMINFO_R_EINVAL invalid argument
2906 * @retval PMINFO_R_ERROR internal error
2907 * @pre pkgmgrinfo_appinfo_get_appinfo()
2908 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2909 * @see pkgmgrinfo_appinfo_get_pkgid()
2910 * @see pkgmgrinfo_appinfo_is_multiple()
2912 static int get_app_id(const char *appid)
2915 char *app_id = NULL;
2916 pkgmgrinfo_appinfo_h handle;
2917 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2918 if (ret != PMINFO_R_OK)
2920 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2921 if (ret != PMINFO_R_OK) {
2922 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2925 printf("app id: %s\n", app_id);
2926 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2931 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2934 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2935 * @brief This API gets the package name of the application
2937 * @par This API is for package-manager client application
2938 * @par Sync (or) Async : Synchronous API
2940 * @param[in] handle pointer to the application info handle.
2941 * @param[out] pkg_name pointer to hold package name
2942 * @return 0 if success, error code(<0) if fail
2943 * @retval PMINFO_R_OK success
2944 * @retval PMINFO_R_EINVAL invalid argument
2945 * @retval PMINFO_R_ERROR internal error
2946 * @pre pkgmgrinfo_appinfo_get_appinfo()
2947 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2948 * @see pkgmgrinfo_appinfo_get_appid()
2949 * @see pkgmgrinfo_appinfo_is_multiple()
2951 static int get_app_pkgname(const char *appid)
2954 char *pkgname = NULL;
2955 pkgmgrinfo_appinfo_h handle;
2956 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2957 if (ret != PMINFO_R_OK)
2959 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2960 if (ret != PMINFO_R_OK) {
2961 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2964 printf("pkg name: %s\n", pkgname);
2965 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2970 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2973 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2974 * @brief This API gets the package id of the application
2976 * @par This API is for package-manager client application
2977 * @par Sync (or) Async : Synchronous API
2979 * @param[in] handle pointer to the application info handle.
2980 * @param[out] pkgid pointer to hold package id
2981 * @return 0 if success, error code(<0) if fail
2982 * @retval PMINFO_R_OK success
2983 * @retval PMINFO_R_EINVAL invalid argument
2984 * @retval PMINFO_R_ERROR internal error
2985 * @pre pkgmgrinfo_appinfo_get_appinfo()
2986 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2987 * @see pkgmgrinfo_appinfo_get_appid()
2988 * @see pkgmgrinfo_appinfo_is_multiple()
2990 static int get_app_pkgid(const char *appid)
2994 pkgmgrinfo_appinfo_h handle;
2995 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2996 if (ret != PMINFO_R_OK)
2998 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2999 if (ret != PMINFO_R_OK) {
3000 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3003 printf("pkg id: %s\n", pkgid);
3004 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3009 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
3012 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
3013 * @brief This API gets the package type of the application
3015 * @par This API is for package-manager client application
3016 * @par Sync (or) Async : Synchronous API
3018 * @param[in] handle pointer to the application info handle.
3019 * @param[out] pkgtype pointer to hold package type
3020 * @return 0 if success, error code(<0) if fail
3021 * @retval PMINFO_R_OK success
3022 * @retval PMINFO_R_EINVAL invalid argument
3023 * @retval PMINFO_R_ERROR internal error
3024 * @pre pkgmgrinfo_appinfo_get_appinfo()
3025 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3026 * @see pkgmgrinfo_appinfo_get_appid()
3027 * @see pkgmgrinfo_appinfo_is_multiple()
3029 static int get_app_pkgtype(const char *appid)
3032 char *pkgtype = NULL;
3033 pkgmgrinfo_appinfo_h handle = NULL;
3034 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3035 if (ret != PMINFO_R_OK)
3037 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
3038 if (ret != PMINFO_R_OK) {
3039 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3042 printf("pkgtype: %s\n", pkgtype);
3043 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3048 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
3051 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3052 * @brief This API gets the executable name of the application
3054 * @par This API is for package-manager client application
3055 * @par Sync (or) Async : Synchronous API
3057 * @param[in] handle pointer to the application info handle.
3058 * @param[out] exec pointer to hold app exec name
3059 * @return 0 if success, error code(<0) if fail
3060 * @retval PMINFO_R_OK success
3061 * @retval PMINFO_R_EINVAL invalid argument
3062 * @retval PMINFO_R_ERROR internal error
3063 * @pre pkgmgrinfo_appinfo_get_appinfo()
3064 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3065 * @see pkgmgrinfo_appinfo_get_appid()
3066 * @see pkgmgrinfo_appinfo_is_multiple()
3068 static int get_app_exec(const char *appid)
3072 pkgmgrinfo_appinfo_h handle;
3073 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3074 if (ret != PMINFO_R_OK)
3076 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3077 if (ret != PMINFO_R_OK) {
3078 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3081 printf("exec name: %s\n", exec);
3082 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3087 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
3090 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3091 * @brief This API gets the icon name of the application
3093 * @par This API is for package-manager client application
3094 * @par Sync (or) Async : Synchronous API
3096 * @param[in] handle pointer to the application info handle.
3097 * @param[out] icon pointer to hold app icon name
3098 * @return 0 if success, error code(<0) if fail
3099 * @retval PMINFO_R_OK success
3100 * @retval PMINFO_R_EINVAL invalid argument
3101 * @retval PMINFO_R_ERROR internal error
3102 * @pre pkgmgrinfo_appinfo_get_appinfo()
3103 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3104 * @see pkgmgrinfo_appinfo_get_appid()
3105 * @see pkgmgrinfo_appinfo_is_multiple()
3107 static int get_app_icon(const char *appid)
3111 pkgmgrinfo_appinfo_h handle;
3112 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3113 if (ret != PMINFO_R_OK)
3115 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3116 if (ret != PMINFO_R_OK) {
3117 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3120 printf("icon name: %s\n", icon);
3121 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3126 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3129 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3130 * @brief This API gets the label of the application
3132 * @par This API is for package-manager client application
3133 * @par Sync (or) Async : Synchronous API
3135 * @param[in] handle pointer to the application info handle.
3136 * @param[out] label pointer to hold app label
3137 * @return 0 if success, error code(<0) if fail
3138 * @retval PMINFO_R_OK success
3139 * @retval PMINFO_R_EINVAL invalid argument
3140 * @retval PMINFO_R_ERROR internal error
3141 * @pre pkgmgrinfo_appinfo_get_appinfo()
3142 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3143 * @see pkgmgrinfo_appinfo_get_appid()
3144 * @see pkgmgrinfo_appinfo_is_multiple()
3146 static int get_app_label(const char *appid)
3150 pkgmgrinfo_appinfo_h handle;
3151 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3152 if (ret != PMINFO_R_OK)
3154 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3155 if (ret != PMINFO_R_OK) {
3156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3159 printf("label : %s\n", label);
3160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3165 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3168 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3169 * @brief This API gets exactly matched label by given appid and locale
3171 * @par This API is for package-manager client application
3172 * @par Sync (or) Async : Synchronous API
3174 * @param[in] appid pointer to appid
3175 * @param[in] locale pointer to locale
3176 * @param[out] label pointer to hold app label
3177 * @return 0 if success, error code(<0) if fail
3178 * @retval PMINFO_R_OK success
3179 * @retval PMINFO_R_EINVAL invalid argument
3180 * @retval PMINFO_R_ERROR internal error
3182 static int get_localed_label(const char *appid, const char *locale)
3187 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3188 if (ret != PMINFO_R_OK)
3191 printf("localed label: %s\n", label);
3199 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3200 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3203 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3204 * @brief This API gets metadata value by given metadata key
3206 * @par This API is for package-manager client application
3207 * @par Sync (or) Async : Synchronous API
3209 * @param[in] handle pointer to the application info handle
3210 * @param[in] metadata_key metadata key
3211 * @param[out] metadata_value pointer to hold metadata value
3212 * @return 0 if success, error code(<0) if fail
3213 * @retval PMINFO_R_OK success
3214 * @retval PMINFO_R_EINVAL invalid argument
3216 static int get_metadata_value(const char *appid, const char *metadata_key)
3219 pkgmgrinfo_appinfo_h handle = NULL;
3220 char *metadata_value = NULL;
3222 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3223 if (ret != PMINFO_R_OK)
3226 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3227 if (ret != PMINFO_R_OK) {
3228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3232 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3237 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3240 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3241 * @brief This API gets the component of the application
3243 * @par This API is for package-manager client application
3244 * @par Sync (or) Async : Synchronous API
3246 * @param[in] handle pointer to the application info handle.
3247 * @param[out] component pointer to hold app component
3248 * @return 0 if success, error code(<0) if fail
3249 * @retval PMINFO_R_OK success
3250 * @retval PMINFO_R_EINVAL invalid argument
3251 * @retval PMINFO_R_ERROR internal error
3252 * @pre pkgmgrinfo_appinfo_get_appinfo()
3253 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3254 * @see pkgmgrinfo_appinfo_get_appid()
3255 * @see pkgmgrinfo_appinfo_is_multiple()
3257 static int get_app_component(const char *appid)
3260 pkgmgrinfo_app_component component;
3261 pkgmgrinfo_appinfo_h handle;
3262 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3263 if (ret != PMINFO_R_OK)
3265 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3266 if (ret != PMINFO_R_OK) {
3267 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3270 printf("component : %s\n", component);
3271 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3276 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3279 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3280 * @brief This API gets the apptype of the application
3282 * @par This API is for package-manager client application
3283 * @par Sync (or) Async : Synchronous API
3285 * @param[in] handle pointer to the application info handle.
3286 * @param[out] app_type pointer to hold apptype
3287 * @return 0 if success, error code(<0) if fail
3288 * @retval PMINFO_R_OK success
3289 * @retval PMINFO_R_EINVAL invalid argument
3290 * @retval PMINFO_R_ERROR internal error
3291 * @pre pkgmgrinfo_appinfo_get_appinfo()
3292 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3293 * @see pkgmgrinfo_appinfo_get_appid()
3294 * @see pkgmgrinfo_appinfo_is_multiple()
3296 static int get_app_type(const char *appid)
3299 char *apptype = NULL;
3300 pkgmgrinfo_appinfo_h handle;
3301 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3302 if (ret != PMINFO_R_OK)
3304 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3305 if (ret != PMINFO_R_OK) {
3306 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3309 printf("apptype : %s\n", apptype);
3310 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3315 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3318 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3319 int *operation_count, char ***operation)
3320 * @brief This API gets the list of operation of the application
3322 * @par This API is for package-manager client application
3323 * @par Sync (or) Async : Synchronous API
3325 * @param[in] handle pointer to the appcontrol handle.
3326 * @param[out] operation_count pointer to hold number of operations
3327 * @param[out] operation pointer to hold list of operations
3328 * @return 0 if success, error code(<0) if fail
3329 * @retval PMINFO_R_OK success
3330 * @retval PMINFO_R_EINVAL invalid argument
3331 * @retval PMINFO_R_ERROR internal error
3332 * @pre pkgmgrinfo_appinfo_get_appinfo()
3333 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3334 * @see pkgmgrinfo_appinfo_get_uri()
3335 * @see pkgmgrinfo_appinfo_get_mime()
3337 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3342 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3343 for (i = 0; i < oc; i++) {
3344 if (strcmp(operation[i], (char *)user_data) == 0)
3351 static int check_operation(const char *appid, char *operation)
3354 pkgmgrinfo_appinfo_h handle;
3355 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3356 if (ret != PMINFO_R_OK)
3358 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3359 if (ret != PMINFO_R_OK) {
3360 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3363 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3368 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3369 int *operation_count, char ***operation);
3372 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3373 int *uri_count, char ***uri)
3374 * @brief This API gets the list of uri of the application
3376 * @par This API is for package-manager client application
3377 * @par Sync (or) Async : Synchronous API
3379 * @param[in] handle pointer to the appcontrol handle.
3380 * @param[out] uri_count pointer to hold number of uris
3381 * @param[out] uri pointer to hold list of uris
3382 * @return 0 if success, error code(<0) if fail
3383 * @retval PMINFO_R_OK success
3384 * @retval PMINFO_R_EINVAL invalid argument
3385 * @retval PMINFO_R_ERROR internal error
3386 * @pre pkgmgrinfo_appinfo_get_appinfo()
3387 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3388 * @see pkgmgrinfo_appinfo_get_operation()
3389 * @see pkgmgrinfo_appinfo_get_mime()
3391 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3396 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
3397 for (i = 0; i < uc; i++) {
3398 if (strcmp(uri[i], (char *)user_data) == 0)
3405 static int check_uri(const char *appid, char *uri)
3408 pkgmgrinfo_appinfo_h handle;
3409 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3410 if (ret != PMINFO_R_OK)
3412 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
3413 if (ret != PMINFO_R_OK) {
3414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3417 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3422 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3423 int *uri_count, char ***uri);
3426 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3427 int *mime_count, char ***mime)
3428 * @brief This API gets the list of mime of the application
3430 * @par This API is for package-manager client application
3431 * @par Sync (or) Async : Synchronous API
3433 * @param[in] handle pointer to the appcontrol handle.
3434 * @param[out] mime_count pointer to hold number of mimes
3435 * @param[out] mime pointer to hold list of mimes
3436 * @return 0 if success, error code(<0) if fail
3437 * @retval PMINFO_R_OK success
3438 * @retval PMINFO_R_EINVAL invalid argument
3439 * @retval PMINFO_R_ERROR internal error
3440 * @pre pkgmgrinfo_appinfo_get_appinfo()
3441 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3442 * @see pkgmgrinfo_appinfo_get_uri()
3443 * @see pkgmgrinfo_appinfo_get_operation()
3445 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3450 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
3451 for (i = 0; i < mc; i++) {
3452 if (strcmp(mime[i], (char *)user_data) == 0)
3459 static int check_mime(const char *appid, char *mime)
3462 pkgmgrinfo_appinfo_h handle;
3463 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3464 if (ret != PMINFO_R_OK)
3466 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3467 if (ret != PMINFO_R_OK) {
3468 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3471 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3476 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3477 int *mime_count, char ***mime);
3480 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3481 int *subapp_count, char ***subapp)
3482 * @brief This API gets the list of subapp of the application
3484 * @par This API is for package-manager client application
3485 * @par Sync (or) Async : Synchronous API
3487 * @param[in] handle pointer to the appcontrol handle.
3488 * @param[out] subapp_count pointer to hold number of subapp
3489 * @param[out] subapp pointer to hold list of subapp
3490 * @return 0 if success, error code(<0) if fail
3491 * @retval PMINFO_R_OK success
3492 * @retval PMINFO_R_EINVAL invalid argument
3493 * @retval PMINFO_R_ERROR internal error
3494 * @pre pkgmgrinfo_appinfo_get_appinfo()
3495 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3496 * @see pkgmgrinfo_appinfo_get_uri()
3497 * @see pkgmgrinfo_appinfo_get_operation()
3499 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3503 char **subapp = NULL;
3504 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3505 for (i = 0; i < sc; i++) {
3506 if (strcmp(subapp[i], (char *)user_data) == 0)
3513 static int check_subapp(const char *appid, char *subapp)
3516 pkgmgrinfo_appinfo_h handle = NULL;
3517 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3518 if (ret != PMINFO_R_OK)
3520 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3521 if (ret != PMINFO_R_OK) {
3522 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3530 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3531 int *subapp_count, char ***subapp);
3534 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3535 * @brief This API gets the notification icon of the application
3537 * @par This API is for package-manager client application
3538 * @par Sync (or) Async : Synchronous API
3540 * @param[in] handle pointer to the application info handle.
3541 * @param[out] path pointer to hold notification icon
3542 * @return 0 if success, error code(<0) if fail
3543 * @retval PMINFO_R_OK success
3544 * @retval PMINFO_R_EINVAL invalid argument
3545 * @retval PMINFO_R_ERROR internal error
3546 * @pre pkgmgrinfo_appinfo_get_appinfo()
3547 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3548 * @see pkgmgrinfo_appinfo_get_appid()
3549 * @see pkgmgrinfo_appinfo_is_multiple()
3551 static int get_app_notification_icon(const char *appid)
3554 char *notification_icon = NULL;
3555 pkgmgrinfo_appinfo_h handle;
3556 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3557 if (ret != PMINFO_R_OK)
3559 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3560 if (ret != PMINFO_R_OK) {
3561 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3564 printf("notification icon : %s\n", notification_icon);
3565 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3570 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3573 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3574 * @brief This API gets the type of recent image on app-tray
3576 * @par This API is for package-manager client application
3577 * @par Sync (or) Async : Synchronous API
3579 * @param[in] handle pointer to the application info handle.
3580 * @param[out] type pointer to hold image type
3581 * @return 0 if success, error code(<0) if fail
3582 * @retval PMINFO_R_OK success
3583 * @retval PMINFO_R_EINVAL invalid argument
3584 * @retval PMINFO_R_ERROR internal error
3585 * @pre pkgmgrinfo_appinfo_get_appinfo()
3586 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3587 * @see pkgmgrinfo_appinfo_get_appid()
3588 * @see pkgmgrinfo_appinfo_is_multiple()
3590 static int get_app_recent_image_type(const char *appid)
3593 pkgmgrinfo_app_recentimage type;
3594 pkgmgrinfo_appinfo_h handle;
3595 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3596 if (ret != PMINFO_R_OK)
3598 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3599 if (ret != PMINFO_R_OK) {
3600 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3603 printf("recent image type: %d\n", type);
3604 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3609 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3613 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3614 * @brief This API gets the preview image of application
3616 * @par Sync (or) Async : Synchronous API
3618 * @param[in] handle pointer to the application info handle.
3619 * @param[out] preview_img pointer to hold preview image path
3620 * @return 0 if success, error code(<0) if fail
3621 * @retval PMINFO_R_OK success
3622 * @retval PMINFO_R_EINVAL invalid argument
3623 * @retval PMINFO_R_ERROR internal error
3624 * @pre pkgmgrinfo_appinfo_get_appinfo()
3625 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3626 * @see pkgmgrinfo_appinfo_get_appid()
3628 static int get_app_previewimage(const char *appid)
3631 char *preview = NULL;
3632 pkgmgrinfo_appinfo_h handle = NULL;
3633 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3634 if (ret != PMINFO_R_OK)
3636 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3637 if (ret != PMINFO_R_OK) {
3638 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3641 printf("preview image path : %s\n", preview);
3642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3647 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3651 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3652 * @brief This API gets the package permission type of the application
3654 * @par This API is for package-manager client application
3655 * @par Sync (or) Async : Synchronous API
3657 * @param[in] handle pointer to the application info handle.
3658 * @param[out] permission pointer to hold package permission
3659 * @return 0 if success, error code(<0) if fail
3660 * @retval PMINFO_R_OK success
3661 * @retval PMINFO_R_EINVAL invalid argument
3662 * @retval PMINFO_R_ERROR internal error
3663 * @pre pkgmgrinfo_appinfo_get_appinfo()
3664 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3665 * @see pkgmgrinfo_appinfo_get_appid()
3667 static int get_app_permission(const char *appid)
3670 pkgmgrinfo_permission_type permission = 0;
3671 pkgmgrinfo_appinfo_h handle;
3673 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3674 if (ret != PMINFO_R_OK)
3676 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3677 if (ret != PMINFO_R_OK) {
3678 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3681 printf("permission type: %d\n", permission);
3682 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3687 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3690 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3691 * @brief This API gets the component_type
3693 * @par This API is for package-manager client application
3694 * @par Sync (or) Async : Synchronous API
3696 * @param[in] handle pointer to the application info handle.
3697 * @param[out] component_type pointer to hold component_type
3698 * @return 0 if success, error code(<0) if fail
3699 * @retval PMINFO_R_OK success
3700 * @retval PMINFO_R_EINVAL invalid argument
3701 * @retval PMINFO_R_ERROR internal error
3702 * @pre pkgmgrinfo_appinfo_get_appinfo()
3703 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3704 * @see pkgmgrinfo_appinfo_get_pkgid()
3705 * @see pkgmgrinfo_appinfo_is_multiple()
3707 static int get_component_type(const char *appid)
3710 char *component_type = NULL;
3711 pkgmgrinfo_appinfo_h handle;
3712 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3713 if (ret != PMINFO_R_OK)
3715 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3716 if (ret != PMINFO_R_OK) {
3717 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3720 printf("component_type: %s\n", component_type);
3721 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3726 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3729 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3730 * @brief This API gets the application 'hwacceleration' value from the app ID
3732 * @par This API is for package-manager client application
3733 * @par Sync (or) Async : Synchronous API
3735 * @param[in] handle pointer to application info handle
3736 * @param[out] hwacceleration pointer to hold package hwacceleration value
3737 * @return 0 if success, error code(<0) if fail
3738 * @retval PMINFO_R_OK success
3739 * @retval PMINFO_R_EINVAL invalid argument
3740 * @retval PMINFO_R_ERROR internal error
3741 * @pre pkgmgrinfo_appinfo_get_appinfo()
3742 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3743 * @see pkgmgrinfo_appinfo_get_appid()
3744 * @see pkgmgrinfo_appinfo_is_multiple()
3746 static int get_app_hwacceleration(const char *appid)
3749 pkgmgrinfo_app_hwacceleration hwacceleration;
3750 pkgmgrinfo_appinfo_h handle;
3751 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3752 if (ret != PMINFO_R_OK)
3754 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3755 if (ret != PMINFO_R_OK) {
3756 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3759 printf("app hwacceleration: %d\n", hwacceleration);
3760 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3765 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3768 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3769 * @brief This API gets the application 'screenreader' value from the app ID
3771 * @par This API is for package-manager client application
3772 * @par Sync (or) Async : Synchronous API
3774 * @param[in] handle pointer to application info handle
3775 * @param[out] screenreader pointer to hold package accessibility value
3776 * @return 0 if success, error code(<0) if fail
3777 * @retval PMINFO_R_OK success
3778 * @retval PMINFO_R_EINVAL invalid argument
3779 * @retval PMINFO_R_ERROR internal error
3780 * @pre pkgmgrinfo_appinfo_get_appinfo()
3781 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3782 * @see pkgmgrinfo_appinfo_get_appid()
3783 * @see pkgmgrinfo_appinfo_is_multiple()
3785 static int get_app_screenreader(const char *appid)
3788 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3789 pkgmgrinfo_appinfo_h handle = NULL;
3790 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3791 if (ret != PMINFO_R_OK)
3793 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3794 if (ret != PMINFO_R_OK) {
3795 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3798 printf("app screenreader: %d\n", screenreader);
3799 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3804 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3807 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3808 * @brief This API gets the application's landscape & portrait effect images
3810 * @par This API is for package-manager client application
3811 * @par Sync (or) Async : Synchronous API
3813 * @param[in] handle pointer to application info handle
3814 * @param[out] portrait_img contains portrait mode effect image
3815 * @param[out] landscape_img contains landscape mode effect image
3816 * @return 0 if success, error code(<0) if fail
3817 * @retval PMINFO_R_OK success
3818 * @retval PMINFO_R_EINVAL invalid argument
3819 * @retval PMINFO_R_ERROR internal error
3820 * @pre pkgmgrinfo_appinfo_get_appinfo()
3821 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3822 * @see pkgmgrinfo_appinfo_get_appid()
3823 * @see pkgmgrinfo_appinfo_is_nodisplay()
3825 static int get_app_effectimages(const char *appid)
3828 char *portraitimg = NULL;
3829 char *landscapeimg = NULL;
3830 pkgmgrinfo_appinfo_h handle;
3831 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3832 if (ret != PMINFO_R_OK)
3834 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3835 if (ret != PMINFO_R_OK) {
3836 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3839 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3840 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3845 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3848 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3849 * @brief This API gets the application's effect image type
3851 * @par This API is for package-manager client application
3852 * @par Sync (or) Async : Synchronous API
3854 * @param[in] handle pointer to application info handle
3855 * @param[out] effectimg_type contains effect image type
3856 * @return 0 if success, error code(<0) if fail
3857 * @retval PMINFO_R_OK success
3858 * @retval PMINFO_R_EINVAL invalid argument
3859 * @retval PMINFO_R_ERROR internal error
3860 * @pre pkgmgrinfo_appinfo_get_appinfo()
3861 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3862 * @see pkgmgrinfo_appinfo_get_appid()
3863 * @see pkgmgrinfo_appinfo_is_nodisplay()
3865 static int get_app_effectimage_type(const char *appid)
3868 char *effectimg_type = NULL;
3869 pkgmgrinfo_appinfo_h handle = NULL;
3870 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3871 if (ret != PMINFO_R_OK)
3873 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3874 if (ret != PMINFO_R_OK) {
3875 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3878 printf("app effect image type: %s\n", effectimg_type);
3879 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3884 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3887 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3888 * @brief This API gets the submode_mainid of the application
3890 * @par This API is for package-manager client application
3891 * @par Sync (or) Async : Synchronous API
3893 * @param[in] handle pointer to the application info handle.
3894 * @param[out] submode_mainid pointer to hold package name
3895 * @return 0 if success, error code(<0) if fail
3896 * @retval PMINFO_R_OK success
3897 * @retval PMINFO_R_EINVAL invalid argument
3898 * @retval PMINFO_R_ERROR internal error
3899 * @pre pkgmgrinfo_appinfo_get_appinfo()
3900 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3901 * @see pkgmgrinfo_appinfo_get_appid()
3902 * @see pkgmgrinfo_appinfo_is_multiple()
3904 static int get_app_submode_mainid(const char *appid)
3907 char *submode_mainid = NULL;
3908 pkgmgrinfo_appinfo_h handle = NULL;
3909 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3910 if (ret != PMINFO_R_OK)
3912 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3913 if (ret != PMINFO_R_OK) {
3914 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3917 printf("submode_mainid: %s\n", submode_mainid);
3918 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3923 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3926 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3927 * @brief This API gets the datacontrol info
3929 * @par This API is for package-manager client application
3930 * @par Sync (or) Async : Synchronous API
3932 * @param[in] providerid pointer to the providerid of dataconltrol.
3933 * @param[in] type pointer to the type of dataconltrol.
3934 * @param[out] appid pointer to hold appid, need to free after using
3935 * @param[out] access pointer to hold access, need to free after using
3936 * @return 0 if success, error code(<0) if fail
3937 * @retval PMINFO_R_OK success
3938 * @retval PMINFO_R_EINVAL invalid argument
3939 * @retval PMINFO_R_ERROR internal error
3942 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3943 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3946 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3947 * @brief This API gets the appid of datacontrol
3949 * @par This API is for package-manager client application
3950 * @par Sync (or) Async : Synchronous API
3952 * @param[in] providerid pointer to the providerid of dataconltrol.
3953 * @param[out] appid pointer to hold appid, need to free after using
3954 * @return 0 if success, error code(<0) if fail
3955 * @retval PMINFO_R_OK success
3956 * @retval PMINFO_R_EINVAL invalid argument
3957 * @retval PMINFO_R_ERROR internal error
3960 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3961 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3964 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3965 * @brief This API gets the information about trusted datacontrol
3967 * @par This API is for package-manager client application
3968 * @par Sync (or) Async : Synchronous API
3970 * @param[in] providerid pointer to the providerid of datacontrol.
3971 * @param[out] appid pointer to hold appid, need to free after using
3972 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3973 * @return 0 if success, error code(<0) if fail
3974 * @retval PMINFO_R_OK success
3975 * @retval PMINFO_R_EINVAL invalid argument
3976 * @retval PMINFO_R_ERROR internal error
3979 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3980 const char *type, char **appid, bool *is_trusted);
3981 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3982 const char *type, uid_t uid, char **appid, bool *is_trusted);
3985 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3986 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3987 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3989 * @par This API is for package-manager client application
3990 * @par Sync (or) Async : Synchronous API
3992 * @param[in] providerid pointer to the providerid of datacontrol.
3993 * @param[in] type pointer to the type of dataconltrol.
3994 * @param[in] privilege_func callback function for list
3995 * @param[in] user_data user data to be passed to callback function
3996 * @return 0 if success, error code(<0) if fail
3997 * @retval PMINFO_R_OK success
3998 * @retval PMINFO_R_EINVAL invalid argument
3999 * @retval PMINFO_R_ERROR internal error
4001 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
4002 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
4003 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
4004 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
4007 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
4008 * @brief This API gets the alias_appid of the application
4010 * @par This API is for package-manager client application
4011 * @par Sync (or) Async : Synchronous API
4013 * @param[in] handle pointer to the application info handle.
4014 * @param[out] alias_appid pointer to hold app alias_appid
4015 * @return 0 if success, error code(<0) if fail
4016 * @retval PMINFO_R_OK success
4017 * @retval PMINFO_R_EINVAL invalid argument
4018 * @retval PMINFO_R_ERROR internal error
4019 * @pre pkgmgrinfo_appinfo_get_appinfo()
4020 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4021 * @see pkgmgrinfo_appinfo_get_appid()
4023 static int get_alias_appid(const char *appid)
4026 char *alias_appid= 0;
4027 pkgmgrinfo_appinfo_h handle = NULL;
4028 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4029 if (ret != PMINFO_R_OK)
4031 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
4032 if (ret != PMINFO_R_OK) {
4033 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4036 printf("alias_appid: %s\n", alias_appid);
4037 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4042 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
4045 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
4046 * @brief This API gets the effective_appid of the application
4048 * @par This API is for package-manager client application
4049 * @par Sync (or) Async : Synchronous API
4051 * @param[in] handle pointer to the application info handle.
4052 * @param[out] effective_appid pointer to hold app effective_appid
4053 * @return 0 if success, error code(<0) if fail
4054 * @retval PMINFO_R_OK success
4055 * @retval PMINFO_R_EINVAL invalid argument
4056 * @retval PMINFO_R_ERROR internal error
4057 * @pre pkgmgrinfo_appinfo_get_appinfo()
4058 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4059 * @see pkgmgrinfo_appinfo_get_appid()
4061 static int get_effective_appid(const char *appid)
4064 char *effective_appid= 0;
4065 pkgmgrinfo_appinfo_h handle = NULL;
4066 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4067 if (ret != PMINFO_R_OK)
4069 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
4070 if (ret != PMINFO_R_OK) {
4071 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4074 printf("effective_appid: %s\n", effective_appid);
4075 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4080 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
4083 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
4084 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
4086 * @par This API is for package-manager client application
4087 * @par Sync (or) Async : Synchronous API
4089 * @param[in] handle pointer to the appinfo handle.
4090 * @param[out] tep_name pointer to hold tep name
4091 * @return 0 if success, error code(<0) if fail
4092 * @retval PMINFO_R_OK success
4093 * @retval PMINFO_R_EINVAL invalid argument
4094 * @retval PMINFO_R_ERROR internal error
4095 * @pre pkgmgrinfo_appinfo_get_appinfo()
4096 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4097 * @see pkgmgrinfo_appinfo_get_appid()
4099 static int get_tep_name(const char *appid)
4102 char *tep_name = NULL;
4103 pkgmgrinfo_appinfo_h handle = NULL;
4104 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4105 if (ret != PMINFO_R_OK)
4107 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
4108 if (ret != PMINFO_R_OK) {
4109 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4112 printf("TEP name is: %s\n", tep_name);
4113 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4118 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4121 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4122 * @brief This API gets zip mount file name associated with the package which contain given application
4123 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4125 * @par This API is for package-manager client application
4126 * @par Sync (or) Async : Synchronous API
4128 * @param[in] handle pointer to the appinfo handle.
4129 * @param[out] zip_mount_file pointer to hold zip mount file name
4130 * @return 0 if success, error code(<0) if fail
4131 * @retval PMINFO_R_OK success
4132 * @retval PMINFO_R_EINVAL invalid argument
4133 * @retval PMINFO_R_ERROR internal error
4134 * @pre pkgmgrinfo_appinfo_get_appinfo()
4135 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4136 * @see pkgmgrinfo_appinfo_get_appid()
4138 static int get_zip_mount_file(const char *appid)
4141 char *zip_mount_file = NULL;
4142 pkgmgrinfo_appinfo_h handle = NULL;
4143 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4144 if (ret != PMINFO_R_OK)
4146 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4147 if (ret != PMINFO_R_OK) {
4148 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4151 printf("Mount file name is: %s\n", zip_mount_file);
4152 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4157 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4160 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4161 * @brief This API gets the root path of application
4163 * @par Sync (or) Async : Synchronous API
4165 * @param[in] handle pointer to appinfo handle
4166 * @param[out] path pointer to hold root path of application
4167 * @return 0 if success, error code(<0) if fail
4168 * @retval PMINFO_R_OK success
4169 * @retval PMINFO_R_EINVAL invalid argument
4170 * @retval PMINFO_R_ERROR internal error
4172 static int get_root_path(const char *appid)
4176 pkgmgrinfo_appinfo_h handle;
4177 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4178 if (ret != PMINFO_R_OK)
4181 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4182 if (ret != PMINFO_R_OK) {
4183 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4186 printf("path : %s\n", path);
4187 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4193 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4196 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4197 * @brief This API gets the application api_version from the application ID
4199 * @par This API is for package-manager client application
4200 * @par Sync (or) Async : Synchronous API
4202 * @param[in] handle pointer to appinfo handle
4203 * @param[out] api_version pointer to hold application api_version
4204 * @return 0 if success, error code(<0) if fail
4205 * @retval PMINFO_R_OK success
4206 * @retval PMINFO_R_EINVAL invalid argument
4207 * @retval PMINFO_R_ERROR internal error
4208 * @pre pkgmgrinfo_appinfo_get_appinfo()
4209 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4210 * @see pkgmgrinfo_appinfo_get_appid()
4212 static int get_app_api_version(const char *appid)
4215 char *api_version = NULL;
4216 pkgmgrinfo_appinfo_h handle = NULL;
4217 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4218 if (ret != PMINFO_R_OK)
4220 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4221 if (ret != PMINFO_R_OK) {
4222 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4225 printf("app api_version: %s\n", api_version);
4226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4231 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4234 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4235 * @brief This API gets the installed_time of the application
4237 * @par This API is for package-manager client application
4238 * @par Sync (or) Async : Synchronous API
4240 * @param[in] handle pointer to the application info handle.
4241 * @param[out] installed_time pointer to hold installed_time
4242 * @return 0 if success, error code(<0) if fail
4243 * @retval PMINFO_R_OK success
4244 * @retval PMINFO_R_EINVAL invalid argument
4245 * @retval PMINFO_R_ERROR internal error
4246 * @pre pkgmgrinfo_appinfo_get_appinfo()
4247 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4248 * @see pkgmgrinfo_appinfo_get_appid()
4249 * @see pkgmgrinfo_appinfo_is_multiple()
4251 static int get_app_installed_time(const char *appid)
4254 int installed_time = 0;
4255 pkgmgrinfo_appinfo_h handle = NULL;
4256 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4257 if (ret != PMINFO_R_OK)
4259 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4260 if (ret != PMINFO_R_OK) {
4261 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4264 printf("installed_time: %d\n", installed_time);
4265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4270 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4273 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4274 * @brief This API gets the support_mode of the application
4276 * @par This API is for package-manager client application
4277 * @par Sync (or) Async : Synchronous API
4279 * @param[in] handle pointer to the application info handle.
4280 * @param[out] support_mode pointer to hold app support_mode
4281 * @return 0 if success, error code(<0) if fail
4282 * @retval PMINFO_R_OK success
4283 * @retval PMINFO_R_EINVAL invalid argument
4284 * @retval PMINFO_R_ERROR internal error
4285 * @pre pkgmgrinfo_appinfo_get_appinfo()
4286 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4287 * @see pkgmgrinfo_appinfo_get_appid()
4289 static int get_app_support_mode(const char *appid)
4292 int support_mode = 0;
4293 pkgmgrinfo_appinfo_h handle = NULL;
4294 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4295 if (ret != PMINFO_R_OK)
4297 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4298 if (ret != PMINFO_R_OK) {
4299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4302 printf("support_mode: %s\n", support_mode);
4303 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4308 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4312 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4313 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4314 * @brief This API gets the list of category for a particular application
4316 * @par This API is for package-manager client application
4317 * @par Sync (or) Async : Synchronous API
4318 * @param[in] handle pointer to the application info handle.
4319 * @param[in] category_func callback function for list
4320 * @param[in] user_data user data to be passed to callback function
4321 * @return 0 if success, error code(<0) if fail
4322 * @retval PMINFO_R_OK success
4323 * @retval PMINFO_R_EINVAL invalid argument
4324 * @retval PMINFO_R_ERROR internal error
4325 * @pre pkgmgrinfo_appinfo_get_appinfo()
4326 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4328 int category_func(const char *name, void *user_data)
4330 if (strcmp(name, (char *)user_data) == 0)
4336 static int list_category(const char *appid, char *category)
4339 pkgmgrinfo_appinfo_h handle;
4340 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4341 if (ret != PMINFO_R_OK)
4343 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4344 if (ret != PMINFO_R_OK) {
4345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4348 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4353 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4354 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4357 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4358 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4359 * @brief This API gets the list of metadata for a particular application
4361 * @par This API is for package-manager client application
4362 * @par Sync (or) Async : Synchronous API
4363 * @param[in] handle pointer to the application info handle.
4364 * @param[in] metadata_func callback function for list
4365 * @param[in] user_data user data to be passed to callback function
4366 * @return 0 if success, error code(<0) if fail
4367 * @retval PMINFO_R_OK success
4368 * @retval PMINFO_R_EINVAL invalid argument
4369 * @retval PMINFO_R_ERROR internal error
4370 * @pre pkgmgrinfo_appinfo_get_appinfo()
4371 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4373 int metadata_func(const char *key, const char *value, void *user_data)
4375 if (strcmp(key, (char *)user_data) == 0) {
4376 printf("Value is %s\n", value);
4383 static int list_metadata(const char *appid, char *key)
4386 pkgmgrinfo_appinfo_h handle;
4387 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4388 if (ret != PMINFO_R_OK)
4390 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4391 if (ret != PMINFO_R_OK) {
4392 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4395 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4400 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4401 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4404 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4405 * const char *operation,
4406 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4408 * @brief This API gets the list of privileges for a particular
4409 * appllication's app_control
4411 * @par This API is for package-manager client application
4412 * @par Sync (or) Async : Synchronous API
4413 * @param[in] appid application id
4414 * @param[in] operation operation of appcontrol
4415 * @param[in] privilege_func callback function for list
4416 * @param[in] user_data user data to be passed to callback function
4417 * @return 0 if success, error code(<0) if fail
4418 * @retval PMINFO_R_OK success
4419 * @retval PMINFO_R_EINVAL invalid argument
4420 * @retval PMINFO_R_ERROR internal error
4422 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4423 const char *operation,
4424 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4425 void *user_data, uid_t uid);
4426 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4427 const char *operation,
4428 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4432 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4433 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4434 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4435 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4436 * @brief This API gets the list of app-control for a particular application
4438 * @par This API is for package-manager client application
4439 * @par Sync (or) Async : Synchronous API
4440 * @param[in] handle pointer to the application info handle.
4441 * @param[in] appcontrol_func callback function for list
4442 * @param[in] user_data user data to be passed to callback function
4443 * @param[in] uid the addressee user id of the instruction
4444 * @return 0 if success, error code(<0) if fail
4445 * @retval PMINFO_R_OK success
4446 * @retval PMINFO_R_EINVAL invalid argument
4447 * @retval PMINFO_R_ERROR internal error
4448 * @pre pkgmgrinfo_appinfo_get_appinfo()
4449 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4451 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4456 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4457 for (i = 0; i < oc; i++) {
4458 if (strcmp(operation[i], (char *)user_data) == 0)
4465 static int check_operation(const char *appid, char *operation)
4468 pkgmgrinfo_appinfo_h handle;
4469 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4470 if (ret != PMINFO_R_OK)
4472 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4473 if (ret != PMINFO_R_OK) {
4474 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4477 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4482 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4483 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4485 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4486 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4491 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4492 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4495 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4496 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4497 * @brief This API gets the list of splashscreen for a particular application
4499 * @par This API is for package-manager client application
4500 * @par Sync (or) Async : Synchronous API
4501 * @param[in] handle pointer to the application info handle.
4502 * @param[in] splash_screen_func callback function for list
4503 * @param[in] user_data user data to be passed to callback function
4504 * @return 0 if success, error code(<0) if fail
4505 * @retval PMINFO_R_OK success
4506 * @retval PMINFO_R_EINVAL invalid argument
4507 * @retval PMINFO_R_ERROR internal error
4508 * @pre pkgmgrinfo_appinfo_get_appinfo()
4509 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4512 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4513 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4516 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4517 * @brief This API gets the application 'nodisplay' value from the app ID
4519 * @par This API is for package-manager client application
4520 * @par Sync (or) Async : Synchronous API
4522 * @param[in] handle pointer to application info handle
4523 * @param[out] nodisplay pointer to hold package nodisplay value
4524 * @return 0 if success, error code(<0) if fail
4525 * @retval PMINFO_R_OK success
4526 * @retval PMINFO_R_EINVAL invalid argument
4527 * @retval PMINFO_R_ERROR internal error
4528 * @pre pkgmgrinfo_appinfo_get_appinfo()
4529 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4530 * @see pkgmgrinfo_appinfo_get_appid()
4531 * @see pkgmgrinfo_appinfo_is_multiple()
4533 static int get_app_nodisplay(const char *appid)
4537 pkgmgrinfo_appinfo_h handle;
4538 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4539 if (ret != PMINFO_R_OK)
4541 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4542 if (ret != PMINFO_R_OK) {
4543 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4546 printf("app nodisplay: %d\n", nodisplay);
4547 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4552 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4555 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4556 * @brief This API gets the application 'multiple' value from the app ID
4558 * @par This API is for package-manager client application
4559 * @par Sync (or) Async : Synchronous API
4561 * @param[in] handle pointer to application info handle
4562 * @param[out] multiple pointer to hold package multiple value
4563 * @return 0 if success, error code(<0) if fail
4564 * @retval PMINFO_R_OK success
4565 * @retval PMINFO_R_EINVAL invalid argument
4566 * @retval PMINFO_R_ERROR internal error
4567 * @pre pkgmgrinfo_appinfo_get_appinfo()
4568 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4569 * @see pkgmgrinfo_appinfo_get_appid()
4570 * @see pkgmgrinfo_appinfo_is_nodisplay()
4572 static int get_app_multiple(const char *appid)
4576 pkgmgrinfo_appinfo_h handle;
4577 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4578 if (ret != PMINFO_R_OK)
4580 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4581 if (ret != PMINFO_R_OK) {
4582 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4585 printf("app multiple: %d\n", multiple);
4586 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4591 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4594 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4595 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4596 * application launching effect. If fales, indicator will be hidden during application launching effect
4598 * @par This API is for package-manager client application
4599 * @par Sync (or) Async : Synchronous API
4601 * @param[in] handle pointer to application info handle
4602 * @param[out] indicator_disp contains indicator display status for application launching effect
4603 * @return 0 if success, error code(<0) if fail
4604 * @retval PMINFO_R_OK success
4605 * @retval PMINFO_R_EINVAL invalid argument
4606 * @retval PMINFO_R_ERROR internal error
4607 * @pre pkgmgrinfo_appinfo_get_appinfo()
4608 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4609 * @see pkgmgrinfo_appinfo_get_appid()
4610 * @see pkgmgrinfo_appinfo_is_nodisplay()
4612 static int get_app_indicator_display(const char *appid)
4615 bool indicator_disp;
4616 pkgmgrinfo_appinfo_h handle;
4617 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4618 if (ret != PMINFO_R_OK)
4620 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4621 if (ret != PMINFO_R_OK){
4622 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4625 printf("app indicator disp : %d\n", indicator_disp);
4626 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4631 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4634 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4635 * @brief This API gets the application 'taskmanage' value from the app ID
4637 * @par This API is for package-manager client application
4638 * @par Sync (or) Async : Synchronous API
4640 * @param[in] handle pointer to application info handle
4641 * @param[out] taskmanage pointer to hold package taskmanage value
4642 * @return 0 if success, error code(<0) if fail
4643 * @retval PMINFO_R_OK success
4644 * @retval PMINFO_R_EINVAL invalid argument
4645 * @retval PMINFO_R_ERROR internal error
4646 * @pre pkgmgrinfo_appinfo_get_appinfo()
4647 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4648 * @see pkgmgrinfo_appinfo_get_appid()
4649 * @see pkgmgrinfo_appinfo_is_multiple()
4651 static int get_app_taskmanage(const char *appid)
4655 pkgmgrinfo_appinfo_h handle;
4656 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4657 if (ret != PMINFO_R_OK)
4659 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4660 if (ret != PMINFO_R_OK) {
4661 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4664 printf("app taskmanage: %d\n", taskmanage);
4665 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4670 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4673 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4674 * @brief This API gets the application 'taskmanage' value from the app ID
4676 * @par This API is for package-manager client application
4677 * @par Sync (or) Async : Synchronous API
4679 * @param[in] handle pointer to application info handle
4680 * @param[out] enabled pointer to hold package enabled value
4681 * @return 0 if success, error code(<0) if fail
4682 * @retval PMINFO_R_OK success
4683 * @retval PMINFO_R_EINVAL invalid argument
4684 * @retval PMINFO_R_ERROR internal error
4685 * @pre pkgmgrinfo_appinfo_get_appinfo()
4686 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4687 * @see pkgmgrinfo_appinfo_get_appid()
4688 * @see pkgmgrinfo_appinfo_is_multiple()
4690 static int get_app_enabled(const char *appid)
4694 pkgmgrinfo_appinfo_h handle;
4695 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4696 if (ret != PMINFO_R_OK)
4698 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4699 if (ret != PMINFO_R_OK) {
4700 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4703 printf("app enabled: %d\n", enabled);
4704 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4709 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4712 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4713 * @brief This API gets the application 'onboot' value from the app ID
4715 * @par This API is for package-manager client application
4716 * @par Sync (or) Async : Synchronous API
4718 * @param[in] handle pointer to application info handle
4719 * @param[out] onboot pointer to hold package onboot value
4720 * @return 0 if success, error code(<0) if fail
4721 * @retval PMINFO_R_OK success
4722 * @retval PMINFO_R_EINVAL invalid argument
4723 * @retval PMINFO_R_ERROR internal error
4724 * @pre pkgmgrinfo_appinfo_get_appinfo()
4725 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4726 * @see pkgmgrinfo_appinfo_get_appid()
4727 * @see pkgmgrinfo_appinfo_is_multiple()
4729 static int get_app_onboot(const char *appid)
4733 pkgmgrinfo_appinfo_h handle;
4734 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4735 if (ret != PMINFO_R_OK)
4737 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4738 if (ret != PMINFO_R_OK) {
4739 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4742 printf("app onboot: %d\n", onboot);
4743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4748 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4751 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4752 * @brief This API gets the application 'autorestart' value from the app ID
4754 * @par This API is for package-manager client application
4755 * @par Sync (or) Async : Synchronous API
4757 * @param[in] handle pointer to application info handle
4758 * @param[out] autorestart pointer to hold package autorestart value
4759 * @return 0 if success, error code(<0) if fail
4760 * @retval PMINFO_R_OK success
4761 * @retval PMINFO_R_EINVAL invalid argument
4762 * @retval PMINFO_R_ERROR internal error
4763 * @pre pkgmgrinfo_appinfo_get_appinfo()
4764 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4765 * @see pkgmgrinfo_appinfo_get_appid()
4766 * @see pkgmgrinfo_appinfo_is_multiple()
4768 static int get_app_autorestart(const char *appid)
4772 pkgmgrinfo_appinfo_h handle;
4773 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4774 if (ret != PMINFO_R_OK)
4776 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4777 if (ret != PMINFO_R_OK) {
4778 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4781 printf("app autorestart: %d\n", autorestart);
4782 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4787 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4790 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4791 * @brief This API gets the value for given application is main app or not from handle
4793 * @par This API is for package-manager client application
4794 * @par Sync (or) Async : Synchronous API
4796 * @param[in] handle pointer to application info handle
4797 * @param[out] mainapp pointer to hold package mainapp is or not
4798 * @return 0 if success, error code(<0) if fail
4799 * @retval PMINFO_R_OK success
4800 * @retval PMINFO_R_EINVAL invalid argument
4801 * @retval PMINFO_R_ERROR internal error
4802 * @pre pkgmgrinfo_appinfo_get_appinfo()
4803 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4804 * @see pkgmgrinfo_appinfo_get_appid()
4805 * @see pkgmgrinfo_appinfo_is_multiple()
4807 static int get_app_mainapp(const char *appid)
4811 pkgmgrinfo_appinfo_h handle;
4812 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4813 if (ret != PMINFO_R_OK)
4815 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4816 if (ret != PMINFO_R_OK) {
4817 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4820 printf("mainapp: %d\n", mainapp);
4821 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4826 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4830 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4831 * @brief This API gets the value for given application is preload or not from handle
4833 * @par This API is for package-manager client application
4834 * @par Sync (or) Async : Synchronous API
4836 * @param[in] handle pointer to application info handle
4837 * @param[out] preload pointer to hold preload is or not
4838 * @return 0 if success, error code(<0) if fail
4839 * @retval PMINFO_R_OK success
4840 * @retval PMINFO_R_EINVAL invalid argument
4841 * @retval PMINFO_R_ERROR internal error
4842 * @pre pkgmgrinfo_appinfo_get_appinfo()
4843 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4844 * @see pkgmgrinfo_appinfo_get_appid()
4845 * @see pkgmgrinfo_appinfo_is_multiple()
4847 static int get_app_preload(const char *appid)
4851 pkgmgrinfo_appinfo_h handle = NULL;
4852 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4853 if (ret != PMINFO_R_OK)
4855 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4856 if (ret != PMINFO_R_OK) {
4857 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4860 printf("preload: %d\n", preload);
4861 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4866 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4869 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4870 * @brief This API gets the value for given application is submode or not from handle
4872 * @par This API is for package-manager client application
4873 * @par Sync (or) Async : Synchronous API
4875 * @param[in] handle pointer to application info handle
4876 * @param[out] submode pointer to hold submode is or not
4877 * @return 0 if success, error code(<0) if fail
4878 * @retval PMINFO_R_OK success
4879 * @retval PMINFO_R_EINVAL invalid argument
4880 * @retval PMINFO_R_ERROR internal error
4881 * @pre pkgmgrinfo_appinfo_get_appinfo()
4882 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4883 * @see pkgmgrinfo_appinfo_get_appid()
4884 * @see pkgmgrinfo_appinfo_is_multiple()
4886 static int get_app_submode(const char *appid)
4890 pkgmgrinfo_appinfo_h handle = NULL;
4891 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4892 if (ret != PMINFO_R_OK)
4894 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4895 if (ret != PMINFO_R_OK) {
4896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4899 printf("submode: %d\n", submode);
4900 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4905 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4908 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4909 * @brief This API gets the value for given application is process_pool or not from handle
4911 * @par This API is for package-manager client application
4912 * @par Sync (or) Async : Synchronous API
4914 * @param[in] handle pointer to application info handle
4915 * @param[out] process_pool pointer to hold process_pool is or not
4916 * @return 0 if success, error code(<0) if fail
4917 * @retval PMINFO_R_OK success
4918 * @retval PMINFO_R_EINVAL invalid argument
4919 * @retval PMINFO_R_ERROR internal error
4920 * @pre pkgmgrinfo_appinfo_get_appinfo()
4921 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4922 * @see pkgmgrinfo_appinfo_get_appid()
4924 static int get_app_process_pool(const char *appid)
4927 bool process_pool = 0;
4928 pkgmgrinfo_appinfo_h handle = NULL;
4929 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4930 if (ret != PMINFO_R_OK)
4932 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4933 if (ret != PMINFO_R_OK) {
4934 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4937 printf("process_pool: %d\n", process_pool);
4938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4943 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4946 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4947 * @brief This API gets the installed storage location of the application
4949 * @par This API is for package-manager client application
4950 * @par Sync (or) Async : Synchronous API
4952 * @param[in] handle pointer to the application info handle.
4953 * @param[out] app_type pointer to hold installed storage location
4954 * @return 0 if success, error code(<0) if fail
4955 * @retval PMINFO_R_OK success
4956 * @retval PMINFO_R_EINVAL invalid argument
4957 * @retval PMINFO_R_ERROR internal error
4958 * @pre pkgmgrinfo_appinfo_get_appinfo()
4959 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4960 * @see pkgmgrinfo_appinfo_get_appid()
4962 static int get_app_installed_location(const char *appid)
4965 pkgmgrinfo_installed_storage storage;
4966 pkgmgrinfo_appinfo_h handle = NULL;
4967 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4968 if (ret != PMINFO_R_OK)
4970 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4971 if (ret != PMINFO_R_OK) {
4972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4975 printf("Installed storage location : %d\n", storage);
4976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4981 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4985 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4986 * @brief This API checks if the application has the given category
4988 * @par This API is for package-manager client application
4989 * @par Sync (or) Async : Synchronous API
4991 * @param[in] handle pointer to the application info handle
4992 * @param[in] category category
4993 * @param[out] exist value Gets whether the application has the given category
4994 * @return 0 if success, error code(<0) if fail
4995 * @retval PMINFO_R_OK success
4996 * @retval PMINFO_R_EINVAL invalid argument
4997 * @retval PMINFO_R_ERROR internal error
4999 static int is_category_exist(const char *appid, const char *category)
5002 pkgmgrinfo_appinfo_h handle;
5005 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5006 if (ret != PMINFO_R_OK)
5009 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
5010 if (ret != PMINFO_R_OK) {
5011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5015 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5020 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
5023 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
5024 * @brief This API gets the application 'ui_gadget' value from the app ID
5026 * @par This API is for package-manager client application
5027 * @par Sync (or) Async : Synchronous API
5029 * @param[in] handle pointer to application info handle
5030 * @param[out] ui_gadget pointer to hold package ui_gadget value
5031 * @return 0 if success, error code(<0) if fail
5032 * @retval PMINFO_R_OK success
5033 * @retval PMINFO_R_EINVAL invalid argument
5034 * @pre pkgmgrinfo_appinfo_get_appinfo()
5035 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5037 static int get_app_ui_gadget(const char *appid)
5041 pkgmgrinfo_appinfo_h handle = NULL;
5042 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5043 if (ret != PMINFO_R_OK)
5045 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
5046 if (ret != PMINFO_R_OK) {
5047 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5050 printf("app ui_gadget: %d\n", ui_gadget);
5051 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5056 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
5059 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
5060 * @brief This API gets the application 'support_disable' value from the app ID
5062 * @par This API is for package-manager client application
5063 * @par Sync (or) Async : Synchronous API
5065 * @param[in] handle pointer to application info handle
5066 * @param[out] support_disable pointer to hold package support_disable value
5067 * @return 0 if success, error code(<0) if fail
5068 * @retval PMINFO_R_OK success
5069 * @retval PMINFO_R_EINVAL invalid argument
5070 * @pre pkgmgrinfo_appinfo_get_appinfo()
5071 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5073 static int get_app_support_disable(const char *appid)
5076 bool support_disable;
5077 pkgmgrinfo_appinfo_h handle = NULL;
5078 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5079 if (ret != PMINFO_R_OK)
5081 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
5082 if (ret != PMINFO_R_OK) {
5083 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5086 printf("app support_disable: %d\n", support_disable);
5087 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5092 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
5095 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
5096 * @brief This API gets the application 'removable' value from the app ID
5098 * @par This API is for package-manager client application
5099 * @par Sync (or) Async : Synchronous API
5101 * @param[in] handle pointer to application info handle
5102 * @param[out] removable pointer to hold package removable value
5103 * @return 0 if success, error code(<0) if fail
5104 * @retval PMINFO_R_OK success
5105 * @retval PMINFO_R_EINVAL invalid argument
5106 * @retval PMINFO_R_ERROR internal error
5107 * @pre pkgmgrinfo_appinfo_get_appinfo()
5108 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5109 * @see pkgmgrinfo_appinfo_get_appid()
5111 static int get_app_removable(const char *appid)
5115 pkgmgrinfo_appinfo_h handle = NULL;
5116 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5117 if (ret != PMINFO_R_OK)
5119 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5120 if (ret != PMINFO_R_OK) {
5121 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5124 printf("app removable: %d\n", removable);
5125 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5130 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5133 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5134 * @brief This API gets the application 'system' value from the app ID
5136 * @par This API is for package-manager client application
5137 * @par Sync (or) Async : Synchronous API
5139 * @param[in] handle pointer to application info handle
5140 * @param[out] system pointer to hold package system value
5141 * @return 0 if success, error code(<0) if fail
5142 * @retval PMINFO_R_OK success
5143 * @retval PMINFO_R_EINVAL invalid argument
5144 * @retval PMINFO_R_ERROR internal error
5145 * @pre pkgmgrinfo_appinfo_get_appinfo()
5146 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5147 * @see pkgmgrinfo_appinfo_get_appid()
5149 static int get_app_system(const char *appid)
5152 bool system = false;
5153 pkgmgrinfo_appinfo_h handle = NULL;
5154 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5155 if (ret != PMINFO_R_OK)
5157 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5158 if (ret != PMINFO_R_OK) {
5159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5162 printf("app system: %d\n", system);
5163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5168 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5172 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5173 * @brief This API gets the application 'is_disable' value from the app ID
5175 * @par This API is for package-manager client application
5176 * @par Sync (or) Async : Synchronous API
5178 * @param[in] handle pointer to application info handle
5179 * @param[out] disabled pointer to hold application is_disabled value
5180 * @return 0 if success, error code(<0) if fail
5181 * @retval PMINFO_R_OK success
5182 * @retval PMINFO_R_EINVAL invalid argument
5183 * @pre pkgmgrinfo_appinfo_get_appinfo()
5184 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5186 static int get_app_is_disable(const char *appid)
5190 pkgmgrinfo_appinfo_h handle = NULL;
5191 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5192 if (ret != PMINFO_R_OK)
5194 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5195 if (ret != PMINFO_R_OK) {
5196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5199 printf("app is_disable: %d\n", is_disable);
5200 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5205 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5208 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5209 * @brief This API gets whethere the given application is global application or user application
5211 * @par This API is for package-manager client application
5212 * @par Sync (or) Async : Synchronous API
5214 * @param[in] handle pointer to application info handle
5215 * @param[in] global pointer to hold application global value
5216 * @return 0 if success, error code(<0) if fail
5217 * @retval PMINFO_R_OK success
5218 * @retval PMINFO_R_EINVAL invalid argument
5219 * @retval PMINFO_R_ERROR internal error
5220 * @pre pkgmgrinfo_appinfo_get_appinfo()
5221 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5222 * @see pkgmgrinfo_appinfo_get_appid()
5223 static int get_app_is_global(const char *appid)
5227 pkgmgrinfo_appinfo_h handle = NULL;
5228 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5229 if (ret != PMINFO_R_OK)
5231 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5232 if (ret != PMINFO_R_OK) {
5233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5236 printf("app is_global: %d\n", global);
5237 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5242 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5245 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5246 * @brief This API gets the application 'splash_screen_display' value from the app ID
5248 * @par This API is for package-manager client application
5249 * @par Sync (or) Async : Synchronous API
5251 * @param[in] handle pointer to application info handle
5252 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5253 * @return 0 if success, error code(<0) if fail
5254 * @retval PMINFO_R_OK success
5255 * @retval PMINFO_R_EINVAL invalid argument
5256 * @retval PMINFO_R_ERROR internal error
5258 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5261 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5262 * @brief This API gets the application 'setup_appid' value from the app ID
5264 * @par This API is for package-manager client application
5265 * @par Sync (or) Async : Synchronous API
5267 * @param[in] handle pointer to application info handle
5268 * @param[out] setup_appid pointer to hold package setup_appid value
5269 * @return 0 if success, error code(<0) if fail
5270 * @retval PMINFO_R_OK success
5271 * @retval PMINFO_R_EINVAL invalid argument
5272 * @retval PMINFO_R_ERROR internal error
5274 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5277 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5278 * @brief This API gets the application 'support_ambient' value from the app ID
5280 * @par This API is for package-manager client application
5281 * @par Sync (or) Async : Synchronous API
5283 * @param[in] handle pointer to application info handle
5284 * @param[out] support_ambient pointer to hold package support_ambient 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
5290 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5293 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5294 * @brief This API destroys the application information handle freeing up all the resources
5296 * @par This API is for package-manager client application
5297 * @par Sync (or) Async : Synchronous API
5299 * @param[in] handle pointer to the application info handle.
5300 * @return 0 if success, error code(<0) if fail
5301 * @retval PMINFO_R_OK success
5302 * @retval PMINFO_R_EINVAL invalid argument
5303 * @retval PMINFO_R_ERROR internal error
5304 * @pre pkgmgrinfo_appinfo_get_appinfo()
5306 * @see pkgmgrinfo_appinfo_get_pkgid()
5307 * @see pkgmgrinfo_appinfo_is_multiple()
5309 static int get_app_type(const char *appid)
5313 pkgmgrinfo_appinfo_h handle;
5314 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5315 if (ret != PMINFO_R_OK)
5317 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5318 if (ret != PMINFO_R_OK) {
5319 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5322 printf("apptype: %s\n", type);
5323 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5328 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5331 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5332 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5333 The query will search the entire application information collected from the manifest file of all the installed packages
5335 * @par This API is for package-manager client application
5336 * @par Sync (or) Async : Synchronous API
5338 * @param[out] handle pointer to the application info filter handle.
5339 * @return 0 if success, error code(<0) if fail
5340 * @retval PMINFO_R_OK success
5341 * @retval PMINFO_R_EINVAL invalid argument
5342 * @retval PMINFO_R_ERROR internal error
5344 * @post pkgmgrinfo_appinfo_filter_destroy()
5345 * @see pkgmgrinfo_appinfo_filter_count()
5346 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5348 static int get_capp_count()
5352 pkgmgrinfo_appinfo_filter_h handle;
5353 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5354 if (ret != PMINFO_R_OK)
5356 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5357 if (ret != PMINFO_R_OK) {
5358 pkgmgrinfo_appinfo_filter_destroy(handle);
5361 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5362 if (ret != PMINFO_R_OK) {
5363 pkgmgrinfo_appinfo_filter_destroy(handle);
5366 printf("No of capp: %d\n", count);
5367 pkgmgrinfo_appinfo_filter_destroy(handle);
5372 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5375 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5376 * @brief This API destroys the application information filter handle freeing up all the resources
5378 * @par This API is for package-manager client application
5379 * @par Sync (or) Async : Synchronous API
5381 * @param[in] handle pointer to the application info filter handle.
5382 * @return 0 if success, error code(<0) if fail
5383 * @retval PMINFO_R_OK success
5384 * @retval PMINFO_R_EINVAL invalid argument
5385 * @retval PMINFO_R_ERROR internal error
5386 * @pre pkgmgrinfo_appinfo_filter_create()
5388 * @see pkgmgrinfo_appinfo_filter_count()
5389 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5391 static int get_capp_count()
5395 pkgmgrinfo_appinfo_filter_h handle;
5396 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5397 if (ret != PMINFO_R_OK)
5399 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5400 if (ret != PMINFO_R_OK) {
5401 pkgmgrinfo_appinfo_filter_destroy(handle);
5404 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5405 if (ret != PMINFO_R_OK) {
5406 pkgmgrinfo_appinfo_filter_destroy(handle);
5409 printf("No of capp: %d\n", count);
5410 pkgmgrinfo_appinfo_filter_destroy(handle);
5415 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5418 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5419 * @brief This API adds a boolean filter property to the filter handle
5421 * @par This API is for package-manager client application
5422 * @par Sync (or) Async : Synchronous API
5424 * @param[in] handle pointer to the application info filter handle.
5425 * @param[in] property boolean property name.
5426 * @param[in] value value corresponding to the property.
5427 * @return 0 if success, error code(<0) if fail
5428 * @retval PMINFO_R_OK success
5429 * @retval PMINFO_R_EINVAL invalid argument
5430 * @retval PMINFO_R_ERROR internal error
5431 * @pre pkgmgrinfo_appinfo_filter_create()
5432 * @post pkgmgrinfo_appinfo_filter_destroy()
5433 * @see pkgmgrinfo_appinfo_filter_count()
5434 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5436 static int get_taskmanageable_app_count()
5440 pkgmgrinfo_appinfo_filter_h handle;
5441 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5442 if (ret != PMINFO_R_OK)
5444 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5445 if (ret != PMINFO_R_OK) {
5446 pkgmgrinfo_appinfo_filter_destroy(handle);
5449 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5450 if (ret != PMINFO_R_OK) {
5451 pkgmgrinfo_appinfo_filter_destroy(handle);
5454 printf("No of taskmanageable apps: %d\n", count);
5455 pkgmgrinfo_appinfo_filter_destroy(handle);
5460 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5461 const char *property, const bool value);
5464 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5465 * @brief This API adds an integer filter property to the filter handle
5467 * @par This API is for package-manager client application
5468 * @par Sync (or) Async : Synchronous API
5470 * @param[in] handle pointer to the application info filter handle.
5471 * @param[in] property integer property name.
5472 * @param[in] value value corresponding to the property.
5473 * @return 0 if success, error code(<0) if fail
5474 * @retval PMINFO_R_OK success
5475 * @retval PMINFO_R_EINVAL invalid argument
5476 * @retval PMINFO_R_ERROR internal error
5477 * @pre pkgmgrinfo_appinfo_filter_create()
5478 * @post pkgmgrinfo_appinfo_filter_destroy()
5479 * @see pkgmgrinfo_appinfo_filter_count()
5480 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5482 static int get_taskmanageable_app_count()
5486 pkgmgrinfo_appinfo_filter_h handle;
5487 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5488 if (ret != PMINFO_R_OK)
5490 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5491 if (ret != PMINFO_R_OK) {
5492 pkgmgrinfo_appinfo_filter_destroy(handle);
5495 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5496 if (ret != PMINFO_R_OK) {
5497 pkgmgrinfo_appinfo_filter_destroy(handle);
5500 printf("No of apps: %d\n", count);
5501 pkgmgrinfo_appinfo_filter_destroy(handle);
5506 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5507 const char *property, const int value);
5510 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5511 * @brief This API adds a string filter property to the filter handle
5513 * @par This API is for package-manager client application
5514 * @par Sync (or) Async : Synchronous API
5516 * @param[in] handle pointer to the application info filter handle.
5517 * @param[in] property string property name.
5518 * @param[in] value value corresponding to the property.
5519 * @return 0 if success, error code(<0) if fail
5520 * @retval PMINFO_R_OK success
5521 * @retval PMINFO_R_EINVAL invalid argument
5522 * @retval PMINFO_R_ERROR internal error
5523 * @pre pkgmgrinfo_appinfo_filter_create()
5524 * @post pkgmgrinfo_appinfo_filter_destroy()
5525 * @see pkgmgrinfo_appinfo_filter_count()
5526 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5528 static int get_capp_count()
5532 pkgmgrinfo_appinfo_filter_h handle;
5533 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5534 if (ret != PMINFO_R_OK)
5536 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5537 if (ret != PMINFO_R_OK) {
5538 pkgmgrinfo_appinfo_filter_destroy(handle);
5541 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5542 if (ret != PMINFO_R_OK) {
5543 pkgmgrinfo_appinfo_filter_destroy(handle);
5546 printf("No of capp: %d\n", count);
5547 pkgmgrinfo_appinfo_filter_destroy(handle);
5552 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5553 const char *property, const char *value);
5556 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5557 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5559 * @par This API is for package-manager client application
5560 * @par Sync (or) Async : Synchronous API
5562 * @param[in] handle pointer to the application info filter handle.
5563 * @param[in] app_cb callback function.
5564 * @param[in] user_data user data to be passed to the callback function
5565 * @return 0 if success, error code(<0) if fail
5566 * @retval PMINFO_R_OK success
5567 * @retval PMINFO_R_EINVAL invalid argument
5568 * @retval PMINFO_R_ERROR internal error
5569 * @pre pkgmgrinfo_appinfo_filter_create()
5570 * @post pkgmgrinfo_appinfo_filter_destroy()
5571 * @see pkgmgrinfo_appinfo_filter_count()
5573 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5576 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5577 printf("appid : %s\n", appid);
5581 static int get_capp_list()
5584 pkgmgrinfo_appinfo_filter_h handle;
5585 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5586 if (ret != PMINFO_R_OK)
5588 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5589 if (ret != PMINFO_R_OK) {
5590 pkgmgrinfo_appinfo_filter_destroy(handle);
5593 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5594 if (ret != PMINFO_R_OK) {
5595 pkgmgrinfo_appinfo_filter_destroy(handle);
5598 pkgmgrinfo_appinfo_filter_destroy(handle);
5603 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5604 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5605 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5606 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5609 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5610 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5611 * @brief This API counts the application that satisfy the filter conditions
5613 * @par This API is for package-manager client application
5614 * @par Sync (or) Async : Synchronous API
5616 * @param[in] handle pointer to the application info filter handle.
5617 * @param[in] count pointer to store count value
5618 * @param[in] uid the addressee user id of the instruction
5619 * @return 0 if success, error code(<0) if fail
5620 * @retval PMINFO_R_OK success
5621 * @retval PMINFO_R_EINVAL invalid argument
5622 * @retval PMINFO_R_ERROR internal error
5623 * @pre pkgmgrinfo_appinfo_filter_create()
5624 * @post pkgmgrinfo_appinfo_filter_destroy()
5625 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5627 static int get_capp_count()
5631 pkgmgrinfo_appinfo_filter_h handle;
5632 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5633 if (ret != PMINFO_R_OK)
5635 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5636 if (ret != PMINFO_R_OK) {
5637 pkgmgrinfo_appinfo_filter_destroy(handle);
5640 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5641 if (ret != PMINFO_R_OK) {
5642 pkgmgrinfo_appinfo_filter_destroy(handle);
5645 printf("No of capp: %d\n", count);
5646 pkgmgrinfo_appinfo_filter_destroy(handle);
5651 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5652 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5654 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5655 * @brief This API creates the application's metadata information filter handle from db.
5657 * @par This API is for package-manager client application
5658 * @par Sync (or) Async : Synchronous API
5660 * @param[out] handle pointer to the application metadata info filter handle.
5661 * @return 0 if success, error code(<0) if fail
5662 * @retval PMINFO_R_OK success
5663 * @retval PMINFO_R_EINVAL invalid argument
5664 * @retval PMINFO_R_ERROR internal error
5666 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5667 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5669 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5672 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5673 printf("appid : %s\n", appid);
5677 static int get_app_list(const char *mkey, const char *mvalue)
5680 pkgmgrinfo_appinfo_metadata_filter_h handle;
5681 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5682 if (ret != PMINFO_R_OK)
5684 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5685 if (ret != PMINFO_R_OK) {
5686 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5689 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5690 if (ret != PMINFO_R_OK) {
5691 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5694 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5699 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5702 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5703 * @brief This API destroys the application's metadata information filter handle.
5705 * @par This API is for package-manager client application
5706 * @par Sync (or) Async : Synchronous API
5708 * @param[in] handle pointer to the application metadata info filter handle.
5709 * @return 0 if success, error code(<0) if fail
5710 * @retval PMINFO_R_OK success
5711 * @retval PMINFO_R_EINVAL invalid argument
5712 * @retval PMINFO_R_ERROR internal error
5713 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5715 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5717 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5720 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5721 printf("appid : %s\n", appid);
5725 static int get_app_list(const char *mkey, const char *mvalue)
5728 pkgmgrinfo_appinfo_metadata_filter_h handle;
5729 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5730 if (ret != PMINFO_R_OK)
5732 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5733 if (ret != PMINFO_R_OK) {
5734 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5737 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5738 if (ret != PMINFO_R_OK) {
5739 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5742 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5747 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5750 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5751 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5752 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5754 * @par This API is for package-manager client application
5755 * @par Sync (or) Async : Synchronous API
5757 * @param[in] handle pointer to the application metadata info filter handle.
5758 * @param[in] key pointer to metadata key
5759 * @param[in] value pointer to metadata value
5760 * @return 0 if success, error code(<0) if fail
5761 * @retval PMINFO_R_OK success
5762 * @retval PMINFO_R_EINVAL invalid argument
5763 * @retval PMINFO_R_ERROR internal error
5764 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5765 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5766 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5768 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5771 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5772 printf("appid : %s\n", appid);
5776 static int get_app_list(const char *mkey, const char *mvalue)
5779 pkgmgrinfo_appinfo_metadata_filter_h handle;
5780 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5781 if (ret != PMINFO_R_OK)
5783 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5784 if (ret != PMINFO_R_OK) {
5785 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5788 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5789 if (ret != PMINFO_R_OK) {
5790 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5793 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5798 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5799 const char *key, const char *value);
5802 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5803 * @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)
5804 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5805 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5806 * negative value, no more callbacks will be called and API will return.
5808 * @par This API is for package-manager client application
5809 * @par Sync (or) Async : Synchronous API
5811 * @param[in] handle pointer to the application metadata info filter handle.
5812 * @param[in] app_cb function pointer to callback
5813 * @param[in] user_data pointer to user data
5814 * @param[in] uid the addressee user id of the instruction
5815 * @return 0 if success, error code(<0) if fail
5816 * @retval PMINFO_R_OK success
5817 * @retval PMINFO_R_EINVAL invalid argument
5818 * @retval PMINFO_R_ERROR internal error
5819 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5820 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5822 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5825 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5826 printf("appid : %s\n", appid);
5830 static int get_app_list(const char *mkey, const char *mvalue)
5833 pkgmgrinfo_appinfo_metadata_filter_h handle;
5834 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5835 if (ret != PMINFO_R_OK)
5837 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5838 if (ret != PMINFO_R_OK) {
5839 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5842 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5843 if (ret != PMINFO_R_OK) {
5844 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5847 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5852 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5853 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5854 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5855 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5858 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5859 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5860 * @fn int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5861 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5862 * @brief This API gets the list of app-control for a particular application
5864 * @par This API is for package-manager client application
5865 * @par Sync (or) Async : Synchronous API
5866 * @param[in] handle pointer to the application info handle.
5867 * @param[in] appcontrol_func callback function for list
5868 * @param[in] user_data user data to be passed to callback function
5869 * @return 0 if success, error code(<0) if fail
5870 * @retval PMINFO_R_OK success
5871 * @retval PMINFO_R_EINVAL invalid argument
5872 * @retval PMINFO_R_ERROR internal error
5873 * @pre pkgmgrinfo_appinfo_get_appinfo()
5874 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5876 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5877 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5879 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5880 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5883 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5884 * @brief This API creates the package cert information handle to get data from db.
5886 * @par This API is for package-manager client application
5887 * @par Sync (or) Async : Synchronous API
5889 * @param[out] handle pointer to the package cert handle.
5890 * @return 0 if success, error code(<0) if fail
5891 * @retval PMINFO_R_OK success
5892 * @retval PMINFO_R_EINVAL invalid argument
5893 * @retval PMINFO_R_ERROR internal error
5895 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5896 * @see pkgmgrinfo_pkginfo_get_cert_value()
5897 * @see pkgmgrinfo_pkginfo_load_certinfo()
5899 static int get_cert_info(const char *pkgid)
5902 pkgmgrinfo_certinfo_h handle;
5903 char *auth_cert = NULL;
5904 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5905 if (ret != PMINFO_R_OK)
5907 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5908 if (ret != PMINFO_R_OK) {
5909 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5912 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5913 if (ret != PMINFO_R_OK) {
5914 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5917 printf("Author root certificate: %s\n", auth_root);
5918 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5923 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5926 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5927 * @brief This API loads the package cert information handle with data from db.
5929 * @par This API is for package-manager client application
5930 * @par Sync (or) Async : Synchronous API
5932 * @param[in] pkgid pointer to the package ID.
5933 * @param[in] handle pointer to the package cert handle.
5934 * @return 0 if success, error code(<0) if fail
5935 * @retval PMINFO_R_OK success
5936 * @retval PMINFO_R_EINVAL invalid argument
5937 * @retval PMINFO_R_ERROR internal error
5938 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5939 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5940 * @see pkgmgrinfo_pkginfo_get_cert_value()
5942 static int get_cert_info(const char *pkgid)
5945 pkgmgrinfo_certinfo_h handle;
5946 char *auth_cert = NULL;
5947 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5948 if (ret != PMINFO_R_OK)
5950 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5951 if (ret != PMINFO_R_OK) {
5952 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5955 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5956 if (ret != PMINFO_R_OK) {
5957 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5960 printf("Author root certificate: %s\n", auth_root);
5961 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5966 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5969 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5970 * @brief This API gets the package cert information from the handle
5972 * @par This API is for package-manager client application
5973 * @par Sync (or) Async : Synchronous API
5975 * @param[in] handle pointer to the package cert handle.
5976 * @param[in] cert_type certificate type
5977 * @param[out] cert_value pointer to hold certificate value
5978 * @return 0 if success, error code(<0) if fail
5979 * @retval PMINFO_R_OK success
5980 * @retval PMINFO_R_EINVAL invalid argument
5981 * @retval PMINFO_R_ERROR internal error
5982 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5983 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5984 * @see pkgmgrinfo_pkginfo_load_certinfo()
5986 static int get_cert_info(const char *pkgid)
5989 pkgmgrinfo_certinfo_h handle;
5990 char *auth_cert = NULL;
5991 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5992 if (ret != PMINFO_R_OK)
5994 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5995 if (ret != PMINFO_R_OK) {
5996 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5999 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6000 if (ret != PMINFO_R_OK) {
6001 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6004 printf("Author root certificate: %s\n", auth_root);
6005 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6010 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
6013 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
6014 * @brief This API destroys the package cert information handle freeing up all the resources
6016 * @par This API is for package-manager client application
6017 * @par Sync (or) Async : Synchronous API
6019 * @param[in] handle pointer to the package cert handle.
6020 * @return 0 if success, error code(<0) if fail
6021 * @retval PMINFO_R_OK success
6022 * @retval PMINFO_R_EINVAL invalid argument
6023 * @retval PMINFO_R_ERROR internal error
6024 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6026 * @see pkgmgrinfo_pkginfo_load_certinfo()
6028 static int get_cert_info(const char *pkgid)
6031 pkgmgrinfo_certinfo_h handle;
6032 char *auth_cert = NULL;
6033 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6034 if (ret != PMINFO_R_OK)
6036 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6037 if (ret != PMINFO_R_OK) {
6038 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6041 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6042 if (ret != PMINFO_R_OK) {
6043 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6046 printf("Author root certificate: %s\n", auth_root);
6047 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6052 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
6055 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
6056 * @brief This API deletes the package cert information from DB
6058 * @par This API is for package-manager client application
6059 * @par Sync (or) Async : Synchronous API
6061 * @param[in] pkgid pointer to the package ID.
6062 * @return 0 if success, error code(<0) if fail
6063 * @retval PMINFO_R_OK success
6064 * @retval PMINFO_R_EINVAL invalid argument
6065 * @retval PMINFO_R_ERROR internal error
6069 static int delete_cert_info(const char *pkgid)
6072 ret = pkgmgrinfo_delete_certinfo(pkgid);
6073 if (ret != PMINFO_R_OK)
6079 int pkgmgrinfo_delete_certinfo(const char *pkgid);
6080 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
6083 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
6084 * @brief This API creates the package cert information handle to set data in db.
6086 * @par This API is for package-manager client application
6087 * @par Sync (or) Async : Synchronous API
6089 * @param[out] handle pointer to the package cert handle.
6090 * @return 0 if success, error code(<0) if fail
6091 * @retval PMINFO_R_OK success
6092 * @retval PMINFO_R_EINVAL invalid argument
6093 * @retval PMINFO_R_ERROR internal error
6095 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6096 * @see pkgmgrinfo_set_cert_value()
6097 * @see pkgmgrinfo_save_certinfo()
6099 static int set_cert_in_db(const char *pkgid)
6102 pkgmgrinfo_instcertinfo_h handle;
6103 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6104 if (ret != PMINFO_R_OK)
6106 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6107 if (ret != PMINFO_R_OK) {
6108 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6111 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6112 if (ret != PMINFO_R_OK) {
6113 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6116 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6121 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
6124 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
6125 * @brief This API sets the package cert information in the handle.
6127 * @par This API is for package-manager client application
6128 * @par Sync (or) Async : Synchronous API
6130 * @param[in] handle pointer to the package cert handle.
6131 * @param[in] cert_type certificate type.
6132 * @param[in] cert_value certificate value.
6133 * @return 0 if success, error code(<0) if fail
6134 * @retval PMINFO_R_OK success
6135 * @retval PMINFO_R_EINVAL invalid argument
6136 * @retval PMINFO_R_ERROR internal error
6137 * @pre pkgmgrinfo_create_certinfo_set_handle()
6138 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6139 * @see pkgmgrinfo_save_certinfo()
6141 static int set_cert_in_db(const char *pkgid)
6144 pkgmgrinfo_instcertinfo_h handle;
6145 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6146 if (ret != PMINFO_R_OK)
6148 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6149 if (ret != PMINFO_R_OK) {
6150 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6153 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6154 if (ret != PMINFO_R_OK) {
6155 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6158 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6163 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6166 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6167 * @brief This API saves the package cert information in the DB.
6169 * @par This API is for package-manager client application
6170 * @par Sync (or) Async : Synchronous API
6172 * @param[in] pkgid pointer to the package ID.
6173 * @param[in] handle pointer to the package cert handle.
6174 * @return 0 if success, error code(<0) if fail
6175 * @retval PMINFO_R_OK success
6176 * @retval PMINFO_R_EINVAL invalid argument
6177 * @retval PMINFO_R_ERROR internal error
6178 * @pre pkgmgrinfo_create_certinfo_set_handle()
6179 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6180 * @see pkgmgrinfo_save_certinfo()
6182 static int set_cert_in_db(const char *pkgid)
6185 pkgmgrinfo_instcertinfo_h handle;
6186 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6187 if (ret != PMINFO_R_OK)
6189 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6190 if (ret != PMINFO_R_OK) {
6191 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6194 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6195 if (ret != PMINFO_R_OK) {
6196 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6199 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6204 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6207 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6208 * @brief This API destroys the package cert information handle freeing up all the resources.
6210 * @par This API is for package-manager client application
6211 * @par Sync (or) Async : Synchronous API
6213 * @param[in] handle pointer to the package cert handle.
6214 * @return 0 if success, error code(<0) if fail
6215 * @retval PMINFO_R_OK success
6216 * @retval PMINFO_R_EINVAL invalid argument
6217 * @retval PMINFO_R_ERROR internal error
6218 * @pre pkgmgrinfo_create_certinfo_set_handle()
6220 * @see pkgmgrinfo_save_certinfo()
6222 static int set_cert_in_db(const char *pkgid)
6225 pkgmgrinfo_instcertinfo_h handle;
6226 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6227 if (ret != PMINFO_R_OK)
6229 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6230 if (ret != PMINFO_R_OK) {
6231 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6234 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6235 if (ret != PMINFO_R_OK) {
6236 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6239 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6244 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6247 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6248 * @brief This API gets the datacontrol info
6250 * @par This API is for package-manager client application
6251 * @par Sync (or) Async : Synchronous API
6253 * @param[in] providerid pointer to the providerid of dataconltrol.
6254 * @param[in] type pointer to the type of dataconltrol.
6255 * @param[out] appid pointer to hold appid, need to free after using
6256 * @param[out] access pointer to hold access, need to free after using
6257 * @return 0 if success, error code(<0) if fail
6258 * @retval PMINFO_R_OK success
6259 * @retval PMINFO_R_EINVAL invalid argument
6260 * @retval PMINFO_R_ERROR internal error
6263 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6266 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6267 * @brief This API gets the application 'guest mode visibility' value from the DB
6269 * @par This API is for package-manager client application
6270 * @par Sync (or) Async : Synchronous API
6272 * @param[in] handle pointer to application info handle
6273 * @param[out] status pointer to hold app guest mode visibility value
6274 * @return 0 if success, error code(<0) if fail
6275 * @retval PMINFO_R_OK success
6276 * @retval PMINFO_R_EINVAL invalid argument
6277 * @retval PMINFO_R_ERROR internal error
6278 * @pre pkgmgrinfo_appinfo_get_appinfo()
6279 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6280 * @see pkgmgrinfo_appinfo_get_appid()
6281 * @see pkgmgrinfo_appinfo_is_multiple()
6283 static int get_app_guestmode_visibility(const char *appid)
6287 pkgmgrinfo_appinfo_h handle;
6288 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6289 if (ret != PMINFO_R_OK)
6291 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6292 if (ret != PMINFO_R_OK) {
6293 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6296 printf("app guest mode visibility: %d\n", status);
6297 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6302 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6305 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6306 * @brief This API sets the package 'installed_storage' value in db
6308 * @par This API is for package-manager client application
6309 * @par Sync (or) Async : Synchronous API
6311 * @param[in] pkgid pointer to the package ID.
6312 * @param[in] location package install location
6313 * @param[in] external_pkg_path image path if pkg has installed at external storage
6314 * @return 0 if success, error code(<0) if fail
6315 * @retval PMINFO_R_OK success
6316 * @retval PMINFO_R_EINVAL invalid argument
6317 * @retval PMINFO_R_ERROR internal error
6319 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6323 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6324 if (ret != PMINFO_R_OK) {
6331 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6332 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6334 /* version compare */
6335 int pkgmgrinfo_compare_package_version(const char *current_version,
6336 const char *target_version, pkgmgrinfo_version_compare_type *res);
6339 * @fn int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6340 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6342 * @brief This API gets the list of dependency of a particular package
6344 * @par This API is for package-manager client application
6345 * @par Sync (or) Async : Synchronous API
6346 * @param[in] handle pointer to the package info handle.
6347 * @param[in] dependency_cb callback function for list
6348 * @param[in] user_data user data to be passed to callback function
6349 * @return 0 if success, error code(<0) if fail
6350 * @retval PMINFO_R_OK success
6351 * @retval PMINFO_R_EINVAL invalid argument
6352 * @retval PMINFO_R_ERROR internal error
6353 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6354 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6356 int dependency_cb(const char *pkgid, const char *type,
6357 const char *required_version,void *user_data)
6359 printf("this package %s %s", type, pkgid);
6360 if (required_version)
6361 printf("required version : %s", required_version);
6365 static int list_dependency(const char *package)
6368 pkgmgrinfo_pkginfo_h handle;
6369 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6370 if (ret != PMINFO_R_OK)
6372 ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6373 if (ret != PMINFO_R_OK) {
6374 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6377 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6382 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6383 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6387 * @fn int pkgmgrinfo_pkginfo_foreach_required_by(pkgmgrinfo_pkginfo_h handle,
6388 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6390 * @brief This API gets the list of packages which has dependency of a particular package
6392 * @par This API is for package-manager client application
6393 * @par Sync (or) Async : Synchronous API
6394 * @param[in] handle pointer to the package info handle.
6395 * @param[in] dependency_cb callback function for list
6396 * @param[in] user_data user data to be passed to callback function
6397 * @return 0 if success, error code(<0) if fail
6398 * @retval PMINFO_R_OK success
6399 * @retval PMINFO_R_EINVAL invalid argument
6400 * @retval PMINFO_R_ERROR internal error
6401 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6402 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6404 int dependency_cb(const char *pkgid, const char *type,
6405 const char *required_version,void *user_data)
6407 printf("%s %s this package", pkgid, type);
6408 if (required_version)
6409 printf("required version : %s", required_version);
6413 static int list_required_by(const char *package)
6416 pkgmgrinfo_pkginfo_h handle;
6417 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6418 if (ret != PMINFO_R_OK)
6420 ret = pkgmgrinfo_pkginfo_foreach_required_by(handle, dependency_cb, NULL);
6421 if (ret != PMINFO_R_OK) {
6422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6425 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6430 int pkgmgrinfo_pkginfo_foreach_required_by(pkgmgrinfo_pkginfo_h handle,
6431 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6439 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6440 int flag, void *user_data, uid_t uid);
6441 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6442 int flag, void *user_data);
6443 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6444 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6446 int pkgmgrinfo_appinfo_get_installed_list_full(
6447 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6450 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6451 pkgmgrinfo_archiveinfo_h *handle);
6452 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6453 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6454 const char **pkgid);
6455 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6457 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6458 const char **version);
6459 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6460 const char **api_version);
6461 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6462 const char **description);
6463 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6464 const char **label);
6465 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6466 const char **author);
6467 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6468 const unsigned char **icon, size_t *size);
6471 * @pkgmgrinfo client API end
6479 #endif /* __PKG_INFO_H__ */