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 'update' 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 whether 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_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2690 * @brief This API gets list of installed applications from all packages.
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_installed_list(app_list_cb, (void *)name);
2721 if (ret != PMINFO_R_OK) {
2728 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2729 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2732 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2733 * @brief This API creates the disabled application information handle from db
2735 * @par This API is for package-manager client application
2736 * @par Sync (or) Async : Synchronous API
2738 * @param[in] appid pointer to appid
2739 * @param[out] handle pointer to the application info handle.
2740 * @return 0 if success, error code(<0) if fail
2741 * @retval PMINFO_R_OK success
2742 * @retval PMINFO_R_EINVAL invalid argument
2743 * @retval PMINFO_R_ERROR internal error
2745 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2746 * @see pkgmgrinfo_appinfo_get_pkgid()
2747 * @see pkgmgrinfo_appinfo_is_multiple()
2749 static int get_disabled_app_type(const char *appid)
2753 pkgmgrinfo_appinfo_h handle;
2754 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2755 if (ret != PMINFO_R_OK)
2757 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2758 if (ret != PMINFO_R_OK) {
2759 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2762 printf("apptype: %s\n", type);
2763 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2768 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2769 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2772 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2773 * @brief This API creates the application information handle from db
2775 * @par This API is for package-manager client application
2776 * @par Sync (or) Async : Synchronous API
2778 * @param[in] appid pointer to appid
2779 * @param[out] handle pointer to the application info handle.
2780 * @return 0 if success, error code(<0) if fail
2781 * @retval PMINFO_R_OK success
2782 * @retval PMINFO_R_EINVAL invalid argument
2783 * @retval PMINFO_R_ERROR internal error
2785 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2786 * @see pkgmgrinfo_appinfo_get_pkgid()
2787 * @see pkgmgrinfo_appinfo_is_multiple()
2789 static int get_app_type(const char *appid)
2793 pkgmgrinfo_appinfo_h handle;
2794 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2795 if (ret != PMINFO_R_OK)
2797 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2798 if (ret != PMINFO_R_OK) {
2799 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2802 printf("apptype: %s\n", type);
2803 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2808 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2809 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2812 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2813 * @brief This API creates the application information handle from db regardless of its disable or storage status
2815 * @par This API is for package-manager client application
2816 * @par Sync (or) Async : Synchronous API
2818 * @param[in] appid pointer to appid
2819 * @param[out] handle pointer to the application info handle.
2820 * @return 0 if success, error code(<0) if fail
2821 * @retval PMINFO_R_OK success
2822 * @retval PMINFO_R_EINVAL invalid argument
2823 * @retval PMINFO_R_ERROR internal error
2825 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2826 * @see pkgmgrinfo_appinfo_get_pkgid()
2827 * @see pkgmgrinfo_appinfo_is_multiple()
2829 static int get_app_type(const char *appid)
2833 pkgmgrinfo_appinfo_h handle;
2834 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2835 if (ret != PMINFO_R_OK)
2837 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2838 if (ret != PMINFO_R_OK) {
2839 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2842 printf("apptype: %s\n", type);
2843 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2848 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2849 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2852 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2853 * @brief This API gets the application ID
2855 * @par This API is for package-manager client application
2856 * @par Sync (or) Async : Synchronous API
2858 * @param[in] handle pointer to the application info handle.
2859 * @param[out] appid pointer to hold appid
2860 * @return 0 if success, error code(<0) if fail
2861 * @retval PMINFO_R_OK success
2862 * @retval PMINFO_R_EINVAL invalid argument
2863 * @retval PMINFO_R_ERROR internal error
2864 * @pre pkgmgrinfo_appinfo_get_appinfo()
2865 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2866 * @see pkgmgrinfo_appinfo_get_pkgid()
2867 * @see pkgmgrinfo_appinfo_is_multiple()
2869 static int get_app_id(const char *appid)
2872 char *app_id = NULL;
2873 pkgmgrinfo_appinfo_h handle;
2874 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2875 if (ret != PMINFO_R_OK)
2877 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2878 if (ret != PMINFO_R_OK) {
2879 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2882 printf("app id: %s\n", app_id);
2883 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2888 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2891 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2892 * @brief This API gets the package name of the application
2894 * @par This API is for package-manager client application
2895 * @par Sync (or) Async : Synchronous API
2897 * @param[in] handle pointer to the application info handle.
2898 * @param[out] pkg_name pointer to hold package name
2899 * @return 0 if success, error code(<0) if fail
2900 * @retval PMINFO_R_OK success
2901 * @retval PMINFO_R_EINVAL invalid argument
2902 * @retval PMINFO_R_ERROR internal error
2903 * @pre pkgmgrinfo_appinfo_get_appinfo()
2904 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2905 * @see pkgmgrinfo_appinfo_get_appid()
2906 * @see pkgmgrinfo_appinfo_is_multiple()
2908 static int get_app_pkgname(const char *appid)
2911 char *pkgname = NULL;
2912 pkgmgrinfo_appinfo_h handle;
2913 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2914 if (ret != PMINFO_R_OK)
2916 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2917 if (ret != PMINFO_R_OK) {
2918 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2921 printf("pkg name: %s\n", pkgname);
2922 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2927 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2930 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2931 * @brief This API gets the package id of the application
2933 * @par This API is for package-manager client application
2934 * @par Sync (or) Async : Synchronous API
2936 * @param[in] handle pointer to the application info handle.
2937 * @param[out] pkgid pointer to hold package id
2938 * @return 0 if success, error code(<0) if fail
2939 * @retval PMINFO_R_OK success
2940 * @retval PMINFO_R_EINVAL invalid argument
2941 * @retval PMINFO_R_ERROR internal error
2942 * @pre pkgmgrinfo_appinfo_get_appinfo()
2943 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2944 * @see pkgmgrinfo_appinfo_get_appid()
2945 * @see pkgmgrinfo_appinfo_is_multiple()
2947 static int get_app_pkgid(const char *appid)
2951 pkgmgrinfo_appinfo_h handle;
2952 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2953 if (ret != PMINFO_R_OK)
2955 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2956 if (ret != PMINFO_R_OK) {
2957 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2960 printf("pkg id: %s\n", pkgid);
2961 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2966 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2969 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2970 * @brief This API gets the package type of the application
2972 * @par This API is for package-manager client application
2973 * @par Sync (or) Async : Synchronous API
2975 * @param[in] handle pointer to the application info handle.
2976 * @param[out] pkgtype pointer to hold package type
2977 * @return 0 if success, error code(<0) if fail
2978 * @retval PMINFO_R_OK success
2979 * @retval PMINFO_R_EINVAL invalid argument
2980 * @retval PMINFO_R_ERROR internal error
2981 * @pre pkgmgrinfo_appinfo_get_appinfo()
2982 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2983 * @see pkgmgrinfo_appinfo_get_appid()
2984 * @see pkgmgrinfo_appinfo_is_multiple()
2986 static int get_app_pkgtype(const char *appid)
2989 char *pkgtype = NULL;
2990 pkgmgrinfo_appinfo_h handle = NULL;
2991 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2992 if (ret != PMINFO_R_OK)
2994 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2995 if (ret != PMINFO_R_OK) {
2996 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2999 printf("pkgtype: %s\n", pkgtype);
3000 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3005 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
3008 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3009 * @brief This API gets the executable name of the application
3011 * @par This API is for package-manager client application
3012 * @par Sync (or) Async : Synchronous API
3014 * @param[in] handle pointer to the application info handle.
3015 * @param[out] exec pointer to hold app exec name
3016 * @return 0 if success, error code(<0) if fail
3017 * @retval PMINFO_R_OK success
3018 * @retval PMINFO_R_EINVAL invalid argument
3019 * @retval PMINFO_R_ERROR internal error
3020 * @pre pkgmgrinfo_appinfo_get_appinfo()
3021 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3022 * @see pkgmgrinfo_appinfo_get_appid()
3023 * @see pkgmgrinfo_appinfo_is_multiple()
3025 static int get_app_exec(const char *appid)
3029 pkgmgrinfo_appinfo_h handle;
3030 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3031 if (ret != PMINFO_R_OK)
3033 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3034 if (ret != PMINFO_R_OK) {
3035 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3038 printf("exec name: %s\n", exec);
3039 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3044 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
3047 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3048 * @brief This API gets the icon name of the application
3050 * @par This API is for package-manager client application
3051 * @par Sync (or) Async : Synchronous API
3053 * @param[in] handle pointer to the application info handle.
3054 * @param[out] icon pointer to hold app icon name
3055 * @return 0 if success, error code(<0) if fail
3056 * @retval PMINFO_R_OK success
3057 * @retval PMINFO_R_EINVAL invalid argument
3058 * @retval PMINFO_R_ERROR internal error
3059 * @pre pkgmgrinfo_appinfo_get_appinfo()
3060 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3061 * @see pkgmgrinfo_appinfo_get_appid()
3062 * @see pkgmgrinfo_appinfo_is_multiple()
3064 static int get_app_icon(const char *appid)
3068 pkgmgrinfo_appinfo_h handle;
3069 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3070 if (ret != PMINFO_R_OK)
3072 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3073 if (ret != PMINFO_R_OK) {
3074 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3077 printf("icon name: %s\n", icon);
3078 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3083 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3086 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3087 * @brief This API gets the label of the application
3089 * @par This API is for package-manager client application
3090 * @par Sync (or) Async : Synchronous API
3092 * @param[in] handle pointer to the application info handle.
3093 * @param[out] label pointer to hold app label
3094 * @return 0 if success, error code(<0) if fail
3095 * @retval PMINFO_R_OK success
3096 * @retval PMINFO_R_EINVAL invalid argument
3097 * @retval PMINFO_R_ERROR internal error
3098 * @pre pkgmgrinfo_appinfo_get_appinfo()
3099 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3100 * @see pkgmgrinfo_appinfo_get_appid()
3101 * @see pkgmgrinfo_appinfo_is_multiple()
3103 static int get_app_label(const char *appid)
3107 pkgmgrinfo_appinfo_h handle;
3108 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3109 if (ret != PMINFO_R_OK)
3111 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3112 if (ret != PMINFO_R_OK) {
3113 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3116 printf("label : %s\n", label);
3117 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3122 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3125 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3126 * @brief This API gets exactly matched label by given appid and locale
3128 * @par This API is for package-manager client application
3129 * @par Sync (or) Async : Synchronous API
3131 * @param[in] appid pointer to appid
3132 * @param[in] locale pointer to locale
3133 * @param[out] label pointer to hold app label
3134 * @return 0 if success, error code(<0) if fail
3135 * @retval PMINFO_R_OK success
3136 * @retval PMINFO_R_EINVAL invalid argument
3137 * @retval PMINFO_R_ERROR internal error
3139 static int get_localed_label(const char *appid, const char *locale)
3144 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3145 if (ret != PMINFO_R_OK)
3148 printf("localed label: %s\n", label);
3156 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3157 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3160 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3161 * @brief This API gets metadata value by given metadata key
3163 * @par This API is for package-manager client application
3164 * @par Sync (or) Async : Synchronous API
3166 * @param[in] handle pointer to the application info handle
3167 * @param[in] metadata_key metadata key
3168 * @param[out] metadata_value pointer to hold metadata value
3169 * @return 0 if success, error code(<0) if fail
3170 * @retval PMINFO_R_OK success
3171 * @retval PMINFO_R_EINVAL invalid argument
3173 static int get_metadata_value(const char *appid, const char *metadata_key)
3176 pkgmgrinfo_appinfo_h handle = NULL;
3177 char *metadata_value = NULL;
3179 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3180 if (ret != PMINFO_R_OK)
3183 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3184 if (ret != PMINFO_R_OK) {
3185 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3189 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3194 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3197 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3198 * @brief This API gets the component of the application
3200 * @par This API is for package-manager client application
3201 * @par Sync (or) Async : Synchronous API
3203 * @param[in] handle pointer to the application info handle.
3204 * @param[out] component pointer to hold app component
3205 * @return 0 if success, error code(<0) if fail
3206 * @retval PMINFO_R_OK success
3207 * @retval PMINFO_R_EINVAL invalid argument
3208 * @retval PMINFO_R_ERROR internal error
3209 * @pre pkgmgrinfo_appinfo_get_appinfo()
3210 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3211 * @see pkgmgrinfo_appinfo_get_appid()
3212 * @see pkgmgrinfo_appinfo_is_multiple()
3214 static int get_app_component(const char *appid)
3217 pkgmgrinfo_app_component component;
3218 pkgmgrinfo_appinfo_h handle;
3219 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3220 if (ret != PMINFO_R_OK)
3222 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3223 if (ret != PMINFO_R_OK) {
3224 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3227 printf("component : %s\n", component);
3228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3233 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3236 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3237 * @brief This API gets the apptype of the application
3239 * @par This API is for package-manager client application
3240 * @par Sync (or) Async : Synchronous API
3242 * @param[in] handle pointer to the application info handle.
3243 * @param[out] app_type pointer to hold apptype
3244 * @return 0 if success, error code(<0) if fail
3245 * @retval PMINFO_R_OK success
3246 * @retval PMINFO_R_EINVAL invalid argument
3247 * @retval PMINFO_R_ERROR internal error
3248 * @pre pkgmgrinfo_appinfo_get_appinfo()
3249 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3250 * @see pkgmgrinfo_appinfo_get_appid()
3251 * @see pkgmgrinfo_appinfo_is_multiple()
3253 static int get_app_type(const char *appid)
3256 char *apptype = NULL;
3257 pkgmgrinfo_appinfo_h handle;
3258 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3259 if (ret != PMINFO_R_OK)
3261 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3262 if (ret != PMINFO_R_OK) {
3263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3266 printf("apptype : %s\n", apptype);
3267 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3272 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3275 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3276 * @brief This API gets the notification icon of the application
3278 * @par This API is for package-manager client application
3279 * @par Sync (or) Async : Synchronous API
3281 * @param[in] handle pointer to the application info handle.
3282 * @param[out] path pointer to hold notification icon
3283 * @return 0 if success, error code(<0) if fail
3284 * @retval PMINFO_R_OK success
3285 * @retval PMINFO_R_EINVAL invalid argument
3286 * @retval PMINFO_R_ERROR internal error
3287 * @pre pkgmgrinfo_appinfo_get_appinfo()
3288 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3289 * @see pkgmgrinfo_appinfo_get_appid()
3290 * @see pkgmgrinfo_appinfo_is_multiple()
3292 static int get_app_notification_icon(const char *appid)
3295 char *notification_icon = NULL;
3296 pkgmgrinfo_appinfo_h handle;
3297 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3298 if (ret != PMINFO_R_OK)
3300 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3301 if (ret != PMINFO_R_OK) {
3302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3305 printf("notification icon : %s\n", notification_icon);
3306 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3311 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3314 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3315 * @brief This API gets the type of recent image on app-tray
3317 * @par This API is for package-manager client application
3318 * @par Sync (or) Async : Synchronous API
3320 * @param[in] handle pointer to the application info handle.
3321 * @param[out] type pointer to hold image type
3322 * @return 0 if success, error code(<0) if fail
3323 * @retval PMINFO_R_OK success
3324 * @retval PMINFO_R_EINVAL invalid argument
3325 * @retval PMINFO_R_ERROR internal error
3326 * @pre pkgmgrinfo_appinfo_get_appinfo()
3327 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3328 * @see pkgmgrinfo_appinfo_get_appid()
3329 * @see pkgmgrinfo_appinfo_is_multiple()
3331 static int get_app_recent_image_type(const char *appid)
3334 pkgmgrinfo_app_recentimage type;
3335 pkgmgrinfo_appinfo_h handle;
3336 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3337 if (ret != PMINFO_R_OK)
3339 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3340 if (ret != PMINFO_R_OK) {
3341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3344 printf("recent image type: %d\n", type);
3345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3350 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3354 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3355 * @brief This API gets the preview image of application
3357 * @par Sync (or) Async : Synchronous API
3359 * @param[in] handle pointer to the application info handle.
3360 * @param[out] preview_img pointer to hold preview image path
3361 * @return 0 if success, error code(<0) if fail
3362 * @retval PMINFO_R_OK success
3363 * @retval PMINFO_R_EINVAL invalid argument
3364 * @retval PMINFO_R_ERROR internal error
3365 * @pre pkgmgrinfo_appinfo_get_appinfo()
3366 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3367 * @see pkgmgrinfo_appinfo_get_appid()
3369 static int get_app_previewimage(const char *appid)
3372 char *preview = NULL;
3373 pkgmgrinfo_appinfo_h handle = NULL;
3374 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3375 if (ret != PMINFO_R_OK)
3377 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3378 if (ret != PMINFO_R_OK) {
3379 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3382 printf("preview image path : %s\n", preview);
3383 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3388 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3392 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3393 * @brief This API gets the package permission type of the application
3395 * @par This API is for package-manager client application
3396 * @par Sync (or) Async : Synchronous API
3398 * @param[in] handle pointer to the application info handle.
3399 * @param[out] permission pointer to hold package permission
3400 * @return 0 if success, error code(<0) if fail
3401 * @retval PMINFO_R_OK success
3402 * @retval PMINFO_R_EINVAL invalid argument
3403 * @retval PMINFO_R_ERROR internal error
3404 * @pre pkgmgrinfo_appinfo_get_appinfo()
3405 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3406 * @see pkgmgrinfo_appinfo_get_appid()
3408 static int get_app_permission(const char *appid)
3411 pkgmgrinfo_permission_type permission = 0;
3412 pkgmgrinfo_appinfo_h handle;
3414 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3415 if (ret != PMINFO_R_OK)
3417 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3418 if (ret != PMINFO_R_OK) {
3419 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3422 printf("permission type: %d\n", permission);
3423 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3428 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3431 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3432 * @brief This API gets the component_type
3434 * @par This API is for package-manager client application
3435 * @par Sync (or) Async : Synchronous API
3437 * @param[in] handle pointer to the application info handle.
3438 * @param[out] component_type pointer to hold component_type
3439 * @return 0 if success, error code(<0) if fail
3440 * @retval PMINFO_R_OK success
3441 * @retval PMINFO_R_EINVAL invalid argument
3442 * @retval PMINFO_R_ERROR internal error
3443 * @pre pkgmgrinfo_appinfo_get_appinfo()
3444 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3445 * @see pkgmgrinfo_appinfo_get_pkgid()
3446 * @see pkgmgrinfo_appinfo_is_multiple()
3448 static int get_component_type(const char *appid)
3451 char *component_type = NULL;
3452 pkgmgrinfo_appinfo_h handle;
3453 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3454 if (ret != PMINFO_R_OK)
3456 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3457 if (ret != PMINFO_R_OK) {
3458 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3461 printf("component_type: %s\n", component_type);
3462 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3467 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3470 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3471 * @brief This API gets the application 'hwacceleration' value from the app ID
3473 * @par This API is for package-manager client application
3474 * @par Sync (or) Async : Synchronous API
3476 * @param[in] handle pointer to application info handle
3477 * @param[out] hwacceleration pointer to hold package hwacceleration value
3478 * @return 0 if success, error code(<0) if fail
3479 * @retval PMINFO_R_OK success
3480 * @retval PMINFO_R_EINVAL invalid argument
3481 * @retval PMINFO_R_ERROR internal error
3482 * @pre pkgmgrinfo_appinfo_get_appinfo()
3483 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3484 * @see pkgmgrinfo_appinfo_get_appid()
3485 * @see pkgmgrinfo_appinfo_is_multiple()
3487 static int get_app_hwacceleration(const char *appid)
3490 pkgmgrinfo_app_hwacceleration hwacceleration;
3491 pkgmgrinfo_appinfo_h handle;
3492 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3493 if (ret != PMINFO_R_OK)
3495 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3496 if (ret != PMINFO_R_OK) {
3497 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3500 printf("app hwacceleration: %d\n", hwacceleration);
3501 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3506 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3509 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3510 * @brief This API gets the application 'screenreader' value from the app ID
3512 * @par This API is for package-manager client application
3513 * @par Sync (or) Async : Synchronous API
3515 * @param[in] handle pointer to application info handle
3516 * @param[out] screenreader pointer to hold package accessibility value
3517 * @return 0 if success, error code(<0) if fail
3518 * @retval PMINFO_R_OK success
3519 * @retval PMINFO_R_EINVAL invalid argument
3520 * @retval PMINFO_R_ERROR internal error
3521 * @pre pkgmgrinfo_appinfo_get_appinfo()
3522 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3523 * @see pkgmgrinfo_appinfo_get_appid()
3524 * @see pkgmgrinfo_appinfo_is_multiple()
3526 static int get_app_screenreader(const char *appid)
3529 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3530 pkgmgrinfo_appinfo_h handle = NULL;
3531 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3532 if (ret != PMINFO_R_OK)
3534 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3535 if (ret != PMINFO_R_OK) {
3536 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3539 printf("app screenreader: %d\n", screenreader);
3540 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3545 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3548 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3549 * @brief This API gets the application's landscape & portrait effect images
3551 * @par This API is for package-manager client application
3552 * @par Sync (or) Async : Synchronous API
3554 * @param[in] handle pointer to application info handle
3555 * @param[out] portrait_img contains portrait mode effect image
3556 * @param[out] landscape_img contains landscape mode effect image
3557 * @return 0 if success, error code(<0) if fail
3558 * @retval PMINFO_R_OK success
3559 * @retval PMINFO_R_EINVAL invalid argument
3560 * @retval PMINFO_R_ERROR internal error
3561 * @pre pkgmgrinfo_appinfo_get_appinfo()
3562 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3563 * @see pkgmgrinfo_appinfo_get_appid()
3564 * @see pkgmgrinfo_appinfo_is_nodisplay()
3566 static int get_app_effectimages(const char *appid)
3569 char *portraitimg = NULL;
3570 char *landscapeimg = NULL;
3571 pkgmgrinfo_appinfo_h handle;
3572 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3573 if (ret != PMINFO_R_OK)
3575 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3576 if (ret != PMINFO_R_OK) {
3577 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3580 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3581 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3586 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3589 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3590 * @brief This API gets the application's effect image type
3592 * @par This API is for package-manager client application
3593 * @par Sync (or) Async : Synchronous API
3595 * @param[in] handle pointer to application info handle
3596 * @param[out] effectimg_type contains effect image type
3597 * @return 0 if success, error code(<0) if fail
3598 * @retval PMINFO_R_OK success
3599 * @retval PMINFO_R_EINVAL invalid argument
3600 * @retval PMINFO_R_ERROR internal error
3601 * @pre pkgmgrinfo_appinfo_get_appinfo()
3602 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3603 * @see pkgmgrinfo_appinfo_get_appid()
3604 * @see pkgmgrinfo_appinfo_is_nodisplay()
3606 static int get_app_effectimage_type(const char *appid)
3609 char *effectimg_type = NULL;
3610 pkgmgrinfo_appinfo_h handle = NULL;
3611 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3612 if (ret != PMINFO_R_OK)
3614 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3615 if (ret != PMINFO_R_OK) {
3616 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3619 printf("app effect image type: %s\n", effectimg_type);
3620 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3625 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3628 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3629 * @brief This API gets the submode_mainid of the application
3631 * @par This API is for package-manager client application
3632 * @par Sync (or) Async : Synchronous API
3634 * @param[in] handle pointer to the application info handle.
3635 * @param[out] submode_mainid pointer to hold package name
3636 * @return 0 if success, error code(<0) if fail
3637 * @retval PMINFO_R_OK success
3638 * @retval PMINFO_R_EINVAL invalid argument
3639 * @retval PMINFO_R_ERROR internal error
3640 * @pre pkgmgrinfo_appinfo_get_appinfo()
3641 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3642 * @see pkgmgrinfo_appinfo_get_appid()
3643 * @see pkgmgrinfo_appinfo_is_multiple()
3645 static int get_app_submode_mainid(const char *appid)
3648 char *submode_mainid = NULL;
3649 pkgmgrinfo_appinfo_h handle = NULL;
3650 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3651 if (ret != PMINFO_R_OK)
3653 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3654 if (ret != PMINFO_R_OK) {
3655 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3658 printf("submode_mainid: %s\n", submode_mainid);
3659 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3664 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3667 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3668 * @brief This API gets the datacontrol info
3670 * @par This API is for package-manager client application
3671 * @par Sync (or) Async : Synchronous API
3673 * @param[in] providerid pointer to the providerid of dataconltrol.
3674 * @param[in] type pointer to the type of dataconltrol.
3675 * @param[out] appid pointer to hold appid, need to free after using
3676 * @param[out] access pointer to hold access, need to free after using
3677 * @return 0 if success, error code(<0) if fail
3678 * @retval PMINFO_R_OK success
3679 * @retval PMINFO_R_EINVAL invalid argument
3680 * @retval PMINFO_R_ERROR internal error
3683 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3684 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3687 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3688 * @brief This API gets the appid of datacontrol
3690 * @par This API is for package-manager client application
3691 * @par Sync (or) Async : Synchronous API
3693 * @param[in] providerid pointer to the providerid of dataconltrol.
3694 * @param[out] appid pointer to hold appid, need to free after using
3695 * @return 0 if success, error code(<0) if fail
3696 * @retval PMINFO_R_OK success
3697 * @retval PMINFO_R_EINVAL invalid argument
3698 * @retval PMINFO_R_ERROR internal error
3701 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3702 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3705 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3706 * @brief This API gets the information about trusted datacontrol
3708 * @par This API is for package-manager client application
3709 * @par Sync (or) Async : Synchronous API
3711 * @param[in] providerid pointer to the providerid of datacontrol.
3712 * @param[out] appid pointer to hold appid, need to free after using
3713 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3714 * @return 0 if success, error code(<0) if fail
3715 * @retval PMINFO_R_OK success
3716 * @retval PMINFO_R_EINVAL invalid argument
3717 * @retval PMINFO_R_ERROR internal error
3720 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3721 const char *type, char **appid, bool *is_trusted);
3722 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3723 const char *type, uid_t uid, char **appid, bool *is_trusted);
3726 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3727 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3728 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3730 * @par This API is for package-manager client application
3731 * @par Sync (or) Async : Synchronous API
3733 * @param[in] providerid pointer to the providerid of datacontrol.
3734 * @param[in] type pointer to the type of dataconltrol.
3735 * @param[in] privilege_func callback function for list
3736 * @param[in] user_data user data to be passed to callback function
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
3742 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3743 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3744 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3745 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3748 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3749 * @brief This API gets the alias_appid of the application
3751 * @par This API is for package-manager client application
3752 * @par Sync (or) Async : Synchronous API
3754 * @param[in] handle pointer to the application info handle.
3755 * @param[out] alias_appid pointer to hold app alias_appid
3756 * @return 0 if success, error code(<0) if fail
3757 * @retval PMINFO_R_OK success
3758 * @retval PMINFO_R_EINVAL invalid argument
3759 * @retval PMINFO_R_ERROR internal error
3760 * @pre pkgmgrinfo_appinfo_get_appinfo()
3761 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3762 * @see pkgmgrinfo_appinfo_get_appid()
3764 static int get_alias_appid(const char *appid)
3767 char *alias_appid= 0;
3768 pkgmgrinfo_appinfo_h handle = NULL;
3769 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3770 if (ret != PMINFO_R_OK)
3772 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3773 if (ret != PMINFO_R_OK) {
3774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3777 printf("alias_appid: %s\n", alias_appid);
3778 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3783 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3786 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3787 * @brief This API gets the effective_appid of the application
3789 * @par This API is for package-manager client application
3790 * @par Sync (or) Async : Synchronous API
3792 * @param[in] handle pointer to the application info handle.
3793 * @param[out] effective_appid pointer to hold app effective_appid
3794 * @return 0 if success, error code(<0) if fail
3795 * @retval PMINFO_R_OK success
3796 * @retval PMINFO_R_EINVAL invalid argument
3797 * @retval PMINFO_R_ERROR internal error
3798 * @pre pkgmgrinfo_appinfo_get_appinfo()
3799 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3800 * @see pkgmgrinfo_appinfo_get_appid()
3802 static int get_effective_appid(const char *appid)
3805 char *effective_appid= 0;
3806 pkgmgrinfo_appinfo_h handle = NULL;
3807 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3808 if (ret != PMINFO_R_OK)
3810 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3811 if (ret != PMINFO_R_OK) {
3812 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3815 printf("effective_appid: %s\n", effective_appid);
3816 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3821 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3824 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3825 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3827 * @par This API is for package-manager client application
3828 * @par Sync (or) Async : Synchronous API
3830 * @param[in] handle pointer to the appinfo handle.
3831 * @param[out] tep_name pointer to hold tep name
3832 * @return 0 if success, error code(<0) if fail
3833 * @retval PMINFO_R_OK success
3834 * @retval PMINFO_R_EINVAL invalid argument
3835 * @retval PMINFO_R_ERROR internal error
3836 * @pre pkgmgrinfo_appinfo_get_appinfo()
3837 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3838 * @see pkgmgrinfo_appinfo_get_appid()
3840 static int get_tep_name(const char *appid)
3843 char *tep_name = NULL;
3844 pkgmgrinfo_appinfo_h handle = NULL;
3845 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3846 if (ret != PMINFO_R_OK)
3848 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3849 if (ret != PMINFO_R_OK) {
3850 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3853 printf("TEP name is: %s\n", tep_name);
3854 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3859 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3862 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3863 * @brief This API gets zip mount file name associated with the package which contain given application
3864 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3866 * @par This API is for package-manager client application
3867 * @par Sync (or) Async : Synchronous API
3869 * @param[in] handle pointer to the appinfo handle.
3870 * @param[out] zip_mount_file pointer to hold zip mount file name
3871 * @return 0 if success, error code(<0) if fail
3872 * @retval PMINFO_R_OK success
3873 * @retval PMINFO_R_EINVAL invalid argument
3874 * @retval PMINFO_R_ERROR internal error
3875 * @pre pkgmgrinfo_appinfo_get_appinfo()
3876 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3877 * @see pkgmgrinfo_appinfo_get_appid()
3879 static int get_zip_mount_file(const char *appid)
3882 char *zip_mount_file = NULL;
3883 pkgmgrinfo_appinfo_h handle = NULL;
3884 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3885 if (ret != PMINFO_R_OK)
3887 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3888 if (ret != PMINFO_R_OK) {
3889 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3892 printf("Mount file name is: %s\n", zip_mount_file);
3893 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3898 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3901 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3902 * @brief This API gets the root path of application
3904 * @par Sync (or) Async : Synchronous API
3906 * @param[in] handle pointer to appinfo handle
3907 * @param[out] path pointer to hold root path of application
3908 * @return 0 if success, error code(<0) if fail
3909 * @retval PMINFO_R_OK success
3910 * @retval PMINFO_R_EINVAL invalid argument
3911 * @retval PMINFO_R_ERROR internal error
3913 static int get_root_path(const char *appid)
3917 pkgmgrinfo_appinfo_h handle;
3918 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3919 if (ret != PMINFO_R_OK)
3922 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3923 if (ret != PMINFO_R_OK) {
3924 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3927 printf("path : %s\n", path);
3928 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3934 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3937 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3938 * @brief This API gets the application api_version from the application ID
3940 * @par This API is for package-manager client application
3941 * @par Sync (or) Async : Synchronous API
3943 * @param[in] handle pointer to appinfo handle
3944 * @param[out] api_version pointer to hold application api_version
3945 * @return 0 if success, error code(<0) if fail
3946 * @retval PMINFO_R_OK success
3947 * @retval PMINFO_R_EINVAL invalid argument
3948 * @retval PMINFO_R_ERROR internal error
3949 * @pre pkgmgrinfo_appinfo_get_appinfo()
3950 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3951 * @see pkgmgrinfo_appinfo_get_appid()
3953 static int get_app_api_version(const char *appid)
3956 char *api_version = NULL;
3957 pkgmgrinfo_appinfo_h handle = NULL;
3958 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3959 if (ret != PMINFO_R_OK)
3961 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3962 if (ret != PMINFO_R_OK) {
3963 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3966 printf("app api_version: %s\n", api_version);
3967 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3972 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3975 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3976 * @brief This API gets the installed_time of the application
3978 * @par This API is for package-manager client application
3979 * @par Sync (or) Async : Synchronous API
3981 * @param[in] handle pointer to the application info handle.
3982 * @param[out] installed_time pointer to hold installed_time
3983 * @return 0 if success, error code(<0) if fail
3984 * @retval PMINFO_R_OK success
3985 * @retval PMINFO_R_EINVAL invalid argument
3986 * @retval PMINFO_R_ERROR internal error
3987 * @pre pkgmgrinfo_appinfo_get_appinfo()
3988 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3989 * @see pkgmgrinfo_appinfo_get_appid()
3990 * @see pkgmgrinfo_appinfo_is_multiple()
3992 static int get_app_installed_time(const char *appid)
3995 int installed_time = 0;
3996 pkgmgrinfo_appinfo_h handle = NULL;
3997 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3998 if (ret != PMINFO_R_OK)
4000 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4001 if (ret != PMINFO_R_OK) {
4002 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4005 printf("installed_time: %d\n", installed_time);
4006 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4011 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4014 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4015 * @brief This API gets the support_mode of the application
4017 * @par This API is for package-manager client application
4018 * @par Sync (or) Async : Synchronous API
4020 * @param[in] handle pointer to the application info handle.
4021 * @param[out] support_mode pointer to hold app support_mode
4022 * @return 0 if success, error code(<0) if fail
4023 * @retval PMINFO_R_OK success
4024 * @retval PMINFO_R_EINVAL invalid argument
4025 * @retval PMINFO_R_ERROR internal error
4026 * @pre pkgmgrinfo_appinfo_get_appinfo()
4027 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4028 * @see pkgmgrinfo_appinfo_get_appid()
4030 static int get_app_support_mode(const char *appid)
4033 int support_mode = 0;
4034 pkgmgrinfo_appinfo_h handle = NULL;
4035 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4036 if (ret != PMINFO_R_OK)
4038 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4039 if (ret != PMINFO_R_OK) {
4040 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4043 printf("support_mode: %s\n", support_mode);
4044 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4049 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4053 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4054 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4055 * @brief This API gets the list of category for a particular application
4057 * @par This API is for package-manager client application
4058 * @par Sync (or) Async : Synchronous API
4059 * @param[in] handle pointer to the application info handle.
4060 * @param[in] category_func callback function for list
4061 * @param[in] user_data user data to be passed to callback function
4062 * @return 0 if success, error code(<0) if fail
4063 * @retval PMINFO_R_OK success
4064 * @retval PMINFO_R_EINVAL invalid argument
4065 * @retval PMINFO_R_ERROR internal error
4066 * @pre pkgmgrinfo_appinfo_get_appinfo()
4067 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4069 int category_func(const char *name, void *user_data)
4071 if (strcmp(name, (char *)user_data) == 0)
4077 static int list_category(const char *appid, char *category)
4080 pkgmgrinfo_appinfo_h handle;
4081 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4082 if (ret != PMINFO_R_OK)
4084 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4085 if (ret != PMINFO_R_OK) {
4086 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4089 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4094 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4095 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4098 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4099 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4100 * @brief This API gets the list of metadata for a particular application
4102 * @par This API is for package-manager client application
4103 * @par Sync (or) Async : Synchronous API
4104 * @param[in] handle pointer to the application info handle.
4105 * @param[in] metadata_func callback function for list
4106 * @param[in] user_data user data to be passed to callback function
4107 * @return 0 if success, error code(<0) if fail
4108 * @retval PMINFO_R_OK success
4109 * @retval PMINFO_R_EINVAL invalid argument
4110 * @retval PMINFO_R_ERROR internal error
4111 * @pre pkgmgrinfo_appinfo_get_appinfo()
4112 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4114 int metadata_func(const char *key, const char *value, void *user_data)
4116 if (strcmp(key, (char *)user_data) == 0) {
4117 printf("Value is %s\n", value);
4124 static int list_metadata(const char *appid, char *key)
4127 pkgmgrinfo_appinfo_h handle;
4128 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4129 if (ret != PMINFO_R_OK)
4131 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4132 if (ret != PMINFO_R_OK) {
4133 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4136 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4141 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4142 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4145 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4146 * const char *operation,
4147 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4149 * @brief This API gets the list of privileges for a particular
4150 * appllication's app_control
4152 * @par This API is for package-manager client application
4153 * @par Sync (or) Async : Synchronous API
4154 * @param[in] appid application id
4155 * @param[in] operation operation of appcontrol
4156 * @param[in] privilege_func callback function for list
4157 * @param[in] user_data user data to be passed to callback function
4158 * @return 0 if success, error code(<0) if fail
4159 * @retval PMINFO_R_OK success
4160 * @retval PMINFO_R_EINVAL invalid argument
4161 * @retval PMINFO_R_ERROR internal error
4163 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4164 const char *operation,
4165 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4166 void *user_data, uid_t uid);
4167 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4168 const char *operation,
4169 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4173 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4174 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4175 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4176 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4177 * @brief This API gets the list of app-control for a particular application
4179 * @par This API is for package-manager client application
4180 * @par Sync (or) Async : Synchronous API
4181 * @param[in] handle pointer to the application info handle.
4182 * @param[in] appcontrol_func callback function for list
4183 * @param[in] user_data user data to be passed to callback function
4184 * @param[in] uid the addressee user id of the instruction
4185 * @return 0 if success, error code(<0) if fail
4186 * @retval PMINFO_R_OK success
4187 * @retval PMINFO_R_EINVAL invalid argument
4188 * @retval PMINFO_R_ERROR internal error
4189 * @pre pkgmgrinfo_appinfo_get_appinfo()
4190 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4192 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4196 char *compare_data = (char *)user_data;
4197 if (strcmp(operation, compare_data) == 0)
4203 static int check_operation(const char *appid, char *operation)
4206 pkgmgrinfo_appinfo_h handle;
4207 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4208 if (ret != PMINFO_R_OK)
4210 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4211 if (ret != PMINFO_R_OK) {
4212 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4220 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4221 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4223 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4224 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4229 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4230 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4233 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4234 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4235 * @brief This API gets the list of splashscreen for a particular application
4237 * @par This API is for package-manager client application
4238 * @par Sync (or) Async : Synchronous API
4239 * @param[in] handle pointer to the application info handle.
4240 * @param[in] splash_screen_func callback function for list
4241 * @param[in] user_data user data to be passed to callback function
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()
4250 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4251 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4254 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4255 * @brief This API gets the application 'nodisplay' value from the app ID
4257 * @par This API is for package-manager client application
4258 * @par Sync (or) Async : Synchronous API
4260 * @param[in] handle pointer to application info handle
4261 * @param[out] nodisplay pointer to hold package nodisplay value
4262 * @return 0 if success, error code(<0) if fail
4263 * @retval PMINFO_R_OK success
4264 * @retval PMINFO_R_EINVAL invalid argument
4265 * @retval PMINFO_R_ERROR internal error
4266 * @pre pkgmgrinfo_appinfo_get_appinfo()
4267 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4268 * @see pkgmgrinfo_appinfo_get_appid()
4269 * @see pkgmgrinfo_appinfo_is_multiple()
4271 static int get_app_nodisplay(const char *appid)
4275 pkgmgrinfo_appinfo_h handle;
4276 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4277 if (ret != PMINFO_R_OK)
4279 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4280 if (ret != PMINFO_R_OK) {
4281 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4284 printf("app nodisplay: %d\n", nodisplay);
4285 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4290 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4293 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4294 * @brief This API gets the application 'multiple' value from the app ID
4296 * @par This API is for package-manager client application
4297 * @par Sync (or) Async : Synchronous API
4299 * @param[in] handle pointer to application info handle
4300 * @param[out] multiple pointer to hold package multiple value
4301 * @return 0 if success, error code(<0) if fail
4302 * @retval PMINFO_R_OK success
4303 * @retval PMINFO_R_EINVAL invalid argument
4304 * @retval PMINFO_R_ERROR internal error
4305 * @pre pkgmgrinfo_appinfo_get_appinfo()
4306 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4307 * @see pkgmgrinfo_appinfo_get_appid()
4308 * @see pkgmgrinfo_appinfo_is_nodisplay()
4310 static int get_app_multiple(const char *appid)
4314 pkgmgrinfo_appinfo_h handle;
4315 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4316 if (ret != PMINFO_R_OK)
4318 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4319 if (ret != PMINFO_R_OK) {
4320 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4323 printf("app multiple: %d\n", multiple);
4324 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4329 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4332 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4333 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4334 * application launching effect. If fales, indicator will be hidden during application launching effect
4336 * @par This API is for package-manager client application
4337 * @par Sync (or) Async : Synchronous API
4339 * @param[in] handle pointer to application info handle
4340 * @param[out] indicator_disp contains indicator display status for application launching effect
4341 * @return 0 if success, error code(<0) if fail
4342 * @retval PMINFO_R_OK success
4343 * @retval PMINFO_R_EINVAL invalid argument
4344 * @retval PMINFO_R_ERROR internal error
4345 * @pre pkgmgrinfo_appinfo_get_appinfo()
4346 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4347 * @see pkgmgrinfo_appinfo_get_appid()
4348 * @see pkgmgrinfo_appinfo_is_nodisplay()
4350 static int get_app_indicator_display(const char *appid)
4353 bool indicator_disp;
4354 pkgmgrinfo_appinfo_h handle;
4355 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4356 if (ret != PMINFO_R_OK)
4358 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4359 if (ret != PMINFO_R_OK){
4360 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4363 printf("app indicator disp : %d\n", indicator_disp);
4364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4369 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4372 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4373 * @brief This API gets the application 'taskmanage' value from the app ID
4375 * @par This API is for package-manager client application
4376 * @par Sync (or) Async : Synchronous API
4378 * @param[in] handle pointer to application info handle
4379 * @param[out] taskmanage pointer to hold package taskmanage value
4380 * @return 0 if success, error code(<0) if fail
4381 * @retval PMINFO_R_OK success
4382 * @retval PMINFO_R_EINVAL invalid argument
4383 * @retval PMINFO_R_ERROR internal error
4384 * @pre pkgmgrinfo_appinfo_get_appinfo()
4385 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4386 * @see pkgmgrinfo_appinfo_get_appid()
4387 * @see pkgmgrinfo_appinfo_is_multiple()
4389 static int get_app_taskmanage(const char *appid)
4393 pkgmgrinfo_appinfo_h handle;
4394 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4395 if (ret != PMINFO_R_OK)
4397 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4398 if (ret != PMINFO_R_OK) {
4399 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4402 printf("app taskmanage: %d\n", taskmanage);
4403 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4408 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4411 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4412 * @brief This API gets the application 'taskmanage' value from the app ID
4414 * @par This API is for package-manager client application
4415 * @par Sync (or) Async : Synchronous API
4417 * @param[in] handle pointer to application info handle
4418 * @param[out] enabled pointer to hold package enabled value
4419 * @return 0 if success, error code(<0) if fail
4420 * @retval PMINFO_R_OK success
4421 * @retval PMINFO_R_EINVAL invalid argument
4422 * @retval PMINFO_R_ERROR internal error
4423 * @pre pkgmgrinfo_appinfo_get_appinfo()
4424 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4425 * @see pkgmgrinfo_appinfo_get_appid()
4426 * @see pkgmgrinfo_appinfo_is_multiple()
4428 static int get_app_enabled(const char *appid)
4432 pkgmgrinfo_appinfo_h handle;
4433 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4434 if (ret != PMINFO_R_OK)
4436 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4437 if (ret != PMINFO_R_OK) {
4438 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4441 printf("app enabled: %d\n", enabled);
4442 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4447 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4450 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4451 * @brief This API gets the application 'onboot' value from the app ID
4453 * @par This API is for package-manager client application
4454 * @par Sync (or) Async : Synchronous API
4456 * @param[in] handle pointer to application info handle
4457 * @param[out] onboot pointer to hold package onboot value
4458 * @return 0 if success, error code(<0) if fail
4459 * @retval PMINFO_R_OK success
4460 * @retval PMINFO_R_EINVAL invalid argument
4461 * @retval PMINFO_R_ERROR internal error
4462 * @pre pkgmgrinfo_appinfo_get_appinfo()
4463 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4464 * @see pkgmgrinfo_appinfo_get_appid()
4465 * @see pkgmgrinfo_appinfo_is_multiple()
4467 static int get_app_onboot(const char *appid)
4471 pkgmgrinfo_appinfo_h handle;
4472 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4473 if (ret != PMINFO_R_OK)
4475 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4476 if (ret != PMINFO_R_OK) {
4477 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4480 printf("app onboot: %d\n", onboot);
4481 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4486 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4489 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4490 * @brief This API gets the application 'autorestart' value from the app ID
4492 * @par This API is for package-manager client application
4493 * @par Sync (or) Async : Synchronous API
4495 * @param[in] handle pointer to application info handle
4496 * @param[out] autorestart pointer to hold package autorestart value
4497 * @return 0 if success, error code(<0) if fail
4498 * @retval PMINFO_R_OK success
4499 * @retval PMINFO_R_EINVAL invalid argument
4500 * @retval PMINFO_R_ERROR internal error
4501 * @pre pkgmgrinfo_appinfo_get_appinfo()
4502 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4503 * @see pkgmgrinfo_appinfo_get_appid()
4504 * @see pkgmgrinfo_appinfo_is_multiple()
4506 static int get_app_autorestart(const char *appid)
4510 pkgmgrinfo_appinfo_h handle;
4511 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4512 if (ret != PMINFO_R_OK)
4514 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4515 if (ret != PMINFO_R_OK) {
4516 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4519 printf("app autorestart: %d\n", autorestart);
4520 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4525 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4528 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4529 * @brief This API gets the value for given application is main app or not from handle
4531 * @par This API is for package-manager client application
4532 * @par Sync (or) Async : Synchronous API
4534 * @param[in] handle pointer to application info handle
4535 * @param[out] mainapp pointer to hold package mainapp is or not
4536 * @return 0 if success, error code(<0) if fail
4537 * @retval PMINFO_R_OK success
4538 * @retval PMINFO_R_EINVAL invalid argument
4539 * @retval PMINFO_R_ERROR internal error
4540 * @pre pkgmgrinfo_appinfo_get_appinfo()
4541 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4542 * @see pkgmgrinfo_appinfo_get_appid()
4543 * @see pkgmgrinfo_appinfo_is_multiple()
4545 static int get_app_mainapp(const char *appid)
4549 pkgmgrinfo_appinfo_h handle;
4550 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4551 if (ret != PMINFO_R_OK)
4553 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4554 if (ret != PMINFO_R_OK) {
4555 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4558 printf("mainapp: %d\n", mainapp);
4559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4564 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4568 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4569 * @brief This API gets the value for given application is preload or not from handle
4571 * @par This API is for package-manager client application
4572 * @par Sync (or) Async : Synchronous API
4574 * @param[in] handle pointer to application info handle
4575 * @param[out] preload pointer to hold preload is or not
4576 * @return 0 if success, error code(<0) if fail
4577 * @retval PMINFO_R_OK success
4578 * @retval PMINFO_R_EINVAL invalid argument
4579 * @retval PMINFO_R_ERROR internal error
4580 * @pre pkgmgrinfo_appinfo_get_appinfo()
4581 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4582 * @see pkgmgrinfo_appinfo_get_appid()
4583 * @see pkgmgrinfo_appinfo_is_multiple()
4585 static int get_app_preload(const char *appid)
4589 pkgmgrinfo_appinfo_h handle = NULL;
4590 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4591 if (ret != PMINFO_R_OK)
4593 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4594 if (ret != PMINFO_R_OK) {
4595 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4598 printf("preload: %d\n", preload);
4599 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4604 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4607 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4608 * @brief This API gets the value for given application is submode or not from handle
4610 * @par This API is for package-manager client application
4611 * @par Sync (or) Async : Synchronous API
4613 * @param[in] handle pointer to application info handle
4614 * @param[out] submode pointer to hold submode is or not
4615 * @return 0 if success, error code(<0) if fail
4616 * @retval PMINFO_R_OK success
4617 * @retval PMINFO_R_EINVAL invalid argument
4618 * @retval PMINFO_R_ERROR internal error
4619 * @pre pkgmgrinfo_appinfo_get_appinfo()
4620 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4621 * @see pkgmgrinfo_appinfo_get_appid()
4622 * @see pkgmgrinfo_appinfo_is_multiple()
4624 static int get_app_submode(const char *appid)
4628 pkgmgrinfo_appinfo_h handle = NULL;
4629 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4630 if (ret != PMINFO_R_OK)
4632 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4633 if (ret != PMINFO_R_OK) {
4634 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4637 printf("submode: %d\n", submode);
4638 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4643 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4646 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4647 * @brief This API gets the value for given application is process_pool or not from handle
4649 * @par This API is for package-manager client application
4650 * @par Sync (or) Async : Synchronous API
4652 * @param[in] handle pointer to application info handle
4653 * @param[out] process_pool pointer to hold process_pool is or not
4654 * @return 0 if success, error code(<0) if fail
4655 * @retval PMINFO_R_OK success
4656 * @retval PMINFO_R_EINVAL invalid argument
4657 * @retval PMINFO_R_ERROR internal error
4658 * @pre pkgmgrinfo_appinfo_get_appinfo()
4659 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4660 * @see pkgmgrinfo_appinfo_get_appid()
4662 static int get_app_process_pool(const char *appid)
4665 bool process_pool = 0;
4666 pkgmgrinfo_appinfo_h handle = NULL;
4667 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4668 if (ret != PMINFO_R_OK)
4670 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4671 if (ret != PMINFO_R_OK) {
4672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4675 printf("process_pool: %d\n", process_pool);
4676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4681 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4684 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4685 * @brief This API gets the installed storage location of the application
4687 * @par This API is for package-manager client application
4688 * @par Sync (or) Async : Synchronous API
4690 * @param[in] handle pointer to the application info handle.
4691 * @param[out] app_type pointer to hold installed storage location
4692 * @return 0 if success, error code(<0) if fail
4693 * @retval PMINFO_R_OK success
4694 * @retval PMINFO_R_EINVAL invalid argument
4695 * @retval PMINFO_R_ERROR internal error
4696 * @pre pkgmgrinfo_appinfo_get_appinfo()
4697 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4698 * @see pkgmgrinfo_appinfo_get_appid()
4700 static int get_app_installed_location(const char *appid)
4703 pkgmgrinfo_installed_storage storage;
4704 pkgmgrinfo_appinfo_h handle = NULL;
4705 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4706 if (ret != PMINFO_R_OK)
4708 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4709 if (ret != PMINFO_R_OK) {
4710 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4713 printf("Installed storage location : %d\n", storage);
4714 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4719 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4723 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4724 * @brief This API checks if the application has the given category
4726 * @par This API is for package-manager client application
4727 * @par Sync (or) Async : Synchronous API
4729 * @param[in] handle pointer to the application info handle
4730 * @param[in] category category
4731 * @param[out] exist value Gets whether the application has the given category
4732 * @return 0 if success, error code(<0) if fail
4733 * @retval PMINFO_R_OK success
4734 * @retval PMINFO_R_EINVAL invalid argument
4735 * @retval PMINFO_R_ERROR internal error
4737 static int is_category_exist(const char *appid, const char *category)
4740 pkgmgrinfo_appinfo_h handle;
4743 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4744 if (ret != PMINFO_R_OK)
4747 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4748 if (ret != PMINFO_R_OK) {
4749 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4753 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4758 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4761 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4762 * @brief This API gets the application 'ui_gadget' value from the app ID
4764 * @par This API is for package-manager client application
4765 * @par Sync (or) Async : Synchronous API
4767 * @param[in] handle pointer to application info handle
4768 * @param[out] ui_gadget pointer to hold package ui_gadget value
4769 * @return 0 if success, error code(<0) if fail
4770 * @retval PMINFO_R_OK success
4771 * @retval PMINFO_R_EINVAL invalid argument
4772 * @pre pkgmgrinfo_appinfo_get_appinfo()
4773 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4775 static int get_app_ui_gadget(const char *appid)
4779 pkgmgrinfo_appinfo_h handle = NULL;
4780 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4781 if (ret != PMINFO_R_OK)
4783 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4784 if (ret != PMINFO_R_OK) {
4785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4788 printf("app ui_gadget: %d\n", ui_gadget);
4789 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4794 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4797 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4798 * @brief This API gets the application 'support_disable' value from the app ID
4800 * @par This API is for package-manager client application
4801 * @par Sync (or) Async : Synchronous API
4803 * @param[in] handle pointer to application info handle
4804 * @param[out] support_disable pointer to hold package support_disable value
4805 * @return 0 if success, error code(<0) if fail
4806 * @retval PMINFO_R_OK success
4807 * @retval PMINFO_R_EINVAL invalid argument
4808 * @pre pkgmgrinfo_appinfo_get_appinfo()
4809 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4811 static int get_app_support_disable(const char *appid)
4814 bool support_disable;
4815 pkgmgrinfo_appinfo_h handle = NULL;
4816 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4817 if (ret != PMINFO_R_OK)
4819 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4820 if (ret != PMINFO_R_OK) {
4821 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4824 printf("app support_disable: %d\n", support_disable);
4825 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4830 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4833 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4834 * @brief This API gets the application 'removable' value from the app ID
4836 * @par This API is for package-manager client application
4837 * @par Sync (or) Async : Synchronous API
4839 * @param[in] handle pointer to application info handle
4840 * @param[out] removable pointer to hold package removable value
4841 * @return 0 if success, error code(<0) if fail
4842 * @retval PMINFO_R_OK success
4843 * @retval PMINFO_R_EINVAL invalid argument
4844 * @retval PMINFO_R_ERROR internal error
4845 * @pre pkgmgrinfo_appinfo_get_appinfo()
4846 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4847 * @see pkgmgrinfo_appinfo_get_appid()
4849 static int get_app_removable(const char *appid)
4853 pkgmgrinfo_appinfo_h handle = NULL;
4854 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4855 if (ret != PMINFO_R_OK)
4857 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4858 if (ret != PMINFO_R_OK) {
4859 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4862 printf("app removable: %d\n", removable);
4863 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4868 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4871 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4872 * @brief This API gets the application 'system' value from the app ID
4874 * @par This API is for package-manager client application
4875 * @par Sync (or) Async : Synchronous API
4877 * @param[in] handle pointer to application info handle
4878 * @param[out] system pointer to hold package system value
4879 * @return 0 if success, error code(<0) if fail
4880 * @retval PMINFO_R_OK success
4881 * @retval PMINFO_R_EINVAL invalid argument
4882 * @retval PMINFO_R_ERROR internal error
4883 * @pre pkgmgrinfo_appinfo_get_appinfo()
4884 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4885 * @see pkgmgrinfo_appinfo_get_appid()
4887 static int get_app_system(const char *appid)
4890 bool system = false;
4891 pkgmgrinfo_appinfo_h handle = NULL;
4892 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4893 if (ret != PMINFO_R_OK)
4895 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4896 if (ret != PMINFO_R_OK) {
4897 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4900 printf("app system: %d\n", system);
4901 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4906 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4910 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4911 * @brief This API gets the application 'is_disable' value from the app ID
4913 * @par This API is for package-manager client application
4914 * @par Sync (or) Async : Synchronous API
4916 * @param[in] handle pointer to application info handle
4917 * @param[out] disabled pointer to hold application is_disabled value
4918 * @return 0 if success, error code(<0) if fail
4919 * @retval PMINFO_R_OK success
4920 * @retval PMINFO_R_EINVAL invalid argument
4921 * @pre pkgmgrinfo_appinfo_get_appinfo()
4922 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4924 static int get_app_is_disable(const char *appid)
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_disabled(handle, &is_disable);
4933 if (ret != PMINFO_R_OK) {
4934 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4937 printf("app is_disable: %d\n", is_disable);
4938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4943 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4946 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4947 * @brief This API gets whether the given application is global application or user application
4949 * @par This API is for package-manager client application
4950 * @par Sync (or) Async : Synchronous API
4952 * @param[in] handle pointer to application info handle
4953 * @param[in] global pointer to hold application global value
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()
4961 static int get_app_is_global(const char *appid)
4965 pkgmgrinfo_appinfo_h handle = NULL;
4966 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4967 if (ret != PMINFO_R_OK)
4969 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4970 if (ret != PMINFO_R_OK) {
4971 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4974 printf("app is_global: %d\n", global);
4975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4980 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4983 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4984 * @brief This API gets the application 'splash_screen_display' value from the app ID
4986 * @par This API is for package-manager client application
4987 * @par Sync (or) Async : Synchronous API
4989 * @param[in] handle pointer to application info handle
4990 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4991 * @return 0 if success, error code(<0) if fail
4992 * @retval PMINFO_R_OK success
4993 * @retval PMINFO_R_EINVAL invalid argument
4994 * @retval PMINFO_R_ERROR internal error
4996 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4999 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5000 * @brief This API gets the application 'setup_appid' value from the app ID
5002 * @par This API is for package-manager client application
5003 * @par Sync (or) Async : Synchronous API
5005 * @param[in] handle pointer to application info handle
5006 * @param[out] setup_appid pointer to hold package setup_appid value
5007 * @return 0 if success, error code(<0) if fail
5008 * @retval PMINFO_R_OK success
5009 * @retval PMINFO_R_EINVAL invalid argument
5010 * @retval PMINFO_R_ERROR internal error
5012 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5015 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5016 * @brief This API gets the application 'support_ambient' value from the app ID
5018 * @par This API is for package-manager client application
5019 * @par Sync (or) Async : Synchronous API
5021 * @param[in] handle pointer to application info handle
5022 * @param[out] support_ambient pointer to hold package support_ambient value
5023 * @return 0 if success, error code(<0) if fail
5024 * @retval PMINFO_R_OK success
5025 * @retval PMINFO_R_EINVAL invalid argument
5026 * @retval PMINFO_R_ERROR internal error
5028 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5031 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5032 * @brief This API destroys the application information handle freeing up all the resources
5034 * @par This API is for package-manager client application
5035 * @par Sync (or) Async : Synchronous API
5037 * @param[in] handle pointer to the application info handle.
5038 * @return 0 if success, error code(<0) if fail
5039 * @retval PMINFO_R_OK success
5040 * @retval PMINFO_R_EINVAL invalid argument
5041 * @retval PMINFO_R_ERROR internal error
5042 * @pre pkgmgrinfo_appinfo_get_appinfo()
5044 * @see pkgmgrinfo_appinfo_get_pkgid()
5045 * @see pkgmgrinfo_appinfo_is_multiple()
5047 static int get_app_type(const char *appid)
5051 pkgmgrinfo_appinfo_h handle;
5052 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5053 if (ret != PMINFO_R_OK)
5055 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5056 if (ret != PMINFO_R_OK) {
5057 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5060 printf("apptype: %s\n", type);
5061 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5066 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5069 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5070 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5071 The query will search the entire application information collected from the manifest file of all the installed packages
5073 * @par This API is for package-manager client application
5074 * @par Sync (or) Async : Synchronous API
5076 * @param[out] handle pointer to the application info filter handle.
5077 * @return 0 if success, error code(<0) if fail
5078 * @retval PMINFO_R_OK success
5079 * @retval PMINFO_R_EINVAL invalid argument
5080 * @retval PMINFO_R_ERROR internal error
5082 * @post pkgmgrinfo_appinfo_filter_destroy()
5083 * @see pkgmgrinfo_appinfo_filter_count()
5084 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5086 static int get_capp_count()
5090 pkgmgrinfo_appinfo_filter_h handle;
5091 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5092 if (ret != PMINFO_R_OK)
5094 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5095 if (ret != PMINFO_R_OK) {
5096 pkgmgrinfo_appinfo_filter_destroy(handle);
5099 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5100 if (ret != PMINFO_R_OK) {
5101 pkgmgrinfo_appinfo_filter_destroy(handle);
5104 printf("No of capp: %d\n", count);
5105 pkgmgrinfo_appinfo_filter_destroy(handle);
5110 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5113 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5114 * @brief This API destroys the application information filter handle freeing up all the resources
5116 * @par This API is for package-manager client application
5117 * @par Sync (or) Async : Synchronous API
5119 * @param[in] handle pointer to the application info filter handle.
5120 * @return 0 if success, error code(<0) if fail
5121 * @retval PMINFO_R_OK success
5122 * @retval PMINFO_R_EINVAL invalid argument
5123 * @retval PMINFO_R_ERROR internal error
5124 * @pre pkgmgrinfo_appinfo_filter_create()
5126 * @see pkgmgrinfo_appinfo_filter_count()
5127 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5129 static int get_capp_count()
5133 pkgmgrinfo_appinfo_filter_h handle;
5134 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5135 if (ret != PMINFO_R_OK)
5137 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5138 if (ret != PMINFO_R_OK) {
5139 pkgmgrinfo_appinfo_filter_destroy(handle);
5142 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5143 if (ret != PMINFO_R_OK) {
5144 pkgmgrinfo_appinfo_filter_destroy(handle);
5147 printf("No of capp: %d\n", count);
5148 pkgmgrinfo_appinfo_filter_destroy(handle);
5153 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5156 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5157 * @brief This API adds a boolean filter property to the filter handle
5159 * @par This API is for package-manager client application
5160 * @par Sync (or) Async : Synchronous API
5162 * @param[in] handle pointer to the application info filter handle.
5163 * @param[in] property boolean property name.
5164 * @param[in] value value corresponding to the property.
5165 * @return 0 if success, error code(<0) if fail
5166 * @retval PMINFO_R_OK success
5167 * @retval PMINFO_R_EINVAL invalid argument
5168 * @retval PMINFO_R_ERROR internal error
5169 * @pre pkgmgrinfo_appinfo_filter_create()
5170 * @post pkgmgrinfo_appinfo_filter_destroy()
5171 * @see pkgmgrinfo_appinfo_filter_count()
5172 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5174 static int get_taskmanageable_app_count()
5178 pkgmgrinfo_appinfo_filter_h handle;
5179 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5180 if (ret != PMINFO_R_OK)
5182 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5183 if (ret != PMINFO_R_OK) {
5184 pkgmgrinfo_appinfo_filter_destroy(handle);
5187 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5188 if (ret != PMINFO_R_OK) {
5189 pkgmgrinfo_appinfo_filter_destroy(handle);
5192 printf("No of taskmanageable apps: %d\n", count);
5193 pkgmgrinfo_appinfo_filter_destroy(handle);
5198 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5199 const char *property, const bool value);
5202 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5203 * @brief This API adds an integer filter property to the filter handle
5205 * @par This API is for package-manager client application
5206 * @par Sync (or) Async : Synchronous API
5208 * @param[in] handle pointer to the application info filter handle.
5209 * @param[in] property integer property name.
5210 * @param[in] value value corresponding to the property.
5211 * @return 0 if success, error code(<0) if fail
5212 * @retval PMINFO_R_OK success
5213 * @retval PMINFO_R_EINVAL invalid argument
5214 * @retval PMINFO_R_ERROR internal error
5215 * @pre pkgmgrinfo_appinfo_filter_create()
5216 * @post pkgmgrinfo_appinfo_filter_destroy()
5217 * @see pkgmgrinfo_appinfo_filter_count()
5218 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5220 static int get_taskmanageable_app_count()
5224 pkgmgrinfo_appinfo_filter_h handle;
5225 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5226 if (ret != PMINFO_R_OK)
5228 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5229 if (ret != PMINFO_R_OK) {
5230 pkgmgrinfo_appinfo_filter_destroy(handle);
5233 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5234 if (ret != PMINFO_R_OK) {
5235 pkgmgrinfo_appinfo_filter_destroy(handle);
5238 printf("No of apps: %d\n", count);
5239 pkgmgrinfo_appinfo_filter_destroy(handle);
5244 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5245 const char *property, const int value);
5248 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5249 * @brief This API adds a string filter property to the filter handle
5251 * @par This API is for package-manager client application
5252 * @par Sync (or) Async : Synchronous API
5254 * @param[in] handle pointer to the application info filter handle.
5255 * @param[in] property string property name.
5256 * @param[in] value value corresponding to the property.
5257 * @return 0 if success, error code(<0) if fail
5258 * @retval PMINFO_R_OK success
5259 * @retval PMINFO_R_EINVAL invalid argument
5260 * @retval PMINFO_R_ERROR internal error
5261 * @pre pkgmgrinfo_appinfo_filter_create()
5262 * @post pkgmgrinfo_appinfo_filter_destroy()
5263 * @see pkgmgrinfo_appinfo_filter_count()
5264 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5266 static int get_capp_count()
5270 pkgmgrinfo_appinfo_filter_h handle;
5271 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5272 if (ret != PMINFO_R_OK)
5274 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5275 if (ret != PMINFO_R_OK) {
5276 pkgmgrinfo_appinfo_filter_destroy(handle);
5279 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5280 if (ret != PMINFO_R_OK) {
5281 pkgmgrinfo_appinfo_filter_destroy(handle);
5284 printf("No of capp: %d\n", count);
5285 pkgmgrinfo_appinfo_filter_destroy(handle);
5290 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5291 const char *property, const char *value);
5294 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5295 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5297 * @par This API is for package-manager client application
5298 * @par Sync (or) Async : Synchronous API
5300 * @param[in] handle pointer to the application info filter handle.
5301 * @param[in] app_cb callback function.
5302 * @param[in] user_data user data to be passed to the callback function
5303 * @return 0 if success, error code(<0) if fail
5304 * @retval PMINFO_R_OK success
5305 * @retval PMINFO_R_EINVAL invalid argument
5306 * @retval PMINFO_R_ERROR internal error
5307 * @pre pkgmgrinfo_appinfo_filter_create()
5308 * @post pkgmgrinfo_appinfo_filter_destroy()
5309 * @see pkgmgrinfo_appinfo_filter_count()
5311 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5314 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5315 printf("appid : %s\n", appid);
5319 static int get_capp_list()
5322 pkgmgrinfo_appinfo_filter_h handle;
5323 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5324 if (ret != PMINFO_R_OK)
5326 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5327 if (ret != PMINFO_R_OK) {
5328 pkgmgrinfo_appinfo_filter_destroy(handle);
5331 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5332 if (ret != PMINFO_R_OK) {
5333 pkgmgrinfo_appinfo_filter_destroy(handle);
5336 pkgmgrinfo_appinfo_filter_destroy(handle);
5341 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5342 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5343 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5344 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5347 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5348 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5349 * @brief This API counts the application that satisfy the filter conditions
5351 * @par This API is for package-manager client application
5352 * @par Sync (or) Async : Synchronous API
5354 * @param[in] handle pointer to the application info filter handle.
5355 * @param[in] count pointer to store count value
5356 * @param[in] uid the addressee user id of the instruction
5357 * @return 0 if success, error code(<0) if fail
5358 * @retval PMINFO_R_OK success
5359 * @retval PMINFO_R_EINVAL invalid argument
5360 * @retval PMINFO_R_ERROR internal error
5361 * @pre pkgmgrinfo_appinfo_filter_create()
5362 * @post pkgmgrinfo_appinfo_filter_destroy()
5363 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5365 static int get_capp_count()
5369 pkgmgrinfo_appinfo_filter_h handle;
5370 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5371 if (ret != PMINFO_R_OK)
5373 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5374 if (ret != PMINFO_R_OK) {
5375 pkgmgrinfo_appinfo_filter_destroy(handle);
5378 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5379 if (ret != PMINFO_R_OK) {
5380 pkgmgrinfo_appinfo_filter_destroy(handle);
5383 printf("No of capp: %d\n", count);
5384 pkgmgrinfo_appinfo_filter_destroy(handle);
5389 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5390 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5392 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5393 * @brief This API creates the application's metadata information filter handle from db.
5395 * @par This API is for package-manager client application
5396 * @par Sync (or) Async : Synchronous API
5398 * @param[out] handle pointer to the application metadata info filter handle.
5399 * @return 0 if success, error code(<0) if fail
5400 * @retval PMINFO_R_OK success
5401 * @retval PMINFO_R_EINVAL invalid argument
5402 * @retval PMINFO_R_ERROR internal error
5404 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5405 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5407 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5410 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5411 printf("appid : %s\n", appid);
5415 static int get_app_list(const char *mkey, const char *mvalue)
5418 pkgmgrinfo_appinfo_metadata_filter_h handle;
5419 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5420 if (ret != PMINFO_R_OK)
5422 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5423 if (ret != PMINFO_R_OK) {
5424 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5427 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5428 if (ret != PMINFO_R_OK) {
5429 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5432 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5437 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5440 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5441 * @brief This API destroys the application's metadata information filter handle.
5443 * @par This API is for package-manager client application
5444 * @par Sync (or) Async : Synchronous API
5446 * @param[in] handle pointer to the application metadata info filter handle.
5447 * @return 0 if success, error code(<0) if fail
5448 * @retval PMINFO_R_OK success
5449 * @retval PMINFO_R_EINVAL invalid argument
5450 * @retval PMINFO_R_ERROR internal error
5451 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5453 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5455 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5458 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5459 printf("appid : %s\n", appid);
5463 static int get_app_list(const char *mkey, const char *mvalue)
5466 pkgmgrinfo_appinfo_metadata_filter_h handle;
5467 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5468 if (ret != PMINFO_R_OK)
5470 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5471 if (ret != PMINFO_R_OK) {
5472 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5475 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5476 if (ret != PMINFO_R_OK) {
5477 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5480 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5485 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5488 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5489 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5490 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5492 * @par This API is for package-manager client application
5493 * @par Sync (or) Async : Synchronous API
5495 * @param[in] handle pointer to the application metadata info filter handle.
5496 * @param[in] key pointer to metadata key
5497 * @param[in] value pointer to metadata value
5498 * @return 0 if success, error code(<0) if fail
5499 * @retval PMINFO_R_OK success
5500 * @retval PMINFO_R_EINVAL invalid argument
5501 * @retval PMINFO_R_ERROR internal error
5502 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5503 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5504 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5506 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5509 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5510 printf("appid : %s\n", appid);
5514 static int get_app_list(const char *mkey, const char *mvalue)
5517 pkgmgrinfo_appinfo_metadata_filter_h handle;
5518 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5519 if (ret != PMINFO_R_OK)
5521 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5522 if (ret != PMINFO_R_OK) {
5523 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5526 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5527 if (ret != PMINFO_R_OK) {
5528 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5531 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5536 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5537 const char *key, const char *value);
5540 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5541 * @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)
5542 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5543 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5544 * negative value, no more callbacks will be called and API will return.
5546 * @par This API is for package-manager client application
5547 * @par Sync (or) Async : Synchronous API
5549 * @param[in] handle pointer to the application metadata info filter handle.
5550 * @param[in] app_cb function pointer to callback
5551 * @param[in] user_data pointer to user data
5552 * @param[in] uid the addressee user id of the instruction
5553 * @return 0 if success, error code(<0) if fail
5554 * @retval PMINFO_R_OK success
5555 * @retval PMINFO_R_EINVAL invalid argument
5556 * @retval PMINFO_R_ERROR internal error
5557 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5558 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5560 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5563 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5564 printf("appid : %s\n", appid);
5568 static int get_app_list(const char *mkey, const char *mvalue)
5571 pkgmgrinfo_appinfo_metadata_filter_h handle;
5572 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5573 if (ret != PMINFO_R_OK)
5575 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5576 if (ret != PMINFO_R_OK) {
5577 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5580 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5581 if (ret != PMINFO_R_OK) {
5582 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5585 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5590 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5591 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5592 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5593 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5596 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5597 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5598 * @fn int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5599 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5600 * @brief This API gets the list of app-control for a particular application
5602 * @par This API is for package-manager client application
5603 * @par Sync (or) Async : Synchronous API
5604 * @param[in] handle pointer to the application info handle.
5605 * @param[in] appcontrol_func callback function for list
5606 * @param[in] user_data user data to be passed to callback function
5607 * @return 0 if success, error code(<0) if fail
5608 * @retval PMINFO_R_OK success
5609 * @retval PMINFO_R_EINVAL invalid argument
5610 * @retval PMINFO_R_ERROR internal error
5611 * @pre pkgmgrinfo_appinfo_get_appinfo()
5612 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5614 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5615 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5617 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5618 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5621 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5622 * @brief This API creates the package cert information handle to get data from db.
5624 * @par This API is for package-manager client application
5625 * @par Sync (or) Async : Synchronous API
5627 * @param[out] handle pointer to the package cert handle.
5628 * @return 0 if success, error code(<0) if fail
5629 * @retval PMINFO_R_OK success
5630 * @retval PMINFO_R_EINVAL invalid argument
5631 * @retval PMINFO_R_ERROR internal error
5633 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5634 * @see pkgmgrinfo_pkginfo_get_cert_value()
5635 * @see pkgmgrinfo_pkginfo_load_certinfo()
5637 static int get_cert_info(const char *pkgid)
5640 pkgmgrinfo_certinfo_h handle;
5641 char *auth_cert = NULL;
5642 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5643 if (ret != PMINFO_R_OK)
5645 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5646 if (ret != PMINFO_R_OK) {
5647 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5650 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5651 if (ret != PMINFO_R_OK) {
5652 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5655 printf("Author root certificate: %s\n", auth_root);
5656 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5661 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5664 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5665 * @brief This API loads the package cert information handle with data from db.
5667 * @par This API is for package-manager client application
5668 * @par Sync (or) Async : Synchronous API
5670 * @param[in] pkgid pointer to the package ID.
5671 * @param[in] handle pointer to the package cert handle.
5672 * @return 0 if success, error code(<0) if fail
5673 * @retval PMINFO_R_OK success
5674 * @retval PMINFO_R_EINVAL invalid argument
5675 * @retval PMINFO_R_ERROR internal error
5676 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5677 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5678 * @see pkgmgrinfo_pkginfo_get_cert_value()
5680 static int get_cert_info(const char *pkgid)
5683 pkgmgrinfo_certinfo_h handle;
5684 char *auth_cert = NULL;
5685 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5686 if (ret != PMINFO_R_OK)
5688 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5689 if (ret != PMINFO_R_OK) {
5690 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5693 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5694 if (ret != PMINFO_R_OK) {
5695 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5698 printf("Author root certificate: %s\n", auth_root);
5699 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5704 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5707 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5708 * @brief This API gets the package cert information from the handle
5710 * @par This API is for package-manager client application
5711 * @par Sync (or) Async : Synchronous API
5713 * @param[in] handle pointer to the package cert handle.
5714 * @param[in] cert_type certificate type
5715 * @param[out] cert_value pointer to hold certificate value
5716 * @return 0 if success, error code(<0) if fail
5717 * @retval PMINFO_R_OK success
5718 * @retval PMINFO_R_EINVAL invalid argument
5719 * @retval PMINFO_R_ERROR internal error
5720 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5721 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5722 * @see pkgmgrinfo_pkginfo_load_certinfo()
5724 static int get_cert_info(const char *pkgid)
5727 pkgmgrinfo_certinfo_h handle;
5728 char *auth_cert = NULL;
5729 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5730 if (ret != PMINFO_R_OK)
5732 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5733 if (ret != PMINFO_R_OK) {
5734 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5737 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5738 if (ret != PMINFO_R_OK) {
5739 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5742 printf("Author root certificate: %s\n", auth_root);
5743 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5748 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5751 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5752 * @brief This API destroys the package cert information handle freeing up all the resources
5754 * @par This API is for package-manager client application
5755 * @par Sync (or) Async : Synchronous API
5757 * @param[in] handle pointer to the package cert handle.
5758 * @return 0 if success, error code(<0) if fail
5759 * @retval PMINFO_R_OK success
5760 * @retval PMINFO_R_EINVAL invalid argument
5761 * @retval PMINFO_R_ERROR internal error
5762 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5764 * @see pkgmgrinfo_pkginfo_load_certinfo()
5766 static int get_cert_info(const char *pkgid)
5769 pkgmgrinfo_certinfo_h handle;
5770 char *auth_cert = NULL;
5771 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5772 if (ret != PMINFO_R_OK)
5774 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5775 if (ret != PMINFO_R_OK) {
5776 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5779 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5780 if (ret != PMINFO_R_OK) {
5781 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5784 printf("Author root certificate: %s\n", auth_root);
5785 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5790 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5793 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5794 * @brief This API deletes the package cert information from DB
5796 * @par This API is for package-manager client application
5797 * @par Sync (or) Async : Synchronous API
5799 * @param[in] pkgid pointer to the package ID.
5800 * @return 0 if success, error code(<0) if fail
5801 * @retval PMINFO_R_OK success
5802 * @retval PMINFO_R_EINVAL invalid argument
5803 * @retval PMINFO_R_ERROR internal error
5807 static int delete_cert_info(const char *pkgid)
5810 ret = pkgmgrinfo_delete_certinfo(pkgid);
5811 if (ret != PMINFO_R_OK)
5817 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5818 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5821 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5822 * @brief This API creates the package cert information handle to set data in db.
5824 * @par This API is for package-manager client application
5825 * @par Sync (or) Async : Synchronous API
5827 * @param[out] handle pointer to the package cert handle.
5828 * @return 0 if success, error code(<0) if fail
5829 * @retval PMINFO_R_OK success
5830 * @retval PMINFO_R_EINVAL invalid argument
5831 * @retval PMINFO_R_ERROR internal error
5833 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5834 * @see pkgmgrinfo_set_cert_value()
5835 * @see pkgmgrinfo_save_certinfo()
5837 static int set_cert_in_db(const char *pkgid)
5840 pkgmgrinfo_instcertinfo_h handle;
5841 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5842 if (ret != PMINFO_R_OK)
5844 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5845 if (ret != PMINFO_R_OK) {
5846 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5849 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5850 if (ret != PMINFO_R_OK) {
5851 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5854 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5859 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5862 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5863 * @brief This API sets the package cert information in the handle.
5865 * @par This API is for package-manager client application
5866 * @par Sync (or) Async : Synchronous API
5868 * @param[in] handle pointer to the package cert handle.
5869 * @param[in] cert_type certificate type.
5870 * @param[in] cert_value certificate value.
5871 * @return 0 if success, error code(<0) if fail
5872 * @retval PMINFO_R_OK success
5873 * @retval PMINFO_R_EINVAL invalid argument
5874 * @retval PMINFO_R_ERROR internal error
5875 * @pre pkgmgrinfo_create_certinfo_set_handle()
5876 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5877 * @see pkgmgrinfo_save_certinfo()
5879 static int set_cert_in_db(const char *pkgid)
5882 pkgmgrinfo_instcertinfo_h handle;
5883 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5884 if (ret != PMINFO_R_OK)
5886 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5887 if (ret != PMINFO_R_OK) {
5888 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5891 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5892 if (ret != PMINFO_R_OK) {
5893 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5896 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5901 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5904 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5905 * @brief This API saves the package cert information in the DB.
5907 * @par This API is for package-manager client application
5908 * @par Sync (or) Async : Synchronous API
5910 * @param[in] pkgid pointer to the package ID.
5911 * @param[in] handle pointer to the package cert handle.
5912 * @return 0 if success, error code(<0) if fail
5913 * @retval PMINFO_R_OK success
5914 * @retval PMINFO_R_EINVAL invalid argument
5915 * @retval PMINFO_R_ERROR internal error
5916 * @pre pkgmgrinfo_create_certinfo_set_handle()
5917 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5918 * @see pkgmgrinfo_save_certinfo()
5920 static int set_cert_in_db(const char *pkgid)
5923 pkgmgrinfo_instcertinfo_h handle;
5924 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5925 if (ret != PMINFO_R_OK)
5927 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5928 if (ret != PMINFO_R_OK) {
5929 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5932 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5933 if (ret != PMINFO_R_OK) {
5934 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5937 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5942 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5945 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5946 * @brief This API destroys the package cert information handle freeing up all the resources.
5948 * @par This API is for package-manager client application
5949 * @par Sync (or) Async : Synchronous API
5951 * @param[in] handle pointer to the package cert handle.
5952 * @return 0 if success, error code(<0) if fail
5953 * @retval PMINFO_R_OK success
5954 * @retval PMINFO_R_EINVAL invalid argument
5955 * @retval PMINFO_R_ERROR internal error
5956 * @pre pkgmgrinfo_create_certinfo_set_handle()
5958 * @see pkgmgrinfo_save_certinfo()
5960 static int set_cert_in_db(const char *pkgid)
5963 pkgmgrinfo_instcertinfo_h handle;
5964 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5965 if (ret != PMINFO_R_OK)
5967 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5968 if (ret != PMINFO_R_OK) {
5969 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5972 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5973 if (ret != PMINFO_R_OK) {
5974 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5977 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5982 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5985 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5986 * @brief This API gets the application 'guest mode visibility' value from the DB
5988 * @par This API is for package-manager client application
5989 * @par Sync (or) Async : Synchronous API
5991 * @param[in] handle pointer to application info handle
5992 * @param[out] status pointer to hold app guest mode visibility value
5993 * @return 0 if success, error code(<0) if fail
5994 * @retval PMINFO_R_OK success
5995 * @retval PMINFO_R_EINVAL invalid argument
5996 * @retval PMINFO_R_ERROR internal error
5997 * @pre pkgmgrinfo_appinfo_get_appinfo()
5998 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5999 * @see pkgmgrinfo_appinfo_get_appid()
6000 * @see pkgmgrinfo_appinfo_is_multiple()
6002 static int get_app_guestmode_visibility(const char *appid)
6006 pkgmgrinfo_appinfo_h handle;
6007 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6008 if (ret != PMINFO_R_OK)
6010 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6011 if (ret != PMINFO_R_OK) {
6012 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6015 printf("app guest mode visibility: %d\n", status);
6016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6021 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6024 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6025 * @brief This API sets the package 'installed_storage' value in db
6027 * @par This API is for package-manager client application
6028 * @par Sync (or) Async : Synchronous API
6030 * @param[in] pkgid pointer to the package ID.
6031 * @param[in] location package install location
6032 * @param[in] external_pkg_path image path if pkg has installed at external storage
6033 * @return 0 if success, error code(<0) if fail
6034 * @retval PMINFO_R_OK success
6035 * @retval PMINFO_R_EINVAL invalid argument
6036 * @retval PMINFO_R_ERROR internal error
6038 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6042 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6043 if (ret != PMINFO_R_OK) {
6050 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6051 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6053 /* version compare */
6054 int pkgmgrinfo_compare_package_version(const char *current_version,
6055 const char *target_version, pkgmgrinfo_version_compare_type *res);
6058 * @fn int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6059 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6061 * @brief This API gets the list of dependency of a particular package
6063 * @par This API is for package-manager client application
6064 * @par Sync (or) Async : Synchronous API
6065 * @param[in] handle pointer to the package info handle.
6066 * @param[in] dependency_cb callback function for list
6067 * @param[in] user_data user data to be passed to callback function
6068 * @return 0 if success, error code(<0) if fail
6069 * @retval PMINFO_R_OK success
6070 * @retval PMINFO_R_EINVAL invalid argument
6071 * @retval PMINFO_R_ERROR internal error
6072 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6073 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6075 int dependency_cb(const char *from const char *to, const char *type,
6076 const char *required_version,void *user_data)
6078 printf("this package %s %s", type, to);
6079 if (required_version)
6080 printf("required version : %s", required_version);
6084 static int list_dependency(const char *package)
6087 pkgmgrinfo_pkginfo_h handle;
6088 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6089 if (ret != PMINFO_R_OK)
6091 ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6092 if (ret != PMINFO_R_OK) {
6093 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6096 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6101 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6102 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6106 * @fn int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6107 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6109 * @brief This API gets the list of packages which has dependency directly
6110 * and indirectly of a particular package
6112 * @par This API is for package-manager client application
6113 * @par Sync (or) Async : Synchronous API
6114 * @param[in] handle pointer to the package info handle.
6115 * @param[in] dependency_cb callback function for list
6116 * @param[in] user_data user data to be passed to callback function
6117 * @return 0 if success, error code(<0) if fail
6118 * @retval PMINFO_R_OK success
6119 * @retval PMINFO_R_EINVAL invalid argument
6120 * @retval PMINFO_R_ERROR internal error
6121 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6122 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6124 int dependency_cb(const char *from, const char *to, const char *type,
6125 const char *required_version,void *user_data)
6127 printf("%s %s %s package", from, to, type);
6128 if (required_version)
6129 printf("required version : %s", required_version);
6133 static int list_depends_on(const char *package)
6136 pkgmgrinfo_pkginfo_h handle;
6137 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6138 if (ret != PMINFO_R_OK)
6140 ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6141 if (ret != PMINFO_R_OK) {
6142 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6145 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6150 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6151 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6155 * @fn int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6156 * @brief This API gets list of installed packages using flag that used for masking package's information
6158 * @par This API is for package-manager client application
6159 * @par Sync (or) Async : Synchronous API
6160 * @param[in] pkg_list_cb iteration function for list
6161 * @param[in] flag enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6162 * @param[in] user_data user data to be passed to callback function
6163 * @return 0 if success, error code(<0) if fail
6164 * @retval PMINFO_R_OK success
6165 * @retval PMINFO_R_EINVAL invalid argument
6166 * @retval PMINFO_R_ERROR internal error
6169 * @see pkgmgrinfo_pkginfo_get_option
6171 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6173 char *label1 = NULL;
6174 char *label2 = NULL;
6175 label1 = (char *)user_data;
6176 pkgmgrinfo_pkginfo_get_label(handle, &label2);
6177 if (strcmp(label1, label2) == 0)
6183 static int list_pkgs()
6186 char *label = "helloworld";
6187 ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6188 if (ret != PMINFO_R_OK)
6194 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6195 int flag, void *user_data, uid_t uid);
6196 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6197 int flag, void *user_data);
6200 * @fn int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6201 * @brief This API gets list of installed applications from all packages using flag that used for masking application's information
6203 * @par This API is for package-manager client application
6204 * @par Sync (or) Async : Synchronous API
6205 * @param[in] app_func iteration function for list
6206 * @param[in] flag enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6207 * @param[in] user_data user data to be passed to callback function
6208 * @return 0 if success, error code(<0) if fail
6209 * @retval PMINFO_R_OK success
6210 * @retval PMINFO_R_EINVAL invalid argument
6211 * @retval PMINFO_R_ERROR internal error
6214 * @see pkgmgrinfo_appinfo_get_option
6216 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6219 char *label1 = NULL;
6220 char *label2 = NULL;
6221 label1 = (char *)user_data;
6222 ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6223 if (ret != PMINFO_R_OK) {
6224 printf("pkgmgrinfo_appinfo_get_label fail");
6227 if (strcmp(label1, label2) == 0)
6233 static int list_apps()
6236 char *label = "helloworld";
6237 ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6238 if (ret != PMINFO_R_OK)
6244 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6245 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6247 int pkgmgrinfo_appinfo_get_installed_list_full(
6248 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6251 * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6252 * @brief This API creates the package archive information handle from given path
6254 * @par This API is for package-manager client application
6255 * @par Sync (or) Async : Synchronous API
6257 * @param[in] path path of package archive
6258 * @param[out] handle pointer to the package archive info handle
6259 * @return 0 if success, error code(<0) if fail
6260 * @retval PMINFO_R_OK success
6261 * @retval PMINFO_R_EINVAL invalid argument
6262 * @retval PMINFO_R_ERROR internal error
6264 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6266 static int get_pkg_archive_type(const char *path)
6270 pkgmgrinfo_archiveinfo_h handle;
6271 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6272 if (ret != PMINFO_R_OK)
6274 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6275 if (ret != PMINFO_R_OK) {
6276 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6279 printf("pkg archive type: %s\n", type);
6280 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6285 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6286 pkgmgrinfo_archiveinfo_h *handle);
6289 * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6290 * @brief This API destroys the package archive information handle freeing up all the resources
6292 * @par This API is for package-manager client application
6293 * @par Sync (or) Async : Synchronous API
6295 * @param[in] handle pointer to the package archive info handle
6296 * @return 0 if success, error code(<0) if fail
6297 * @retval PMINFO_R_OK success
6298 * @retval PMINFO_R_EINVAL invalid argument
6299 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6302 static int get_pkg_archive_type(const char *path)
6306 pkgmgrinfo_archiveinfo_h handle;
6307 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6308 if (ret != PMINFO_R_OK)
6310 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6311 if (ret != PMINFO_R_OK) {
6312 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6315 printf("pkg archive type: %s\n", type);
6316 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6321 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6324 * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6325 * @brief This API gets the package id from the package archive info handle
6327 * @par This API is for package-manager client application
6328 * @par Sync (or) Async : Synchronous API
6330 * @param[in] handle pointer to package archive info handle
6331 * @param[out] pkgid pointer to hold package id
6332 * @return 0 if success, error code(<0) if fail
6333 * @retval PMINFO_R_OK success
6334 * @retval PMINFO_R_EINVAL invalid argument
6335 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6336 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6338 static int get_pkg_archive_id(const char *path)
6341 char *pkg_id = NULL;
6342 pkgmgrinfo_archiveinfo_h handle;
6343 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6344 if (ret != PMINFO_R_OK)
6346 ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6347 if (ret != PMINFO_R_OK) {
6348 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6351 printf("pkg archive id: %s\n", pkg_id);
6352 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6357 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6358 const char **pkgid);
6361 * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6362 * @brief This API gets the package type from the package archive info handle
6364 * @par This API is for package-manager client application
6365 * @par Sync (or) Async : Synchronous API
6367 * @param[in] handle pointer to package archive info handle
6368 * @param[out] type pointer to hold package type
6369 * @return 0 if success, error code(<0) if fail
6370 * @retval PMINFO_R_OK success
6371 * @retval PMINFO_R_EINVAL invalid argument
6372 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6373 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6375 static int get_pkg_archive_type(const char *path)
6379 pkgmgrinfo_archiveinfo_h handle;
6380 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6381 if (ret != PMINFO_R_OK)
6383 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6384 if (ret != PMINFO_R_OK) {
6385 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6388 printf("pkg archive type: %s\n", type);
6389 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6394 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6398 * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
6399 * @brief This API gets the package version from the package archive info handle
6401 * @par This API is for package-manager client application
6402 * @par Sync (or) Async : Synchronous API
6404 * @param[in] handle pointer to package archive info handle
6405 * @param[out] version pointer to hold package version
6406 * @return 0 if success, error code(<0) if fail
6407 * @retval PMINFO_R_OK success
6408 * @retval PMINFO_R_EINVAL invalid argument
6409 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6410 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6412 static int get_pkg_archive_version(const char *path)
6415 char *version = NULL;
6416 pkgmgrinfo_archiveinfo_h handle;
6417 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6418 if (ret != PMINFO_R_OK)
6420 ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
6421 if (ret != PMINFO_R_OK) {
6422 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6425 printf("pkg archive version: %s\n", version);
6426 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6431 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6432 const char **version);
6435 * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
6436 * @brief This API gets the package api version from the package archive info handle
6438 * @par This API is for package-manager client application
6439 * @par Sync (or) Async : Synchronous API
6441 * @param[in] handle pointer to package archive info handle
6442 * @param[out] api_version pointer to hold package api_version
6443 * @return 0 if success, error code(<0) if fail
6444 * @retval PMINFO_R_OK success
6445 * @retval PMINFO_R_EINVAL invalid argument
6446 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6447 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6449 static int get_pkg_archive_api_version(const char *path)
6452 char *api_version = NULL;
6453 pkgmgrinfo_archiveinfo_h handle;
6454 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6455 if (ret != PMINFO_R_OK)
6457 ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
6458 if (ret != PMINFO_R_OK) {
6459 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6462 printf("pkg archive api_version: %s\n", api_version);
6463 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6468 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6469 const char **api_version);
6472 * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
6473 * @brief This API gets the package description from the package archive info handle
6475 * @par This API is for package-manager client application
6476 * @par Sync (or) Async : Synchronous API
6478 * @param[in] handle pointer to package archive info handle
6479 * @param[out] description pointer to hold package description
6480 * @return 0 if success, error code(<0) if fail
6481 * @retval PMINFO_R_OK success
6482 * @retval PMINFO_R_EINVAL invalid argument
6483 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6484 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6486 static int get_pkg_archive_description(const char *path)
6489 char *description = NULL;
6490 pkgmgrinfo_archiveinfo_h handle;
6491 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6492 if (ret != PMINFO_R_OK)
6494 ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
6495 if (ret != PMINFO_R_OK) {
6496 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6499 printf("pkg archive description: %s\n", description);
6500 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6505 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6506 const char **description);
6509 * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
6510 * @brief This API gets the package label from the package archive info handle
6512 * @par This API is for package-manager client application
6513 * @par Sync (or) Async : Synchronous API
6515 * @param[in] handle pointer to package archive info handle
6516 * @param[out] label pointer to hold package label
6517 * @return 0 if success, error code(<0) if fail
6518 * @retval PMINFO_R_OK success
6519 * @retval PMINFO_R_EINVAL invalid argument
6520 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6521 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6523 static int get_pkg_archive_label(const char *path)
6527 pkgmgrinfo_archiveinfo_h handle;
6528 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6529 if (ret != PMINFO_R_OK)
6531 ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
6532 if (ret != PMINFO_R_OK) {
6533 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6536 printf("pkg archive label: %s\n", label);
6537 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6542 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6543 const char **label);
6546 * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
6547 * @brief This API gets the package author from the package archive info handle
6549 * @par This API is for package-manager client application
6550 * @par Sync (or) Async : Synchronous API
6552 * @param[in] handle pointer to package archive info handle
6553 * @param[out] author pointer to hold package author
6554 * @return 0 if success, error code(<0) if fail
6555 * @retval PMINFO_R_OK success
6556 * @retval PMINFO_R_EINVAL invalid argument
6557 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6558 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6560 static int get_pkg_archive_author(const char *path)
6563 char *author = NULL;
6564 pkgmgrinfo_archiveinfo_h handle;
6565 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6566 if (ret != PMINFO_R_OK)
6568 ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
6569 if (ret != PMINFO_R_OK) {
6570 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6573 printf("pkg archive author: %s\n", author);
6574 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6579 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6580 const char **author);
6583 * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
6584 * @brief This API gets the package icon and size from the package archive info handle
6586 * @par This API is for package-manager client application
6587 * @par Sync (or) Async : Synchronous API
6589 * @param[in] handle pointer to package archive info handle
6590 * @param[out] icon pointer to hold package icon
6591 * @param[out] size pointer to hold size of package icon
6592 * @return 0 if success, error code(<0) if fail
6593 * @retval PMINFO_R_OK success
6594 * @retval PMINFO_R_EINVAL invalid argument
6595 * @retval PMINFO_R_ENOENT no result
6596 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6597 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6599 static int get_pkg_archive_icon(const char *path)
6602 unsigned char *icon = NULL;
6603 size_t icon_size = 0;
6604 pkgmgrinfo_archiveinfo_h handle;
6605 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6606 if (ret != PMINFO_R_OK)
6608 ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
6609 if (ret != PMINFO_R_OK) {
6610 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6613 printf("pkg archive icon size : %zu\n", icon_size);
6614 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6619 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6620 const unsigned char **icon, size_t *size);
6623 * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
6624 * @brief This API retrieve the dependency information and invoke given callback for it.
6626 * @par This API is for package-manager client application
6627 * @par Sync (or) Async : Synchronous API
6629 * @param[in] handle pointer to package archive info handle
6630 * @param[in] callback callback to be invoked for each retrieved dependency information
6631 * @param[in] user_data user data to be passed to callback
6632 * @return 0 if success, error code(<0) if fail
6633 * @retval PMINFO_R_OK success
6634 * @retval PMINFO_R_EINVAL invalid argument
6635 * @retval PMINFO_R_ERROR internal error
6636 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6637 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6639 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
6642 size_t icon_size = 0;
6643 pkgmgrinfo_archiveinfo_h handle;
6644 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6645 if (ret != PMINFO_R_OK)
6647 ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
6648 if (ret != PMINFO_R_OK) {
6649 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6652 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6657 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
6658 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
6661 * @pkgmgrinfo client API end
6669 #endif /* __PKG_INFO_H__ */