4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
95 /** String property for filtering based on package info*/
96 #define PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
116 /** Boolean property for filtering based on package info*/
117 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
119 /** Integer property for filtering based on package info*/
120 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
148 /** String property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_PRIVILEGE "PMINFO_APPINFO_PROP_PRIVILEGE"
151 /** Integer property for filtering app support mode */
152 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
174 /** Boolean property for filtering based on app info*/
175 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
177 /** will be updated*/
178 /** string property for filtering based on pkg info*/
179 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
181 /* For multiuser support */
182 const char *getIconPath(uid_t uid, bool readonly);
183 char *getUserPkgParserDBPath(void);
184 char *getUserPkgParserDBPathUID(uid_t uid);
185 char *getUserPkgCertDBPath(void);
186 const char *getUserManifestPath(uid_t uid, bool readonly);
189 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
190 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
191 * @brief This API gets list of installed packages
193 * @par This API is for package-manager client application
194 * @par Sync (or) Async : Synchronous API
195 * @param[in] pkg_list_cb iteration function for list
196 * @param[in] user_data user data to be passed to callback function
197 * @param[in] uid the addressee user id of the instruction
198 * @return 0 if success, error code(<0) if fail
199 * @retval PMINFO_R_OK success
200 * @retval PMINFO_R_EINVAL invalid argument
201 * @retval PMINFO_R_ERROR internal error
205 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
209 pkgid1 = (char *)user_data;
210 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
211 if (strcmp(pkgid1, pkgid2) == 0) {
218 static int list_pkgs()
221 char *name = "helloworld";
222 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
223 if (ret != PMINFO_R_OK) {
230 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
231 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
234 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
235 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
236 * @brief This API gets list of disabled packages
238 * @par This API is for package-manager client application
239 * @par Sync (or) Async : Synchronous API
240 * @param[in] pkg_list_cb iteration function for list
241 * @param[in] user_data user data to be passed to callback function
242 * @param[in] uid the addressee user id of the instruction
243 * @return 0 if success, error code(<0) if fail
244 * @retval PMINFO_R_OK success
245 * @retval PMINFO_R_EINVAL invalid argument
246 * @retval PMINFO_R_ERROR internal error
250 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
251 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
254 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
255 * @brief This API creates the package information handle from db which is not disabled
257 * @par This API is for package-manager client application
258 * @par Sync (or) Async : Synchronous API
260 * @param[in] pkgid pointer to package ID
261 * @param[in] uid the addressee user id of the instruction
262 * @param[out] handle pointer to the package info handle.
263 * @return 0 if success, error code(<0) if fail
264 * @retval PMINFO_R_OK success
265 * @retval PMINFO_R_EINVAL invalid argument
266 * @retval PMINFO_R_ERROR internal error
268 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
269 * @see pkgmgrinfo_pkginfo_get_pkgid()
270 * @see pkgmgrinfo_pkginfo_is_removable()
272 static int get_pkg_type(const char *pkgid)
276 pkgmgrinfo_pkginfo_h handle;
277 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
278 if (ret != PMINFO_R_OK)
280 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
281 if (ret != PMINFO_R_OK) {
282 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
285 printf("pkgtype: %s\n", type);
286 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
291 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
292 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
295 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
296 * @brief This API creates the disabled package information handle from db
298 * @par This API is for package-manager client application
299 * @par Sync (or) Async : Synchronous API
301 * @param[in] pkgid pointer to package ID
302 * @param[in] uid the addressee user id of the instruction
303 * @param[out] handle pointer to the package info handle.
304 * @return 0 if success, error code(<0) if fail
305 * @retval PMINFO_R_OK success
306 * @retval PMINFO_R_EINVAL invalid argument
307 * @retval PMINFO_R_ERROR internal error
309 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
310 * @see pkgmgrinfo_pkginfo_get_pkginfo()
312 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
313 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
316 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
317 * @brief This API creates the package information handle from db regardless of its disable or storage status
319 * @par This API is for package-manager client application
320 * @par Sync (or) Async : Synchronous API
322 * @param[in] pkgid pointer to package ID
323 * @param[in] uid the addressee user id of the instruction
324 * @param[out] handle pointer to the package info handle.
325 * @return 0 if success, error code(<0) if fail
326 * @retval PMINFO_R_OK success
327 * @retval PMINFO_R_EINVAL invalid argument
328 * @retval PMINFO_R_ERROR internal error
330 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
331 * @see pkgmgrinfo_pkginfo_get_pkgid()
332 * @see pkgmgrinfo_pkginfo_is_removable()
334 static int get_pkg_type(const char *pkgid)
338 pkgmgrinfo_pkginfo_h handle;
339 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
340 if (ret != PMINFO_R_OK)
342 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
343 if (ret != PMINFO_R_OK) {
344 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
347 printf("pkgtype: %s\n", type);
348 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
353 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
354 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
357 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
358 * @brief This API gets the package name from the package ID
360 * @par This API is for package-manager client application
361 * @par Sync (or) Async : Synchronous API
363 * @param[in] handle pointer to package info handle
364 * @param[out] pkg_name pointer to hold package name
365 * @return 0 if success, error code(<0) if fail
366 * @retval PMINFO_R_OK success
367 * @retval PMINFO_R_EINVAL invalid argument
368 * @retval PMINFO_R_ERROR internal error
369 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
371 * @see pkgmgrinfo_pkginfo_get_type()
372 * @see pkgmgrinfo_pkginfo_is_removable()
374 static int get_pkg_name(const char *pkgid)
377 char *pkgname = NULL;
378 pkgmgrinfo_pkginfo_h handle;
379 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
380 if (ret != PMINFO_R_OK)
382 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
383 if (ret != PMINFO_R_OK) {
384 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
387 printf("pkgname: %s\n", pkgname);
388 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
393 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
396 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
397 * @brief This API gets the package id from the package ID
399 * @par This API is for package-manager client application
400 * @par Sync (or) Async : Synchronous API
402 * @param[in] handle pointer to package info handle
403 * @param[out] pkgid pointer to hold package id
404 * @return 0 if success, error code(<0) if fail
405 * @retval PMINFO_R_OK success
406 * @retval PMINFO_R_EINVAL invalid argument
407 * @retval PMINFO_R_ERROR internal error
408 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
409 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
410 * @see pkgmgrinfo_pkginfo_get_type()
411 * @see pkgmgrinfo_pkginfo_is_removable()
413 static int get_pkgid(const char *pkgid)
417 pkgmgrinfo_pkginfo_h handle;
418 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
419 if (ret != PMINFO_R_OK)
421 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
422 if (ret != PMINFO_R_OK) {
423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
426 printf("pkg id: %s\n", pkg_id);
427 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
432 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
435 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
436 * @brief This API gets the package type from the package ID
438 * @par This API is for package-manager client application
439 * @par Sync (or) Async : Synchronous API
441 * @param[in] handle pointer to package info handle
442 * @param[out] type pointer to hold package type
443 * @return 0 if success, error code(<0) if fail
444 * @retval PMINFO_R_OK success
445 * @retval PMINFO_R_EINVAL invalid argument
446 * @retval PMINFO_R_ERROR internal error
447 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
448 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
449 * @see pkgmgrinfo_pkginfo_get_pkgid()
450 * @see pkgmgrinfo_pkginfo_is_removable()
452 static int get_pkg_type(const char *pkgid)
456 pkgmgrinfo_pkginfo_h handle;
457 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
458 if (ret != PMINFO_R_OK)
460 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
461 if (ret != PMINFO_R_OK) {
462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
465 printf("pkgtype: %s\n", type);
466 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
471 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
474 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
475 * @brief This API gets the package version from the package ID
477 * @par This API is for package-manager client application
478 * @par Sync (or) Async : Synchronous API
480 * @param[in] handle pointer to package info handle
481 * @param[out] version pointer to hold package version
482 * @return 0 if success, error code(<0) if fail
483 * @retval PMINFO_R_OK success
484 * @retval PMINFO_R_EINVAL invalid argument
485 * @retval PMINFO_R_ERROR internal error
486 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
487 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
488 * @see pkgmgrinfo_pkginfo_get_pkgid()
489 * @see pkgmgrinfo_pkginfo_is_removable()
491 static int get_pkg_version(const char *pkgid)
494 char *version = NULL;
495 pkgmgrinfo_pkginfo_h handle;
496 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
497 if (ret != PMINFO_R_OK)
499 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
500 if (ret != PMINFO_R_OK) {
501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
504 printf("pkg version: %s\n", version);
505 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
510 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
513 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
514 * @brief This API gets the package api_version from the package ID
516 * @par This API is for package-manager client application
517 * @par Sync (or) Async : Synchronous API
519 * @param[in] handle pointer to package info handle
520 * @param[out] api_version pointer to hold package api_version
521 * @return 0 if success, error code(<0) if fail
522 * @retval PMINFO_R_OK success
523 * @retval PMINFO_R_EINVAL invalid argument
524 * @retval PMINFO_R_ERROR internal error
525 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
526 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
527 * @see pkgmgrinfo_pkginfo_get_pkgid()
528 * @see pkgmgrinfo_pkginfo_is_removable()
530 static int get_pkg_api_version(const char *pkgid)
533 char *api_version = NULL;
534 pkgmgrinfo_pkginfo_h handle = NULL;
535 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
536 if (ret != PMINFO_R_OK)
538 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
539 if (ret != PMINFO_R_OK) {
540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543 printf("pkg api_version: %s\n", api_version);
544 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
549 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
552 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
553 * @brief This API gets tep(tizen expansion package) file name associated with the package
555 * @par This API is for package-manager client application
556 * @par Sync (or) Async : Synchronous API
558 * @param[in] handle pointer to the pkginfo handle.
559 * @param[out] tep_name pointer to hold tep name
560 * @return 0 if success, error code(<0) if fail
561 * @retval PMINFO_R_OK success
562 * @retval PMINFO_R_EINVAL invalid argument
563 * @retval PMINFO_R_ERROR internal error
564 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
565 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
566 * @see pkgmgrinfo_pkginfo_get_pkgid()
568 static int get_tep_name(const char *pkgid)
571 char *tep_name = NULL;
572 pkgmgrinfo_pkginfo_h handle = NULL;
573 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
574 if (ret != PMINFO_R_OK)
576 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
577 if (ret != PMINFO_R_OK) {
578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581 printf("TEP name is: %s\n", tep_name);
582 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
587 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
590 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
591 * @brief This API gets package mount point path associated with the package
592 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
594 * @par This API is for package-manager client application
595 * @par Sync (or) Async : Synchronous API
597 * @param[in] handle pointer to the pkginfo handle.
598 * @param[out] zip_mount_file pointer to hold zip mount file
599 * @return 0 if success, error code(<0) if fail
600 * @retval PMINFO_R_OK success
601 * @retval PMINFO_R_EINVAL invalid argument
602 * @retval PMINFO_R_ERROR internal error
603 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
604 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
605 * @see pkgmgrinfo_pkginfo_get_pkgid()
607 static int get_zip_mount_file(const char *pkgid)
610 char *zip_mount_file = NULL;
611 pkgmgrinfo_pkginfo_h handle = NULL;
612 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
613 if (ret != PMINFO_R_OK)
615 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
616 if (ret != PMINFO_R_OK) {
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 if (zip_mount_file != NULL)
621 printf("Zip mount path is: %s\n", zip_mount_file);
622 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
627 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
630 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
631 * @brief This API gets package external image path associated with the package
632 * if package is installed in external storage.
633 * Otherwise, the return value will be PMINFO_R_ENOENT.
635 * @par This API is for package-manager client application
636 * @par Sync (or) Async : Synchronous API
638 * @param[in] handle pointer to the pkginfo handle.
639 * @param[out] ext_image_path pointer to hold external image path
640 * @return 0 if success, error code(<0) if fail
641 * @retval PMINFO_R_OK success
642 * @retval PMINFO_R_EINVAL invalid argument
643 * @retval PMINFO_R_ERROR internal error
644 * @revall PMINFO_R_ENOENT no valid data
645 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
646 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
647 * @see pkgmgrinfo_pkginfo_get_pkgid()
649 static int get_external_image_path(const char *pkgid)
652 char *ext_image_path = NULL;
653 pkgmgrinfo_pkginfo_h handle = NULL;
654 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
655 if (ret != PMINFO_R_OK)
657 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
658 if (ret != PMINFO_R_OK) {
659 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
662 printf("external image path is: %s\n", ext_image_path);
663 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
668 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
671 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
672 * @brief This API gets the package install location from the package ID
674 * @par This API is for package-manager client application
675 * @par Sync (or) Async : Synchronous API
677 * @param[in] handle pointer to package info handle
678 * @param[out] location pointer to hold package install location
679 * @return 0 if success, error code(<0) if fail
680 * @retval PMINFO_R_OK success
681 * @retval PMINFO_R_EINVAL invalid argument
682 * @retval PMINFO_R_ERROR internal error
683 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
684 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
685 * @see pkgmgrinfo_pkginfo_get_pkgid()
686 * @see pkgmgrinfo_pkginfo_is_removable()
688 static int get_pkg_install_location(const char *pkgid)
691 pkgmgrinfo_install_location location;
692 pkgmgrinfo_pkginfo_h handle;
693 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
694 if (ret != PMINFO_R_OK)
696 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
697 if (ret != PMINFO_R_OK) {
698 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
701 printf("pkg install location: %d\n", location);
702 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
707 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
710 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
711 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
712 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
713 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
715 * @par This API is for package-manager client application
716 * @par Sync (or) Async : Synchronous API
718 * @param[in] handle pointer to package info handle
719 * @param[out] size pointer to hold package size
720 * @return 0 if success, error code(<0) if fail
721 * @retval PMINFO_R_OK success
722 * @retval PMINFO_R_EINVAL invalid argument
723 * @retval PMINFO_R_ERROR internal error
724 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
725 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
726 * @see pkgmgrinfo_pkginfo_get_pkgid()
727 * @see pkgmgrinfo_pkginfo_is_removable()
729 static int get_pkg_size(const char *pkgid)
733 pkgmgrinfo_pkginfo_h handle;
734 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
735 if (ret != PMINFO_R_OK)
737 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
738 if (ret != PMINFO_R_OK) {
739 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
742 printf("pkgsize: %d\n", size);
743 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
748 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
751 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
752 * @brief This API gets the package icon from the package ID
754 * @par This API is for package-manager client application
755 * @par Sync (or) Async : Synchronous API
757 * @param[in] handle pointer to package info handle
758 * @param[out] icon pointer to hold package icon
759 * @return 0 if success, error code(<0) if fail
760 * @retval PMINFO_R_OK success
761 * @retval PMINFO_R_EINVAL invalid argument
762 * @retval PMINFO_R_ERROR internal error
763 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
764 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
765 * @see pkgmgrinfo_pkginfo_get_pkgid()
766 * @see pkgmgrinfo_pkginfo_is_removable()
768 static int get_pkg_icon(const char *pkgid)
772 pkgmgrinfo_pkginfo_h handle;
773 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
774 if (ret != PMINFO_R_OK)
776 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
777 if (ret != PMINFO_R_OK) {
778 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
781 printf("pkg icon: %s\n", icon);
782 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
787 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
790 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
791 * @brief This API gets the package label from the package ID
793 * @par This API is for package-manager client application
794 * @par Sync (or) Async : Synchronous API
796 * @param[in] handle pointer to package info handle
797 * @param[out] label pointer to hold package label
798 * @return 0 if success, error code(<0) if fail
799 * @retval PMINFO_R_OK success
800 * @retval PMINFO_R_EINVAL invalid argument
801 * @retval PMINFO_R_ERROR internal error
802 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
803 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
804 * @see pkgmgrinfo_pkginfo_get_pkgid()
805 * @see pkgmgrinfo_pkginfo_is_removable()
807 static int get_pkg_label(const char *pkgid)
811 pkgmgrinfo_pkginfo_h handle;
812 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
813 if (ret != PMINFO_R_OK)
815 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
816 if (ret != PMINFO_R_OK) {
817 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
820 printf("pkg label: %s\n", label);
821 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
826 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
829 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
830 * @brief This API gets the package description from the package ID
832 * @par This API is for package-manager client application
833 * @par Sync (or) Async : Synchronous API
835 * @param[in] handle pointer to package info handle
836 * @param[out] description pointer to hold package description
837 * @return 0 if success, error code(<0) if fail
838 * @retval PMINFO_R_OK success
839 * @retval PMINFO_R_EINVAL invalid argument
840 * @retval PMINFO_R_ERROR internal error
841 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
842 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
843 * @see pkgmgrinfo_pkginfo_get_pkgid()
844 * @see pkgmgrinfo_pkginfo_is_removable()
846 static int get_pkg_description(const char *pkgid)
849 char *description = NULL;
850 pkgmgrinfo_pkginfo_h handle;
851 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
852 if (ret != PMINFO_R_OK)
854 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
855 if (ret != PMINFO_R_OK) {
856 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
859 printf("pkg description: %s\n", description);
860 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
865 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
868 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
869 * @brief This API gets the package's author name from the package ID
871 * @par This API is for package-manager client application
872 * @par Sync (or) Async : Synchronous API
874 * @param[in] handle pointer to package info handle
875 * @param[out] author_name pointer to hold package author name
876 * @return 0 if success, error code(<0) if fail
877 * @retval PMINFO_R_OK success
878 * @retval PMINFO_R_EINVAL invalid argument
879 * @retval PMINFO_R_ERROR internal error
880 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
881 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
882 * @see pkgmgrinfo_pkginfo_get_pkgid()
883 * @see pkgmgrinfo_pkginfo_is_removable()
885 static int get_pkg_author_name(const char *pkgid)
888 char *author_name = NULL;
889 pkgmgrinfo_pkginfo_h handle;
890 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
891 if (ret != PMINFO_R_OK)
893 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
894 if (ret != PMINFO_R_OK) {
895 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
898 printf("pkg author name: %s\n", author_name);
899 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
904 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
907 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
908 * @brief This API gets the package's author email from the package ID
910 * @par This API is for package-manager client application
911 * @par Sync (or) Async : Synchronous API
913 * @param[in] handle pointer to package info handle
914 * @param[out] author_email pointer to hold package author email
915 * @return 0 if success, error code(<0) if fail
916 * @retval PMINFO_R_OK success
917 * @retval PMINFO_R_EINVAL invalid argument
918 * @retval PMINFO_R_ERROR internal error
919 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
920 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
921 * @see pkgmgrinfo_pkginfo_get_pkgid()
922 * @see pkgmgrinfo_pkginfo_is_removable()
924 static int get_pkg_author_email(const char *pkgid)
927 char *author_email = NULL;
928 pkgmgrinfo_pkginfo_h handle;
929 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
930 if (ret != PMINFO_R_OK)
932 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
933 if (ret != PMINFO_R_OK) {
934 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
937 printf("pkg author email: %s\n", author_email);
938 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
943 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
946 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
947 * @brief This API gets the package's author href from the package ID
949 * @par This API is for package-manager client application
950 * @par Sync (or) Async : Synchronous API
952 * @param[in] handle pointer to package info handle
953 * @param[out] author_href pointer to hold package author href
954 * @return 0 if success, error code(<0) if fail
955 * @retval PMINFO_R_OK success
956 * @retval PMINFO_R_EINVAL invalid argument
957 * @retval PMINFO_R_ERROR internal error
958 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
959 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
960 * @see pkgmgrinfo_pkginfo_get_pkgid()
961 * @see pkgmgrinfo_pkginfo_is_removable()
963 static int get_pkg_author_href(const char *pkgid)
966 char *author_href = NULL;
967 pkgmgrinfo_pkginfo_h handle;
968 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
969 if (ret != PMINFO_R_OK)
971 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
972 if (ret != PMINFO_R_OK) {
973 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
976 printf("pkg author href: %s\n", author_href);
977 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
982 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
985 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
986 * @brief This API gets the package installed storagae value from the package ID
988 * @par This API is for package-manager client application
989 * @par Sync (or) Async : Synchronous API
991 * @param[in] handle pointer to package info handle
992 * @param[out] storage pointer to hold package installed storage
993 * @return 0 if success, error code(<0) if fail
994 * @retval PMINFO_R_OK success
995 * @retval PMINFO_R_EINVAL invalid argument
996 * @retval PMINFO_R_ERROR internal error
997 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
998 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
999 * @see pkgmgrinfo_pkginfo_get_pkgid()
1000 * @see pkgmgrinfo_pkginfo_is_removable()
1002 static int get_pkg_installed_storage(const char *pkgid)
1005 pkgmgrinfo_installed_storage storage;
1006 pkgmgrinfo_pkginfo_h handle;
1007 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1008 if (ret != PMINFO_R_OK)
1010 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1011 if (ret != PMINFO_R_OK) {
1012 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1015 printf("pkg installed storage: %d\n", storage);
1016 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1021 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1024 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1025 * @brief This API gets the installed time of package from the package ID
1027 * @par This API is for package-manager client application
1028 * @par Sync (or) Async : Synchronous API
1030 * @param[in] handle pointer to package info handle
1031 * @param[out] installed_time pointer to hold installed time of package
1032 * @return 0 if success, error code(<0) if fail
1033 * @retval PMINFO_R_OK success
1034 * @retval PMINFO_R_EINVAL invalid argument
1035 * @retval PMINFO_R_ERROR internal error
1036 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1037 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1038 * @see pkgmgrinfo_pkginfo_get_pkgid()
1039 * @see pkgmgrinfo_pkginfo_is_removable()
1041 static int get_pkg_installed_time(const char *pkgid)
1044 int installed_time = 0;
1045 pkgmgrinfo_pkginfo_h handle;
1046 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1047 if (ret != PMINFO_R_OK)
1049 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1050 if (ret != PMINFO_R_OK) {
1051 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1054 printf("installed_time: %d\n", installed_time);
1055 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1060 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1063 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1064 * @brief This API creates the update info handle
1066 * @par This API is for package-manager client application
1067 * @par Sync (or) Async : Synchronous API
1069 * @param[out] handle pointer to package update info handle
1070 * @return 0 if success, error code(<0) if fail
1071 * @retval PMINFO_R_OK success
1072 * @retval PMINFO_R_EINVAL invalid argument
1073 * @retval PMINFO_R_ERROR internal error
1074 * @post pkgmgrinfo_updateinfo_destroy()
1075 * @see pkgmgrinfo_updateinfo_set_pkgid()
1076 * @see pkgmgrinfo_updateinfo_set_version()
1077 * @see pkgmgrinfo_updateinfo_set_type()
1078 * @see pkgmgr_client_register_pkg_updateinfo()
1080 static int updateinfo_handle_create()
1084 pkgmgrinfo_updateinfo_h handle;
1085 ret = pkgmgrinfo_updateinfo_create(&handle);
1086 if (ret != PMINFO_R_OK)
1088 pkgmgrinfo_update_infodestroy(handle);
1093 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1096 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1097 * @brief This API destroy the update info handle
1099 * @par This API is for package-manager client application
1100 * @par Sync (or) Async : Synchronous API
1102 * @param[in] handle pointer to package update info handle
1103 * @return 0 if success, error code(<0) if fail
1104 * @retval PMINFO_R_OK success
1105 * @retval PMINFO_R_EINVAL invalid argument
1106 * @pre pkgmgrinfo_updateinfo_create()
1107 * @see pkgmgr_client_register_pkg_updateinfo()
1109 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1113 ret = pkgmgrinfo_updateinfo_destroy(handle);
1114 if (ret != PMINFO_R_OK)
1120 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1123 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1124 * @brief This API creates the package update information handle from db
1126 * @par This API is for package-manager client application
1127 * @par Sync (or) Async : Synchronous API
1129 * @param[in] pkgid pointer to package ID
1130 * @param[in] uid the addressee user id of the instruction
1131 * @param[out] update_handle pointer to the package update info handle.
1132 * @return 0 if success, error code(<0) if fail
1133 * @retval PMINFO_R_OK success
1134 * @retval PMINFO_R_EINVAL invalid argument
1135 * @retval PMINFO_R_ERROR internal error
1137 * @post pkgmgrinfo_updateinfo_destroy()
1138 * @see pkgmgrinfo_updateinfo_get_pkgid()
1139 * @see pkgmgrinfo_updateinfo_get_version()
1140 * @see pkgmgrinfo_updateinfo_get_update_type()
1142 static int get_pkg_update_info(const char *pkgid)
1146 pkgmgrinfo_updateinfo_h handle;
1147 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1148 if (ret != PMINFO_R_OK)
1150 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1151 if (ret != PMINFO_R_OK) {
1152 pkgmgrinfo_updateinfo_destroy(handle);
1155 printf("pkg update version: %s\n", version
1156 pkgmgrinfo_updateinfo_destroy(handle);
1161 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1162 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1165 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1166 * @brief This API sets given pkgid into handle
1168 * @par This API is for package-manager client application
1169 * @par Sync (or) Async : Synchronous API
1171 * @param[in] handle pointer to package update info handle
1172 * @param[in] pkgid package id
1173 * @return 0 if success, error code(<0) if fail
1174 * @retval PMINFO_R_OK success
1175 * @retval PMINFO_R_EINVAL invalid argument
1176 * @retval PMINFO_R_ERROR internal error
1178 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1182 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1183 if (ret != PMINFO_R_OK)
1189 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1192 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1193 * @brief This API sets given version into handle
1195 * @par This API is for package-manager client application
1196 * @par Sync (or) Async : Synchronous API
1198 * @param[in] handle pointer to package update info handle
1199 * @param[in] version update version
1200 * @return 0 if success, error code(<0) if fail
1201 * @retval PMINFO_R_OK success
1202 * @retval PMINFO_R_EINVAL invalid argument
1203 * @retval PMINFO_R_ERROR internal error
1205 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1209 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1210 if (ret != PMINFO_R_OK)
1216 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1219 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1220 * @brief This API sets given update type into handle
1222 * @par This API is for package-manager client application
1223 * @par Sync (or) Async : Synchronous API
1225 * @param[in] handle pointer to package update info handle
1226 * @param[in] type update type
1227 * @return 0 if success, error code(<0) if fail
1228 * @retval PMINFO_R_OK success
1229 * @retval PMINFO_R_EINVAL invalid argument
1230 * @retval PMINFO_R_ERROR internal error
1232 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1236 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1237 if (ret != PMINFO_R_OK)
1243 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1246 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1247 * @brief This API retrieves the pkgid from given update info
1249 * @par This API is for package-manager client application
1250 * @par Sync (or) Async : Synchronous API
1252 * @param[in] handle pointer to package update info handle
1253 * @param[out] pkgid package id
1254 * @return 0 if success, error code(<0) if fail
1255 * @retval PMINFO_R_OK success
1256 * @retval PMINFO_R_EINVAL invalid argument
1257 * @retval PMINFO_R_ERROR internal error
1259 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1264 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1265 if (ret != PMINFO_R_OK)
1271 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1274 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1275 * @brief This API retrieves the version from given update info
1277 * @par This API is for package-manager client application
1278 * @par Sync (or) Async : Synchronous API
1280 * @param[in] handle pointer to package update info handle
1281 * @param[out] version update version
1282 * @return 0 if success, error code(<0) if fail
1283 * @retval PMINFO_R_OK success
1284 * @retval PMINFO_R_EINVAL invalid argument
1285 * @retval PMINFO_R_ERROR internal error
1287 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1292 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1293 if (ret != PMINFO_R_OK)
1299 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1302 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1303 * @brief This API retrieves the update type from given update info
1305 * @par This API is for package-manager client application
1306 * @par Sync (or) Async : Synchronous API
1308 * @param[in] handle pointer to package update info handle
1309 * @param[out] type update type
1310 * @return 0 if success, error code(<0) if fail
1311 * @retval PMINFO_R_OK success
1312 * @retval PMINFO_R_EINVAL invalid argument
1313 * @retval PMINFO_R_ERROR internal error
1315 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1318 pkgmgrinfo_updateinfo_update_type *type;
1320 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1321 if (ret != PMINFO_R_OK)
1327 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1331 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1332 * @brief This API retrieve the update informations and invoke given callback for it.
1334 * @par This API is for package-manager client application
1335 * @par Sync (or) Async : Synchronous API
1337 * @param[in] callback callback to be invoked for each retrieved informations
1338 * @param[in] user_data user data to be passed to callback
1339 * @return 0 if success, error code(<0) if fail
1340 * @retval PMINFO_R_OK success
1341 * @retval PMINFO_R_EINVAL invalid argument
1342 * @retval PMINFO_R_ERROR internal error
1344 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1348 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1349 if (ret != PMINFO_R_OK)
1355 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1356 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1359 * @fn int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name, bool *is_executed);
1360 * @brief This API checkes whether given plugin had been executed with given package ID and application ID or not.
1362 * @par This API is for package-manager client application
1363 * @par Sync (or) Async : Synchronous API
1365 * @param[in] pkgid package ID
1366 * @param[in] appid application ID
1367 * @param[in] plugin_type plugin type to be checked
1368 * @param[in] plugin_name plugin name to be checked
1369 * @param[out] is_executed check result
1370 * @return 0 if success, error code(<0) if fail
1371 * @retval PMINFO_R_OK success
1372 * @retval PMINFO_R_EINVAL invalid argument
1373 * @retval PMINFO_R_ERROR internal error
1375 static bool check_execute_info(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name)
1380 ret = pkgmgrinfo_plugininfo_is_executed(pkgid, appid, plugin_type, plugin_name, &is_executed);
1381 if (ret != PMINFO_R_OK)
1383 printf("is checked is [%d]\n", is_executed);
1388 int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid,
1389 const char *plugin_type, const char *plugin_name, bool *is_executed);
1392 * @fn int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1393 * @brief This API retrieve the previous plugin execution info and invoke callbacks each of it.
1395 * @par This API is for package-manager client application
1396 * @par Sync (or) Async : Synchronous API
1398 * @param[in] pkgid package ID
1399 * @param[in] plugin_type type of plugin
1400 * @param[in] plugin_name name of plugin
1401 * @param[in] plugin_list_cb callback to be invoked for each plugin execution info
1402 * @param[out] user_data user data to be passed to callback
1403 * @return 0 if success, error code(<0) if fail
1404 * @retval PMINFO_R_OK success
1405 * @retval PMINFO_R_EINVAL invalid argument
1406 * @retval PMINFO_R_ERROR internal error
1408 static int foreach_pkg_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb callback)
1412 ret = pkgmgrinfo_plugininfo_foreach_plugininfo(pkgid, plugin_type, plugin_name, callback, NULL);
1413 if (ret != PMINFO_R_OK)
1419 int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
1420 const char *plugin_type, const char *plugin_name,
1421 pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1424 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1425 * @brief This API gets the launch mode of package from the package ID
1427 * @par This API is for package-manager client application
1428 * @par Sync (or) Async : Synchronous API
1430 * @param[in] handle pointer to package info handle
1431 * @param[out] mode pointer to hold launch mode of package
1432 * @return 0 if success, error code(<0) if fail
1433 * @retval PMINFO_R_OK success
1434 * @retval PMINFO_R_EINVAL invalid argument
1435 * @retval PMINFO_R_ERROR internal error
1436 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1437 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1438 * @see pkgmgrinfo_pkginfo_get_pkgid()
1439 * @see pkgmgrinfo_pkginfo_is_removable()
1441 static int get_pkg_launch_mode(const char *pkgid)
1444 char *launch_mode = NULL;
1445 pkgmgrinfo_pkginfo_h handle;
1446 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1447 if (ret != PMINFO_R_OK)
1449 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1450 if (ret != PMINFO_R_OK) {
1451 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1454 printf("launch mode: %s\n", mode);
1455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1460 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1463 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1464 * @brief This API gets the store client id of package from the package ID
1466 * @par This API is for package-manager client application
1467 * @par Sync (or) Async : Synchronous API
1469 * @param[in] handle pointer to package info handle
1470 * @param[out] storeclientid pointer to hold store client id of package
1471 * @return 0 if success, error code(<0) if fail
1472 * @retval PMINFO_R_OK success
1473 * @retval PMINFO_R_EINVAL invalid argument
1474 * @retval PMINFO_R_ERROR internal error
1475 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1476 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1477 * @see pkgmgrinfo_pkginfo_get_pkgid()
1478 * @see pkgmgrinfo_pkginfo_is_removable()
1480 static int get_pkg_storeclientid(const char *pkgid)
1483 char *storeclientid = 0;
1484 pkgmgrinfo_pkginfo_h handle;
1485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1486 if (ret != PMINFO_R_OK)
1488 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1489 if (ret != PMINFO_R_OK) {
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493 printf(store client id: %s\n", storeclientid);
1494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1499 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1502 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1503 * @brief This API gets the main app id of package from the package ID
1505 * @par This API is for package-manager client application
1506 * @par Sync (or) Async : Synchronous API
1508 * @param[in] handle pointer to package info handle
1509 * @param[out] mainappid pointer to hold main app id of package
1510 * @return 0 if success, error code(<0) if fail
1511 * @retval PMINFO_R_OK success
1512 * @retval PMINFO_R_EINVAL invalid argument
1513 * @retval PMINFO_R_ERROR internal error
1514 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1515 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1516 * @see pkgmgrinfo_pkginfo_get_pkgid()
1517 * @see pkgmgrinfo_pkginfo_is_removable()
1519 static int get_pkg_mainappid(const char *pkgid)
1522 char *mainappid = 0;
1523 pkgmgrinfo_pkginfo_h handle;
1524 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1525 if (ret != PMINFO_R_OK)
1527 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1528 if (ret != PMINFO_R_OK) {
1529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1532 printf(main app id: %s\n", mainappid);
1533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1538 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1541 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1542 * @brief This API gets the url of package from the package ID
1544 * @par This API is for package-manager client application
1545 * @par Sync (or) Async : Synchronous API
1547 * @param[in] handle pointer to package info handle
1548 * @param[out] url pointer to hold url of package
1549 * @return 0 if success, error code(<0) if fail
1550 * @retval PMINFO_R_OK success
1551 * @retval PMINFO_R_EINVAL invalid argument
1552 * @retval PMINFO_R_ERROR internal error
1553 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1554 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1555 * @see pkgmgrinfo_pkginfo_get_pkgid()
1556 * @see pkgmgrinfo_pkginfo_is_removable()
1558 static int get_pkg_url(const char *pkgid)
1562 pkgmgrinfo_pkginfo_h handle;
1563 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1564 if (ret != PMINFO_R_OK)
1566 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1567 if (ret != PMINFO_R_OK) {
1568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1571 printf("url : %s\n", url);
1572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1577 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1580 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1581 * @brief This API gets the root path of package
1583 * @par Sync (or) Async : Synchronous API
1585 * @param[in] handle pointer to package info handle
1586 * @param[out] path pointer to hold root path of package
1587 * @return 0 if success, error code(<0) if fail
1588 * @retval PMINFO_R_OK success
1589 * @retval PMINFO_R_EINVAL invalid argument
1590 * @retval PMINFO_R_ERROR internal error
1592 static int get_root_path(const char *pkgid)
1596 pkgmgrinfo_pkginfo_h handle;
1597 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1598 if (ret != PMINFO_R_OK)
1601 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1602 if (ret != PMINFO_R_OK) {
1603 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1606 printf("path : %s\n", path);
1607 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1617 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1618 * @brief This API gets the csc path of package
1620 * @par Sync (or) Async : Synchronous API
1622 * @param[in] handle pointer to package info handle
1623 * @param[out] path pointer to hold csc path of package
1624 * @return 0 if success, error code(<0) if fail
1625 * @retval PMINFO_R_OK success
1626 * @retval PMINFO_R_EINVAL invalid argument
1627 * @retval PMINFO_R_ERROR internal error
1629 static int get_csc_path(const char *pkgid)
1633 pkgmgrinfo_pkginfo_h handle;
1634 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1635 if (ret != PMINFO_R_OK)
1638 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1639 if (ret != PMINFO_R_OK) {
1640 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1643 printf("path : %s\n", path);
1644 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1653 * @fn int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type)
1654 * @brief This API gets the resource type of package
1656 * @par Sync (or) Async : Synchronous API
1658 * @param[in] handle pointer to package info handle
1659 * @param[out] res_type pointer to hold resource type of package
1660 * @return 0 if success, error code(<0) if fail
1661 * @retval PMINFO_R_OK success
1662 * @retval PMINFO_R_EINVAL invalid argument
1663 * @retval PMINFO_R_ERROR internal error
1665 static int get_res_type(const char *pkgid)
1669 pkgmgrinfo_pkginfo_h handle;
1670 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1671 if (ret != PMINFO_R_OK)
1674 ret = pkgmgrinfo_pkginfo_get_res_type(handle, &res_type);
1675 if (ret != PMINFO_R_OK) {
1676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679 printf("res_type : %s\n", res_type);
1680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1686 int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type);
1689 * @fn int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version)
1690 * @brief This API gets the resource version of package
1692 * @par Sync (or) Async : Synchronous API
1694 * @param[in] handle pointer to package info handle
1695 * @param[out] res_version pointer to hold resource version of package
1696 * @return 0 if success, error code(<0) if fail
1697 * @retval PMINFO_R_OK success
1698 * @retval PMINFO_R_EINVAL invalid argument
1699 * @retval PMINFO_R_ERROR internal error
1701 static int get_res_version(const char *pkgid)
1704 char *res_version = 0;
1705 pkgmgrinfo_pkginfo_h handle;
1706 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1707 if (ret != PMINFO_R_OK)
1710 ret = pkgmgrinfo_pkginfo_get_res_version(handle, &res_version);
1711 if (ret != PMINFO_R_OK) {
1712 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1715 printf("res_version : %s\n", res_version);
1716 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1722 int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version);
1725 * @fn int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode)
1726 * @brief This API gets the light_user_switch_mode of package
1728 * @par Sync (or) Async : Synchronous API
1730 * @param[in] handle pointer to package info handle
1731 * @param[out] mode pointer to hold resource version of package
1732 * @return 0 if success, error code(<0) if fail
1733 * @retval PMINFO_R_OK success
1734 * @retval PMINFO_R_EINVAL invalid argument
1735 * @retval PMINFO_R_ERROR internal error
1737 static int get_light_user_switch_mode(const char *pkgid)
1741 pkgmgrinfo_pkginfo_h handle;
1742 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1743 if (ret != PMINFO_R_OK)
1746 ret = pkgmgrinfo_pkginfo_get_light_user_switch_mode(handle, &mode);
1747 if (ret != PMINFO_R_OK) {
1748 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1751 printf("light_user_switch_mode : %s\n", mode);
1752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1758 int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode);
1761 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1762 * @brief This API gets the support_mode of package
1764 * @par Sync (or) Async : Synchronous API
1766 * @param[in] handle pointer to package info handle
1767 * @param[out] support_mode pointer to hold support_mode of package
1768 * @return 0 if success, error code(<0) if fail
1769 * @retval PMINFO_R_OK success
1770 * @retval PMINFO_R_EINVAL invalid argument
1771 * @retval PMINFO_R_ERROR internal error
1773 static int get_support_mode(const char *pkgid)
1776 int support_mode = 0;
1777 pkgmgrinfo_pkginfo_h handle = NULL;
1778 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1779 if (ret != PMINFO_R_OK)
1782 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1783 if (ret != PMINFO_R_OK) {
1784 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1787 printf("support_mode : %s\n", support_mode);
1788 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1794 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1797 * @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1798 * @brief This API compare the cert information from given package id
1800 * @par This API is for package-manager client application
1801 * @par Sync (or) Async : Synchronous API
1803 * @param[in] lhs_package_id pointer to first package ID
1804 * @param[in] rhs_package_id pointer to second package ID
1805 * @param[out] compare_result pointer to the compare result.
1806 * @return 0 if success, error code(<0) if fail
1807 * @retval PMINFO_R_OK success
1808 * @retval PMINFO_R_EINVAL invalid argument
1809 * @retval PMINFO_R_ERROR internal error
1811 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1812 * @see pkgmgrinfo_pkginfo_get_pkgid()
1813 * @see pkgmgrinfo_pkginfo_is_removable()
1815 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1818 pkgmgrinfo_cert_compare_result_type_e result;
1820 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1821 if (ret != PMINFO_R_OK) {
1824 printf("result: %d\n", result);
1829 int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1830 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1832 * @fn int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1833 * @brief This API compare the cert information from given app id
1835 * @par This API is for package-manager client application
1836 * @par Sync (or) Async : Synchronous API
1838 * @param[in] lhs_app_id pointer to first app ID
1839 * @param[in] rhs_app_id pointer to second app ID
1840 * @param[out] compare_result pointer to the compare result.
1841 * @return 0 if success, error code(<0) if fail
1842 * @retval PMINFO_R_OK success
1843 * @retval PMINFO_R_EINVAL invalid argument
1844 * @retval PMINFO_R_ERROR internal error
1846 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1847 * @see pkgmgrinfo_pkginfo_get_pkgid()
1848 * @see pkgmgrinfo_pkginfo_is_removable()
1850 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1853 pkgmgrinfo_cert_compare_result_type_e result;
1855 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1856 if (ret != PMINFO_R_OK) {
1859 printf("result: %d\n", result);
1864 int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1865 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1867 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1868 * @brief This API gets the package 'removable' value from the package ID
1870 * @par This API is for package-manager client application
1871 * @par Sync (or) Async : Synchronous API
1873 * @param[in] handle pointer to package info handle
1874 * @param[out] removable pointer to hold package removable value
1875 * @return 0 if success, error code(<0) if fail
1876 * @retval PMINFO_R_OK success
1877 * @retval PMINFO_R_EINVAL invalid argument
1878 * @retval PMINFO_R_ERROR internal error
1879 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1880 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1881 * @see pkgmgrinfo_pkginfo_get_pkgid()
1882 * @see pkgmgrinfo_pkginfo_is_readonly()
1884 static int get_pkg_removable(const char *pkgid)
1888 pkgmgrinfo_pkginfo_h handle;
1889 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1890 if (ret != PMINFO_R_OK)
1892 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1893 if (ret != PMINFO_R_OK) {
1894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1897 printf("pkg removable: %d\n", removable);
1898 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1903 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1906 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1907 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1909 * @par This API is for package-manager client application
1910 * @par Sync (or) Async : Synchronous API
1912 * @param[in] handle pointer to package info handle
1913 * @param[out] movable pointer to hold package movable state
1914 * @return 0 if success, error code(<0) if fail
1915 * @retval PMINFO_R_OK success
1916 * @retval PMINFO_R_EINVAL invalid argument
1917 * @retval PMINFO_R_ERROR internal error
1918 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1919 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1920 * @see pkgmgrinfo_pkginfo_get_pkgid()
1922 static int get_pkg_movable(const char *pkgid)
1926 pkgmgrinfo_pkginfo_h handle;
1927 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1928 if (ret != PMINFO_R_OK)
1930 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1931 if (ret != PMINFO_R_OK) {
1932 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1935 printf("pkg movable: %d\n", movable);
1936 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1941 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1944 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1945 * @brief This API gets the package 'preload' value from the package ID
1947 * @par This API is for package-manager client application
1948 * @par Sync (or) Async : Synchronous API
1950 * @param[in] handle pointer to package info handle
1951 * @param[out] preload pointer to hold package preload value
1952 * @return 0 if success, error code(<0) if fail
1953 * @retval PMINFO_R_OK success
1954 * @retval PMINFO_R_EINVAL invalid argument
1955 * @retval PMINFO_R_ERROR internal error
1956 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1957 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1958 * @see pkgmgrinfo_pkginfo_get_pkgid()
1959 * @see pkgmgrinfo_pkginfo_is_readonly()
1961 static int get_pkg_preload(const char *pkgid)
1965 pkgmgrinfo_pkginfo_h handle;
1966 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1967 if (ret != PMINFO_R_OK)
1969 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1970 if (ret != PMINFO_R_OK) {
1971 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1974 printf("pkg preload: %d\n", preload);
1975 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1980 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1983 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1984 * @brief This API gets the value for given handle is system or not
1986 * @par This API is for package-manager client application
1987 * @par Sync (or) Async : Synchronous API
1989 * @param[in] handle pointer to package info handle
1990 * @param[out] system pointer to hold system is or not
1991 * @return 0 if success, error code(<0) if fail
1992 * @retval PMINFO_R_OK success
1993 * @retval PMINFO_R_EINVAL invalid argument
1994 * @retval PMINFO_R_ERROR internal error
1995 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1996 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1997 * @see pkgmgrinfo_pkginfo_get_pkgid()
1998 * @see pkgmgrinfo_pkginfo_is_readonly()
2000 static int get_pkg_system(const char *pkgid)
2003 bool system = false;
2004 pkgmgrinfo_pkginfo_h handle = NULL;
2005 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2006 if (ret != PMINFO_R_OK)
2008 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
2009 if (ret != PMINFO_R_OK) {
2010 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2013 printf("pkg system: %d\n", system);
2014 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2019 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
2022 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
2023 * @brief This API gets the package 'readonly' value from the package ID
2025 * @par This API is for package-manager client application
2026 * @par Sync (or) Async : Synchronous API
2028 * @param[in] handle pointer to package info handle
2029 * @param[out] readonly pointer to hold package readonly value
2030 * @return 0 if success, error code(<0) if fail
2031 * @retval PMINFO_R_OK success
2032 * @retval PMINFO_R_EINVAL invalid argument
2033 * @retval PMINFO_R_ERROR internal error
2034 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2035 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2036 * @see pkgmgrinfo_pkginfo_get_pkgid()
2037 * @see pkgmgrinfo_pkginfo_is_removable()
2039 static int get_pkg_readonly(const char *pkgid)
2043 pkgmgrinfo_pkginfo_h handle;
2044 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2045 if (ret != PMINFO_R_OK)
2047 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
2048 if (ret != PMINFO_R_OK) {
2049 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2052 printf("pkg readonly: %d\n", readonly);
2053 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2058 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
2062 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
2063 * @brief This API gets the package 'update' value from the package ID
2065 * @par This API is for package-manager client application
2066 * @par Sync (or) Async : Synchronous API
2068 * @param[in] handle pointer to package info handle
2069 * @param[out] update pointer to hold package update value
2070 * @return 0 if success, error code(<0) if fail
2071 * @retval PMINFO_R_OK success
2072 * @retval PMINFO_R_EINVAL invalid argument
2073 * @retval PMINFO_R_ERROR internal error
2074 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2075 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2076 * @see pkgmgrinfo_pkginfo_get_pkgid()
2078 static int get_pkg_update(const char *pkgid)
2082 pkgmgrinfo_pkginfo_h handle;
2083 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2084 if (ret != PMINFO_R_OK)
2086 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
2087 if (ret != PMINFO_R_OK) {
2088 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2091 printf("pkg update: %d\n", update);
2092 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2097 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
2100 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
2101 * @brief This API gets the package 'support_disable' value from the package ID
2103 * @par This API is for package-manager client application
2104 * @par Sync (or) Async : Synchronous API
2106 * @param[in] handle pointer to package info handle
2107 * @param[out] support_disable pointer to hold package support_disable value
2108 * @return 0 if success, error code(<0) if fail
2109 * @retval PMINFO_R_OK success
2110 * @retval PMINFO_R_EINVAL invalid argument
2111 * @retval PMINFO_R_ERROR internal error
2112 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2113 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2114 * @see pkgmgrinfo_pkginfo_get_pkgid()
2116 static int get_pkg_support_disable(const char *pkgid)
2119 bool support_disable;
2120 pkgmgrinfo_pkginfo_h handle = NULL;
2121 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2122 if (ret != PMINFO_R_OK)
2124 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2125 if (ret != PMINFO_R_OK) {
2126 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2129 printf("pkg support_disable: %d\n", support_disable);
2130 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2135 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2138 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2139 * @brief This API gets whether the given package is global package or user package
2141 * @par This API is for package-manager client application
2142 * @par Sync (or) Async : Synchronous API
2144 * @param[in] handle pointer to package info handle
2145 * @param[in] global pointer to hold package global value
2146 * @return 0 if success, error code(<0) if fail
2147 * @retval PMINFO_R_OK success
2148 * @retval PMINFO_R_EINVAL invalid argument
2149 * @retval PMINFO_R_ERROR internal error
2150 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2151 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2152 * @see pkgmgrinfo_pkginfo_get_pkgid()
2153 static int get_pkg_support_disable(const char *pkgid)
2157 pkgmgrinfo_pkginfo_h handle = NULL;
2158 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2159 if (ret != PMINFO_R_OK)
2161 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2162 if (ret != PMINFO_R_OK) {
2163 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2166 printf("pkg is_global: %d\n", global);
2167 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2172 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2175 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2176 * @brief This API gets the package 'accessible' value from the package ID
2178 * @par This API is for package-manager client application
2179 * @par Sync (or) Async : Synchronous API
2181 * @param[in] handle pointer to package info handle
2182 * @param[out] accessible pointer to hold package accessible value
2183 * @return 0 if success, error code(<0) if fail
2184 * @retval PMINFO_R_OK success
2185 * @retval PMINFO_R_EINVAL invalid argument
2186 * @retval PMINFO_R_ERROR internal error
2187 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2188 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2189 * @see pkgmgrinfo_pkginfo_get_pkgid()
2190 * @see pkgmgrinfo_pkginfo_is_readonly()
2192 static int get_pkg_accessible(const char *pkgid)
2196 pkgmgrinfo_pkginfo_h handle;
2197 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2198 if (ret != PMINFO_R_OK)
2200 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2201 if (ret != PMINFO_R_OK) {
2202 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2205 printf("pkg accessible: %d\n", accessible);
2206 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2211 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2214 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2215 * @brief This API destroys the package information handle freeing up all the resources
2217 * @par This API is for package-manager client application
2218 * @par Sync (or) Async : Synchronous API
2220 * @param[in] handle pointer to the package info handle
2221 * @return 0 if success, error code(<0) if fail
2222 * @retval PMINFO_R_OK success
2223 * @retval PMINFO_R_EINVAL invalid argument
2224 * @retval PMINFO_R_ERROR internal error
2225 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2227 * @see pkgmgrinfo_pkginfo_get_pkgid()
2228 * @see pkgmgrinfo_pkginfo_is_removable()
2230 static int get_pkg_type(const char *pkgid)
2234 pkgmgrinfo_pkginfo_h handle;
2235 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2236 if (ret != PMINFO_R_OK)
2238 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2239 if (ret != PMINFO_R_OK) {
2240 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2243 printf("pkgtype: %s\n", type);
2244 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2249 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2252 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2253 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2254 The query will search the entire package information collected from the manifest file of all the installed packages
2256 * @par This API is for package-manager client application
2257 * @par Sync (or) Async : Synchronous API
2259 * @param[out] handle pointer to the package info filter handle.
2260 * @return 0 if success, error code(<0) if fail
2261 * @retval PMINFO_R_OK success
2262 * @retval PMINFO_R_EINVAL invalid argument
2263 * @retval PMINFO_R_ERROR internal error
2265 * @post pkgmgrinfo_pkginfo_filter_destroy()
2266 * @see pkgmgrinfo_pkginfo_filter_count()
2267 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2269 static int get_tpk_pkg_count()
2273 pkgmgrinfo_pkginfo_filter_h handle;
2274 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2275 if (ret != PMINFO_R_OK)
2277 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2278 if (ret != PMINFO_R_OK) {
2279 pkgmgrinfo_pkginfo_filter_destroy(handle);
2282 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2283 if (ret != PMINFO_R_OK) {
2284 pkgmgrinfo_pkginfo_filter_destroy(handle);
2287 printf("No of tpk pkgs: %d\n", count);
2288 pkgmgrinfo_pkginfo_filter_destroy(handle);
2293 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2296 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2297 * @brief This API destroys the package information filter handle freeing up all the resources
2299 * @par This API is for package-manager client application
2300 * @par Sync (or) Async : Synchronous API
2302 * @param[in] handle pointer to the package info filter handle.
2303 * @return 0 if success, error code(<0) if fail
2304 * @retval PMINFO_R_OK success
2305 * @retval PMINFO_R_EINVAL invalid argument
2306 * @retval PMINFO_R_ERROR internal error
2307 * @pre pkgmgrinfo_pkginfo_filter_create()
2309 * @see pkgmgrinfo_pkginfo_filter_count()
2310 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2312 static int get_tpk_pkg_count()
2316 pkgmgrinfo_pkginfo_filter_h handle;
2317 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2318 if (ret != PMINFO_R_OK)
2320 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2321 if (ret != PMINFO_R_OK) {
2322 pkgmgrinfo_pkginfo_filter_destroy(handle);
2325 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2326 if (ret != PMINFO_R_OK) {
2327 pkgmgrinfo_pkginfo_filter_destroy(handle);
2330 printf("No of tpk pkgs: %d\n", count);
2331 pkgmgrinfo_pkginfo_filter_destroy(handle);
2336 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2339 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2340 * @brief This API adds a boolean filter property to the filter handle
2342 * @par This API is for package-manager client application
2343 * @par Sync (or) Async : Synchronous API
2345 * @param[in] handle pointer to the package info filter handle.
2346 * @param[in] property boolean property name.
2347 * @param[in] value value corresponding to the property.
2348 * @return 0 if success, error code(<0) if fail
2349 * @retval PMINFO_R_OK success
2350 * @retval PMINFO_R_EINVAL invalid argument
2351 * @retval PMINFO_R_ERROR internal error
2352 * @pre pkgmgrinfo_pkginfo_filter_create()
2353 * @post pkgmgrinfo_pkginfo_filter_destroy()
2354 * @see pkgmgrinfo_pkginfo_filter_count()
2355 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2357 static int get_preload_pkg_count()
2361 pkgmgrinfo_pkginfo_filter_h handle;
2362 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2363 if (ret != PMINFO_R_OK)
2365 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2366 if (ret != PMINFO_R_OK) {
2367 pkgmgrinfo_pkginfo_filter_destroy(handle);
2370 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2371 if (ret != PMINFO_R_OK) {
2372 pkgmgrinfo_pkginfo_filter_destroy(handle);
2375 printf("No of preload pkgs: %d\n", count);
2376 pkgmgrinfo_pkginfo_filter_destroy(handle);
2381 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2382 const char *property, const bool value);
2385 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2386 * @brief This API adds an integer filter property to the filter handle
2388 * @par This API is for package-manager client application
2389 * @par Sync (or) Async : Synchronous API
2391 * @param[in] handle pointer to the package info filter handle.
2392 * @param[in] property integer property name.
2393 * @param[in] value value corresponding to the property.
2394 * @return 0 if success, error code(<0) if fail
2395 * @retval PMINFO_R_OK success
2396 * @retval PMINFO_R_EINVAL invalid argument
2397 * @retval PMINFO_R_ERROR internal error
2398 * @pre pkgmgrinfo_pkginfo_filter_create()
2399 * @post pkgmgrinfo_pkginfo_filter_destroy()
2400 * @see pkgmgrinfo_pkginfo_filter_count()
2401 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2403 static int get_pkg_count()
2407 pkgmgrinfo_pkginfo_filter_h handle;
2408 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2409 if (ret != PMINFO_R_OK)
2411 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2412 if (ret != PMINFO_R_OK) {
2413 pkgmgrinfo_pkginfo_filter_destroy(handle);
2416 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2417 if (ret != PMINFO_R_OK) {
2418 pkgmgrinfo_pkginfo_filter_destroy(handle);
2421 printf("No of preload pkgs: %d\n", count);
2422 pkgmgrinfo_pkginfo_filter_destroy(handle);
2427 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2428 const char *property, const int value);
2431 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2432 * @brief This API adds a string filter property to the filter handle
2434 * @par This API is for package-manager client application
2435 * @par Sync (or) Async : Synchronous API
2437 * @param[in] handle pointer to the package info filter handle.
2438 * @param[in] property string property name.
2439 * @param[in] value value corresponding to the property.
2440 * @return 0 if success, error code(<0) if fail
2441 * @retval PMINFO_R_OK success
2442 * @retval PMINFO_R_EINVAL invalid argument
2443 * @retval PMINFO_R_ERROR internal error
2444 * @pre pkgmgrinfo_pkginfo_filter_create()
2445 * @post pkgmgrinfo_pkginfo_filter_destroy()
2446 * @see pkgmgrinfo_pkginfo_filter_count()
2447 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2449 static int get_tpk_pkg_count()
2453 pkgmgrinfo_pkginfo_filter_h handle;
2454 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2455 if (ret != PMINFO_R_OK)
2457 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2458 if (ret != PMINFO_R_OK) {
2459 pkgmgrinfo_pkginfo_filter_destroy(handle);
2462 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2463 if (ret != PMINFO_R_OK) {
2464 pkgmgrinfo_pkginfo_filter_destroy(handle);
2467 printf("No of tpk pkgs: %d\n", count);
2468 pkgmgrinfo_pkginfo_filter_destroy(handle);
2473 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2474 const char *property, const char *value);
2477 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2478 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2480 * @par This API is for package-manager client application
2481 * @par Sync (or) Async : Synchronous API
2483 * @param[in] handle pointer to the package info filter handle.
2484 * @param[in] pkg_cb callback function.
2485 * @param[in] user_data user data to be passed to the callback function
2486 * @return 0 if success, error code(<0) if fail
2487 * @retval PMINFO_R_OK success
2488 * @retval PMINFO_R_EINVAL invalid argument
2489 * @retval PMINFO_R_ERROR internal error
2490 * @pre pkgmgrinfo_pkginfo_filter_create()
2491 * @post pkgmgrinfo_pkginfo_filter_destroy()
2492 * @see pkgmgrinfo_pkginfo_filter_count()
2494 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2497 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2498 printf("pkg id : %s\n", pkgid);
2502 static int get_tpk_pkg_list()
2505 pkgmgrinfo_pkginfo_filter_h handle;
2506 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2507 if (ret != PMINFO_R_OK)
2509 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2510 if (ret != PMINFO_R_OK) {
2511 pkgmgrinfo_pkginfo_filter_destroy(handle);
2514 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2515 if (ret != PMINFO_R_OK) {
2516 pkgmgrinfo_pkginfo_filter_destroy(handle);
2519 pkgmgrinfo_pkginfo_filter_destroy(handle);
2524 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2525 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2526 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2527 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2530 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2531 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2532 * @brief This API counts the package that satisfy the filter conditions
2534 * @par This API is for package-manager client application
2535 * @par Sync (or) Async : Synchronous API
2537 * @param[in] handle pointer to the package info filter handle.
2538 * @param[in] count pointer to store the count value.
2539 * @param[in] uid the addressee user id of the instruction
2540 * @return 0 if success, error code(<0) if fail
2541 * @retval PMINFO_R_OK success
2542 * @retval PMINFO_R_EINVAL invalid argument
2543 * @retval PMINFO_R_ERROR internal error
2544 * @pre pkgmgrinfo_pkginfo_filter_create()
2545 * @post pkgmgrinfo_pkginfo_filter_destroy()
2546 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2548 static int get_tpk_pkg_count()
2552 pkgmgrinfo_pkginfo_filter_h handle;
2553 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2554 if (ret != PMINFO_R_OK)
2556 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2557 if (ret != PMINFO_R_OK) {
2558 pkgmgrinfo_pkginfo_filter_destroy(handle);
2561 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2562 if (ret != PMINFO_R_OK) {
2563 pkgmgrinfo_pkginfo_filter_destroy(handle);
2566 printf("No of tpk pkgs: %d\n", count);
2567 pkgmgrinfo_pkginfo_filter_destroy(handle);
2572 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2573 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2576 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2577 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2578 * @brief This API gets the list of privilege for a particular package
2580 * @par This API is for package-manager client application
2581 * @par Sync (or) Async : Synchronous API
2582 * @param[in] handle pointer to the package info handle.
2583 * @param[in] privilege_func callback function for list
2584 * @param[in] user_data user data to be passed to callback function
2585 * @return 0 if success, error code(<0) if fail
2586 * @retval PMINFO_R_OK success
2587 * @retval PMINFO_R_EINVAL invalid argument
2588 * @retval PMINFO_R_ERROR internal error
2589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2590 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2592 int privilege_func(const char *name, void *user_data)
2594 if (strcmp(name, (char *)user_data) == 0)
2600 static int list_privilege(const char *package, char *privilege)
2603 pkgmgrinfo_pkginfo_h handle;
2604 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2605 if (ret != PMINFO_R_OK)
2607 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2608 if (ret != PMINFO_R_OK) {
2609 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2617 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2618 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2621 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2622 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2623 * @brief This API gets the list of appdefined privilege for a particular package
2625 * @par This API is for package-manager client application
2626 * @par Sync (or) Async : Synchronous API
2627 * @param[in] handle pointer to the package info handle.
2628 * @param[in] privilege_func callback function for list
2629 * @param[in] user_data user data to be passed to callback function
2630 * @return 0 if success, error code(<0) if fail
2631 * @retval PMINFO_R_OK success
2632 * @retval PMINFO_R_EINVAL invalid argument
2633 * @retval PMINFO_R_ERROR internal error
2634 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2635 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2637 int privilege_func(const char *name, const char *license_path, void *user_data)
2639 printf("appdefined privilege : %s", name);
2641 printf("licensed privilege, lecense path : %s", license_path);
2645 static int list_appdefined_privilege(const char *package)
2648 pkgmgrinfo_pkginfo_h handle;
2649 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2650 if (ret != PMINFO_R_OK)
2652 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2653 if (ret != PMINFO_R_OK) {
2654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2657 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2662 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2663 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2666 * @fn int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2667 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2668 * @brief This API gets the list of plugin execution info for a particular package
2670 * @par This API is for package-manager client application
2671 * @par Sync (or) Async : Synchronous API
2672 * @param[in] handle pointer to the package info handle.
2673 * @param[in] plugin_func callback function for list
2674 * @param[in] user_data user data to be passed to callback function
2675 * @return 0 if success, error code(<0) if fail
2676 * @retval PMINFO_R_OK success
2677 * @retval PMINFO_R_EINVAL invalid argument
2678 * @retval PMINFO_R_ERROR internal error
2679 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2680 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2682 int plugin_func(const char *pkgid, const char *appid,
2683 const char *plugin_type, const char *plugin_name,
2686 printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2691 static int list_plugin(const char *package)
2694 pkgmgrinfo_pkginfo_h handle;
2695 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2696 if (ret != PMINFO_R_OK)
2698 ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2699 if (ret != PMINFO_R_OK) {
2700 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2703 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2708 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2709 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2711 /* TODO: add doxygen comment here */
2712 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2715 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2716 * @brief This API copy the application information handle
2718 * @par This API is for package-manager client application
2719 * @par Sync (or) Async : Synchronous API
2721 * @param[in] handle pointer to the package info handle.
2722 * @param[out] handle pointer to the package info handle.
2723 * @return 0 if success, error code(<0) if fail
2724 * @retval PMINFO_R_OK success
2725 * @retval PMINFO_R_EINVAL invalid argument
2726 * @retval PMINFO_R_ERROR internal error
2728 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2730 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2734 pkgmgrinfo_pkginfo_h clone;
2736 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2737 if (ret != PMINFO_R_OK)
2741 printf("package: %s\n", clone->package);
2742 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2747 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2751 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2752 pkgmgrinfo_app_list_cb app_func, void *user_data)
2753 * @brief This API gets list of installed applications for a particular package
2755 * @par This API is for package-manager client application
2756 * @par Sync (or) Async : Synchronous API
2757 * @param[in] handle package info handle
2758 * @param[in] component application component
2759 * @param[in] app_func iteration function for list
2760 * @param[in] user_data user data to be passed to callback function
2761 * @return 0 if success, error code(<0) if fail
2762 * @retval PMINFO_R_OK success
2763 * @retval PMINFO_R_EINVAL invalid argument
2764 * @retval PMINFO_R_ERROR internal error
2765 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2766 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2768 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2771 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2772 printf("appid : %s\n", appid);
2776 static int list_apps(const char *pkgid)
2779 pkgmgrinfo_pkginfo_h handle;
2780 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2781 if (ret != PMINFO_R_OK)
2783 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2784 if (ret != PMINFO_R_OK) {
2785 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2788 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2793 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2794 pkgmgrinfo_app_list_cb app_func, void *user_data);
2795 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2796 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2799 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2800 * @brief This API gets list of installed applications from all packages.
2802 * @par This API is for package-manager client application
2803 * @par Sync (or) Async : Synchronous API
2804 * @param[in] app_func iteration function for list
2805 * @param[in] user_data user data to be passed to callback function
2806 * @return 0 if success, error code(<0) if fail
2807 * @retval PMINFO_R_OK success
2808 * @retval PMINFO_R_EINVAL invalid argument
2809 * @retval PMINFO_R_ERROR internal error
2813 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2815 char *pkgid1 = NULL;
2816 char *pkgid2 = NULL;
2817 pkgid1 = (char *)user_data;
2818 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2819 if (strcmp(pkgid1, pkgid2) == 0) {
2826 static int list_apps()
2829 char *name = "helloworld";
2830 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2831 if (ret != PMINFO_R_OK) {
2838 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2839 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2842 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2843 * @brief This API creates the disabled application information handle from db
2845 * @par This API is for package-manager client application
2846 * @par Sync (or) Async : Synchronous API
2848 * @param[in] appid pointer to appid
2849 * @param[out] handle pointer to the application info handle.
2850 * @return 0 if success, error code(<0) if fail
2851 * @retval PMINFO_R_OK success
2852 * @retval PMINFO_R_EINVAL invalid argument
2853 * @retval PMINFO_R_ERROR internal error
2855 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2856 * @see pkgmgrinfo_appinfo_get_pkgid()
2857 * @see pkgmgrinfo_appinfo_is_multiple()
2859 static int get_disabled_app_type(const char *appid)
2863 pkgmgrinfo_appinfo_h handle;
2864 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2865 if (ret != PMINFO_R_OK)
2867 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2868 if (ret != PMINFO_R_OK) {
2869 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2872 printf("apptype: %s\n", type);
2873 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2878 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2879 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2882 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2883 * @brief This API creates the application information handle from db
2885 * @par This API is for package-manager client application
2886 * @par Sync (or) Async : Synchronous API
2888 * @param[in] appid pointer to appid
2889 * @param[out] handle pointer to the application info handle.
2890 * @return 0 if success, error code(<0) if fail
2891 * @retval PMINFO_R_OK success
2892 * @retval PMINFO_R_EINVAL invalid argument
2893 * @retval PMINFO_R_ERROR internal error
2895 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2896 * @see pkgmgrinfo_appinfo_get_pkgid()
2897 * @see pkgmgrinfo_appinfo_is_multiple()
2899 static int get_app_type(const char *appid)
2903 pkgmgrinfo_appinfo_h handle;
2904 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2905 if (ret != PMINFO_R_OK)
2907 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2908 if (ret != PMINFO_R_OK) {
2909 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2912 printf("apptype: %s\n", type);
2913 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2918 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2919 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2922 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2923 * @brief This API creates the application information handle from db regardless of its disable or storage status
2925 * @par This API is for package-manager client application
2926 * @par Sync (or) Async : Synchronous API
2928 * @param[in] appid pointer to appid
2929 * @param[out] handle pointer to the application info handle.
2930 * @return 0 if success, error code(<0) if fail
2931 * @retval PMINFO_R_OK success
2932 * @retval PMINFO_R_EINVAL invalid argument
2933 * @retval PMINFO_R_ERROR internal error
2935 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2936 * @see pkgmgrinfo_appinfo_get_pkgid()
2937 * @see pkgmgrinfo_appinfo_is_multiple()
2939 static int get_app_type(const char *appid)
2943 pkgmgrinfo_appinfo_h handle;
2944 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2945 if (ret != PMINFO_R_OK)
2947 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2948 if (ret != PMINFO_R_OK) {
2949 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2952 printf("apptype: %s\n", type);
2953 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2958 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2959 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2962 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2963 * @brief This API gets the application ID
2965 * @par This API is for package-manager client application
2966 * @par Sync (or) Async : Synchronous API
2968 * @param[in] handle pointer to the application info handle.
2969 * @param[out] appid pointer to hold appid
2970 * @return 0 if success, error code(<0) if fail
2971 * @retval PMINFO_R_OK success
2972 * @retval PMINFO_R_EINVAL invalid argument
2973 * @retval PMINFO_R_ERROR internal error
2974 * @pre pkgmgrinfo_appinfo_get_appinfo()
2975 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2976 * @see pkgmgrinfo_appinfo_get_pkgid()
2977 * @see pkgmgrinfo_appinfo_is_multiple()
2979 static int get_app_id(const char *appid)
2982 char *app_id = NULL;
2983 pkgmgrinfo_appinfo_h handle;
2984 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2985 if (ret != PMINFO_R_OK)
2987 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2988 if (ret != PMINFO_R_OK) {
2989 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2992 printf("app id: %s\n", app_id);
2993 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2998 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
3001 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
3002 * @brief This API gets the package name of the application
3004 * @par This API is for package-manager client application
3005 * @par Sync (or) Async : Synchronous API
3007 * @param[in] handle pointer to the application info handle.
3008 * @param[out] pkg_name pointer to hold package name
3009 * @return 0 if success, error code(<0) if fail
3010 * @retval PMINFO_R_OK success
3011 * @retval PMINFO_R_EINVAL invalid argument
3012 * @retval PMINFO_R_ERROR internal error
3013 * @pre pkgmgrinfo_appinfo_get_appinfo()
3014 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3015 * @see pkgmgrinfo_appinfo_get_appid()
3016 * @see pkgmgrinfo_appinfo_is_multiple()
3018 static int get_app_pkgname(const char *appid)
3021 char *pkgname = NULL;
3022 pkgmgrinfo_appinfo_h handle;
3023 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3024 if (ret != PMINFO_R_OK)
3026 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
3027 if (ret != PMINFO_R_OK) {
3028 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3031 printf("pkg name: %s\n", pkgname);
3032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3037 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
3040 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
3041 * @brief This API gets the package id of the application
3043 * @par This API is for package-manager client application
3044 * @par Sync (or) Async : Synchronous API
3046 * @param[in] handle pointer to the application info handle.
3047 * @param[out] pkgid pointer to hold package id
3048 * @return 0 if success, error code(<0) if fail
3049 * @retval PMINFO_R_OK success
3050 * @retval PMINFO_R_EINVAL invalid argument
3051 * @retval PMINFO_R_ERROR internal error
3052 * @pre pkgmgrinfo_appinfo_get_appinfo()
3053 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3054 * @see pkgmgrinfo_appinfo_get_appid()
3055 * @see pkgmgrinfo_appinfo_is_multiple()
3057 static int get_app_pkgid(const char *appid)
3061 pkgmgrinfo_appinfo_h handle;
3062 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3063 if (ret != PMINFO_R_OK)
3065 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
3066 if (ret != PMINFO_R_OK) {
3067 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3070 printf("pkg id: %s\n", pkgid);
3071 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3076 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
3079 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
3080 * @brief This API gets the package type of the application
3082 * @par This API is for package-manager client application
3083 * @par Sync (or) Async : Synchronous API
3085 * @param[in] handle pointer to the application info handle.
3086 * @param[out] pkgtype pointer to hold package type
3087 * @return 0 if success, error code(<0) if fail
3088 * @retval PMINFO_R_OK success
3089 * @retval PMINFO_R_EINVAL invalid argument
3090 * @retval PMINFO_R_ERROR internal error
3091 * @pre pkgmgrinfo_appinfo_get_appinfo()
3092 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3093 * @see pkgmgrinfo_appinfo_get_appid()
3094 * @see pkgmgrinfo_appinfo_is_multiple()
3096 static int get_app_pkgtype(const char *appid)
3099 char *pkgtype = NULL;
3100 pkgmgrinfo_appinfo_h handle = NULL;
3101 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3102 if (ret != PMINFO_R_OK)
3104 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
3105 if (ret != PMINFO_R_OK) {
3106 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3109 printf("pkgtype: %s\n", pkgtype);
3110 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3115 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
3118 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3119 * @brief This API gets the executable name of the application
3121 * @par This API is for package-manager client application
3122 * @par Sync (or) Async : Synchronous API
3124 * @param[in] handle pointer to the application info handle.
3125 * @param[out] exec pointer to hold app exec name
3126 * @return 0 if success, error code(<0) if fail
3127 * @retval PMINFO_R_OK success
3128 * @retval PMINFO_R_EINVAL invalid argument
3129 * @retval PMINFO_R_ERROR internal error
3130 * @pre pkgmgrinfo_appinfo_get_appinfo()
3131 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3132 * @see pkgmgrinfo_appinfo_get_appid()
3133 * @see pkgmgrinfo_appinfo_is_multiple()
3135 static int get_app_exec(const char *appid)
3139 pkgmgrinfo_appinfo_h handle;
3140 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3141 if (ret != PMINFO_R_OK)
3143 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3144 if (ret != PMINFO_R_OK) {
3145 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3148 printf("exec name: %s\n", exec);
3149 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3154 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
3157 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3158 * @brief This API gets the icon name of the application
3160 * @par This API is for package-manager client application
3161 * @par Sync (or) Async : Synchronous API
3163 * @param[in] handle pointer to the application info handle.
3164 * @param[out] icon pointer to hold app icon name
3165 * @return 0 if success, error code(<0) if fail
3166 * @retval PMINFO_R_OK success
3167 * @retval PMINFO_R_EINVAL invalid argument
3168 * @retval PMINFO_R_ERROR internal error
3169 * @pre pkgmgrinfo_appinfo_get_appinfo()
3170 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3171 * @see pkgmgrinfo_appinfo_get_appid()
3172 * @see pkgmgrinfo_appinfo_is_multiple()
3174 static int get_app_icon(const char *appid)
3178 pkgmgrinfo_appinfo_h handle;
3179 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3180 if (ret != PMINFO_R_OK)
3182 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3183 if (ret != PMINFO_R_OK) {
3184 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3187 printf("icon name: %s\n", icon);
3188 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3193 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3196 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3197 * @brief This API gets the label of the application
3199 * @par This API is for package-manager client application
3200 * @par Sync (or) Async : Synchronous API
3202 * @param[in] handle pointer to the application info handle.
3203 * @param[out] label pointer to hold app label
3204 * @return 0 if success, error code(<0) if fail
3205 * @retval PMINFO_R_OK success
3206 * @retval PMINFO_R_EINVAL invalid argument
3207 * @retval PMINFO_R_ERROR internal error
3208 * @pre pkgmgrinfo_appinfo_get_appinfo()
3209 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3210 * @see pkgmgrinfo_appinfo_get_appid()
3211 * @see pkgmgrinfo_appinfo_is_multiple()
3213 static int get_app_label(const char *appid)
3217 pkgmgrinfo_appinfo_h handle;
3218 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3219 if (ret != PMINFO_R_OK)
3221 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3222 if (ret != PMINFO_R_OK) {
3223 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3226 printf("label : %s\n", label);
3227 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3232 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3235 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3236 * @brief This API gets exactly matched label by given appid and locale
3238 * @par This API is for package-manager client application
3239 * @par Sync (or) Async : Synchronous API
3241 * @param[in] appid pointer to appid
3242 * @param[in] locale pointer to locale
3243 * @param[out] label pointer to hold app label
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
3249 static int get_localed_label(const char *appid, const char *locale)
3254 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3255 if (ret != PMINFO_R_OK)
3258 printf("localed label: %s\n", label);
3266 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3267 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3270 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3271 * @brief This API gets metadata value by given metadata key
3273 * @par This API is for package-manager client application
3274 * @par Sync (or) Async : Synchronous API
3276 * @param[in] handle pointer to the application info handle
3277 * @param[in] metadata_key metadata key
3278 * @param[out] metadata_value pointer to hold metadata value
3279 * @return 0 if success, error code(<0) if fail
3280 * @retval PMINFO_R_OK success
3281 * @retval PMINFO_R_EINVAL invalid argument
3283 static int get_metadata_value(const char *appid, const char *metadata_key)
3286 pkgmgrinfo_appinfo_h handle = NULL;
3287 char *metadata_value = NULL;
3289 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3290 if (ret != PMINFO_R_OK)
3293 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3294 if (ret != PMINFO_R_OK) {
3295 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3304 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3307 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3308 * @brief This API gets the component of the application
3310 * @par This API is for package-manager client application
3311 * @par Sync (or) Async : Synchronous API
3313 * @param[in] handle pointer to the application info handle.
3314 * @param[out] component pointer to hold app component
3315 * @return 0 if success, error code(<0) if fail
3316 * @retval PMINFO_R_OK success
3317 * @retval PMINFO_R_EINVAL invalid argument
3318 * @retval PMINFO_R_ERROR internal error
3319 * @pre pkgmgrinfo_appinfo_get_appinfo()
3320 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3321 * @see pkgmgrinfo_appinfo_get_appid()
3322 * @see pkgmgrinfo_appinfo_is_multiple()
3324 static int get_app_component(const char *appid)
3327 pkgmgrinfo_app_component component;
3328 pkgmgrinfo_appinfo_h handle;
3329 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3330 if (ret != PMINFO_R_OK)
3332 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3333 if (ret != PMINFO_R_OK) {
3334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3337 printf("component : %s\n", component);
3338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3343 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3346 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3347 * @brief This API gets the apptype of the application
3349 * @par This API is for package-manager client application
3350 * @par Sync (or) Async : Synchronous API
3352 * @param[in] handle pointer to the application info handle.
3353 * @param[out] app_type pointer to hold apptype
3354 * @return 0 if success, error code(<0) if fail
3355 * @retval PMINFO_R_OK success
3356 * @retval PMINFO_R_EINVAL invalid argument
3357 * @retval PMINFO_R_ERROR internal error
3358 * @pre pkgmgrinfo_appinfo_get_appinfo()
3359 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3360 * @see pkgmgrinfo_appinfo_get_appid()
3361 * @see pkgmgrinfo_appinfo_is_multiple()
3363 static int get_app_type(const char *appid)
3366 char *apptype = NULL;
3367 pkgmgrinfo_appinfo_h handle;
3368 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3369 if (ret != PMINFO_R_OK)
3371 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3372 if (ret != PMINFO_R_OK) {
3373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3376 printf("apptype : %s\n", apptype);
3377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3382 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3385 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3386 * @brief This API gets the notification icon of the application
3388 * @par This API is for package-manager client application
3389 * @par Sync (or) Async : Synchronous API
3391 * @param[in] handle pointer to the application info handle.
3392 * @param[out] path pointer to hold notification icon
3393 * @return 0 if success, error code(<0) if fail
3394 * @retval PMINFO_R_OK success
3395 * @retval PMINFO_R_EINVAL invalid argument
3396 * @retval PMINFO_R_ERROR internal error
3397 * @pre pkgmgrinfo_appinfo_get_appinfo()
3398 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3399 * @see pkgmgrinfo_appinfo_get_appid()
3400 * @see pkgmgrinfo_appinfo_is_multiple()
3402 static int get_app_notification_icon(const char *appid)
3405 char *notification_icon = NULL;
3406 pkgmgrinfo_appinfo_h handle;
3407 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3408 if (ret != PMINFO_R_OK)
3410 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3411 if (ret != PMINFO_R_OK) {
3412 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3415 printf("notification icon : %s\n", notification_icon);
3416 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3421 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3424 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3425 * @brief This API gets the type of recent image on app-tray
3427 * @par This API is for package-manager client application
3428 * @par Sync (or) Async : Synchronous API
3430 * @param[in] handle pointer to the application info handle.
3431 * @param[out] type pointer to hold image type
3432 * @return 0 if success, error code(<0) if fail
3433 * @retval PMINFO_R_OK success
3434 * @retval PMINFO_R_EINVAL invalid argument
3435 * @retval PMINFO_R_ERROR internal error
3436 * @pre pkgmgrinfo_appinfo_get_appinfo()
3437 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3438 * @see pkgmgrinfo_appinfo_get_appid()
3439 * @see pkgmgrinfo_appinfo_is_multiple()
3441 static int get_app_recent_image_type(const char *appid)
3444 pkgmgrinfo_app_recentimage type;
3445 pkgmgrinfo_appinfo_h handle;
3446 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3447 if (ret != PMINFO_R_OK)
3449 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3450 if (ret != PMINFO_R_OK) {
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3454 printf("recent image type: %d\n", type);
3455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3460 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3464 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3465 * @brief This API gets the preview image of application
3467 * @par Sync (or) Async : Synchronous API
3469 * @param[in] handle pointer to the application info handle.
3470 * @param[out] preview_img pointer to hold preview image path
3471 * @return 0 if success, error code(<0) if fail
3472 * @retval PMINFO_R_OK success
3473 * @retval PMINFO_R_EINVAL invalid argument
3474 * @retval PMINFO_R_ERROR internal error
3475 * @pre pkgmgrinfo_appinfo_get_appinfo()
3476 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3477 * @see pkgmgrinfo_appinfo_get_appid()
3479 static int get_app_previewimage(const char *appid)
3482 char *preview = NULL;
3483 pkgmgrinfo_appinfo_h handle = NULL;
3484 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3485 if (ret != PMINFO_R_OK)
3487 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3488 if (ret != PMINFO_R_OK) {
3489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3492 printf("preview image path : %s\n", preview);
3493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3498 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3502 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3503 * @brief This API gets the package permission type of the application
3505 * @par This API is for package-manager client application
3506 * @par Sync (or) Async : Synchronous API
3508 * @param[in] handle pointer to the application info handle.
3509 * @param[out] permission pointer to hold package permission
3510 * @return 0 if success, error code(<0) if fail
3511 * @retval PMINFO_R_OK success
3512 * @retval PMINFO_R_EINVAL invalid argument
3513 * @retval PMINFO_R_ERROR internal error
3514 * @pre pkgmgrinfo_appinfo_get_appinfo()
3515 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3516 * @see pkgmgrinfo_appinfo_get_appid()
3518 static int get_app_permission(const char *appid)
3521 pkgmgrinfo_permission_type permission = 0;
3522 pkgmgrinfo_appinfo_h handle;
3524 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3525 if (ret != PMINFO_R_OK)
3527 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3528 if (ret != PMINFO_R_OK) {
3529 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3532 printf("permission type: %d\n", permission);
3533 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3538 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3541 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3542 * @brief This API gets the component_type
3544 * @par This API is for package-manager client application
3545 * @par Sync (or) Async : Synchronous API
3547 * @param[in] handle pointer to the application info handle.
3548 * @param[out] component_type pointer to hold component_type
3549 * @return 0 if success, error code(<0) if fail
3550 * @retval PMINFO_R_OK success
3551 * @retval PMINFO_R_EINVAL invalid argument
3552 * @retval PMINFO_R_ERROR internal error
3553 * @pre pkgmgrinfo_appinfo_get_appinfo()
3554 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3555 * @see pkgmgrinfo_appinfo_get_pkgid()
3556 * @see pkgmgrinfo_appinfo_is_multiple()
3558 static int get_component_type(const char *appid)
3561 char *component_type = NULL;
3562 pkgmgrinfo_appinfo_h handle;
3563 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3564 if (ret != PMINFO_R_OK)
3566 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3567 if (ret != PMINFO_R_OK) {
3568 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3571 printf("component_type: %s\n", component_type);
3572 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3577 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3580 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3581 * @brief This API gets the application 'hwacceleration' value from the app ID
3583 * @par This API is for package-manager client application
3584 * @par Sync (or) Async : Synchronous API
3586 * @param[in] handle pointer to application info handle
3587 * @param[out] hwacceleration pointer to hold package hwacceleration value
3588 * @return 0 if success, error code(<0) if fail
3589 * @retval PMINFO_R_OK success
3590 * @retval PMINFO_R_EINVAL invalid argument
3591 * @retval PMINFO_R_ERROR internal error
3592 * @pre pkgmgrinfo_appinfo_get_appinfo()
3593 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3594 * @see pkgmgrinfo_appinfo_get_appid()
3595 * @see pkgmgrinfo_appinfo_is_multiple()
3597 static int get_app_hwacceleration(const char *appid)
3600 pkgmgrinfo_app_hwacceleration hwacceleration;
3601 pkgmgrinfo_appinfo_h handle;
3602 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3603 if (ret != PMINFO_R_OK)
3605 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3606 if (ret != PMINFO_R_OK) {
3607 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3610 printf("app hwacceleration: %d\n", hwacceleration);
3611 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3616 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3619 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3620 * @brief This API gets the application 'screenreader' value from the app ID
3622 * @par This API is for package-manager client application
3623 * @par Sync (or) Async : Synchronous API
3625 * @param[in] handle pointer to application info handle
3626 * @param[out] screenreader pointer to hold package accessibility value
3627 * @return 0 if success, error code(<0) if fail
3628 * @retval PMINFO_R_OK success
3629 * @retval PMINFO_R_EINVAL invalid argument
3630 * @retval PMINFO_R_ERROR internal error
3631 * @pre pkgmgrinfo_appinfo_get_appinfo()
3632 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3633 * @see pkgmgrinfo_appinfo_get_appid()
3634 * @see pkgmgrinfo_appinfo_is_multiple()
3636 static int get_app_screenreader(const char *appid)
3639 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3640 pkgmgrinfo_appinfo_h handle = NULL;
3641 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3642 if (ret != PMINFO_R_OK)
3644 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3645 if (ret != PMINFO_R_OK) {
3646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3649 printf("app screenreader: %d\n", screenreader);
3650 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3655 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3658 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3659 * @brief This API gets the application's landscape & portrait effect images
3661 * @par This API is for package-manager client application
3662 * @par Sync (or) Async : Synchronous API
3664 * @param[in] handle pointer to application info handle
3665 * @param[out] portrait_img contains portrait mode effect image
3666 * @param[out] landscape_img contains landscape mode effect image
3667 * @return 0 if success, error code(<0) if fail
3668 * @retval PMINFO_R_OK success
3669 * @retval PMINFO_R_EINVAL invalid argument
3670 * @retval PMINFO_R_ERROR internal error
3671 * @pre pkgmgrinfo_appinfo_get_appinfo()
3672 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3673 * @see pkgmgrinfo_appinfo_get_appid()
3674 * @see pkgmgrinfo_appinfo_is_nodisplay()
3676 static int get_app_effectimages(const char *appid)
3679 char *portraitimg = NULL;
3680 char *landscapeimg = NULL;
3681 pkgmgrinfo_appinfo_h handle;
3682 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3683 if (ret != PMINFO_R_OK)
3685 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3686 if (ret != PMINFO_R_OK) {
3687 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3690 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3691 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3696 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3699 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3700 * @brief This API gets the application's effect image type
3702 * @par This API is for package-manager client application
3703 * @par Sync (or) Async : Synchronous API
3705 * @param[in] handle pointer to application info handle
3706 * @param[out] effectimg_type contains effect image type
3707 * @return 0 if success, error code(<0) if fail
3708 * @retval PMINFO_R_OK success
3709 * @retval PMINFO_R_EINVAL invalid argument
3710 * @retval PMINFO_R_ERROR internal error
3711 * @pre pkgmgrinfo_appinfo_get_appinfo()
3712 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3713 * @see pkgmgrinfo_appinfo_get_appid()
3714 * @see pkgmgrinfo_appinfo_is_nodisplay()
3716 static int get_app_effectimage_type(const char *appid)
3719 char *effectimg_type = NULL;
3720 pkgmgrinfo_appinfo_h handle = NULL;
3721 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3722 if (ret != PMINFO_R_OK)
3724 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3725 if (ret != PMINFO_R_OK) {
3726 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3729 printf("app effect image type: %s\n", effectimg_type);
3730 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3735 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3738 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3739 * @brief This API gets the submode_mainid of the application
3741 * @par This API is for package-manager client application
3742 * @par Sync (or) Async : Synchronous API
3744 * @param[in] handle pointer to the application info handle.
3745 * @param[out] submode_mainid pointer to hold package name
3746 * @return 0 if success, error code(<0) if fail
3747 * @retval PMINFO_R_OK success
3748 * @retval PMINFO_R_EINVAL invalid argument
3749 * @retval PMINFO_R_ERROR internal error
3750 * @pre pkgmgrinfo_appinfo_get_appinfo()
3751 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3752 * @see pkgmgrinfo_appinfo_get_appid()
3753 * @see pkgmgrinfo_appinfo_is_multiple()
3755 static int get_app_submode_mainid(const char *appid)
3758 char *submode_mainid = NULL;
3759 pkgmgrinfo_appinfo_h handle = NULL;
3760 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3761 if (ret != PMINFO_R_OK)
3763 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3764 if (ret != PMINFO_R_OK) {
3765 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3768 printf("submode_mainid: %s\n", submode_mainid);
3769 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3774 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3777 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3778 * @brief This API gets the datacontrol info
3780 * @par This API is for package-manager client application
3781 * @par Sync (or) Async : Synchronous API
3783 * @param[in] providerid pointer to the providerid of dataconltrol.
3784 * @param[in] type pointer to the type of dataconltrol.
3785 * @param[out] appid pointer to hold appid, need to free after using
3786 * @param[out] access pointer to hold access, need to free after using
3787 * @return 0 if success, error code(<0) if fail
3788 * @retval PMINFO_R_OK success
3789 * @retval PMINFO_R_EINVAL invalid argument
3790 * @retval PMINFO_R_ERROR internal error
3793 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3794 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3797 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3798 * @brief This API gets the appid of datacontrol
3800 * @par This API is for package-manager client application
3801 * @par Sync (or) Async : Synchronous API
3803 * @param[in] providerid pointer to the providerid of dataconltrol.
3804 * @param[out] appid pointer to hold appid, need to free after using
3805 * @return 0 if success, error code(<0) if fail
3806 * @retval PMINFO_R_OK success
3807 * @retval PMINFO_R_EINVAL invalid argument
3808 * @retval PMINFO_R_ERROR internal error
3811 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3812 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3815 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3816 * @brief This API gets the information about trusted datacontrol
3818 * @par This API is for package-manager client application
3819 * @par Sync (or) Async : Synchronous API
3821 * @param[in] providerid pointer to the providerid of datacontrol.
3822 * @param[out] appid pointer to hold appid, need to free after using
3823 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3824 * @return 0 if success, error code(<0) if fail
3825 * @retval PMINFO_R_OK success
3826 * @retval PMINFO_R_EINVAL invalid argument
3827 * @retval PMINFO_R_ERROR internal error
3830 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3831 const char *type, char **appid, bool *is_trusted);
3832 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3833 const char *type, uid_t uid, char **appid, bool *is_trusted);
3836 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3837 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3838 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3840 * @par This API is for package-manager client application
3841 * @par Sync (or) Async : Synchronous API
3843 * @param[in] providerid pointer to the providerid of datacontrol.
3844 * @param[in] type pointer to the type of dataconltrol.
3845 * @param[in] privilege_func callback function for list
3846 * @param[in] user_data user data to be passed to callback function
3847 * @return 0 if success, error code(<0) if fail
3848 * @retval PMINFO_R_OK success
3849 * @retval PMINFO_R_EINVAL invalid argument
3850 * @retval PMINFO_R_ERROR internal error
3852 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3853 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3854 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3855 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3858 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3859 * @brief This API gets the alias_appid of the application
3861 * @par This API is for package-manager client application
3862 * @par Sync (or) Async : Synchronous API
3864 * @param[in] handle pointer to the application info handle.
3865 * @param[out] alias_appid pointer to hold app alias_appid
3866 * @return 0 if success, error code(<0) if fail
3867 * @retval PMINFO_R_OK success
3868 * @retval PMINFO_R_EINVAL invalid argument
3869 * @retval PMINFO_R_ERROR internal error
3870 * @pre pkgmgrinfo_appinfo_get_appinfo()
3871 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3872 * @see pkgmgrinfo_appinfo_get_appid()
3874 static int get_alias_appid(const char *appid)
3877 char *alias_appid= 0;
3878 pkgmgrinfo_appinfo_h handle = NULL;
3879 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3880 if (ret != PMINFO_R_OK)
3882 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3883 if (ret != PMINFO_R_OK) {
3884 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3887 printf("alias_appid: %s\n", alias_appid);
3888 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3893 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3896 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3897 * @brief This API gets the effective_appid of the application
3899 * @par This API is for package-manager client application
3900 * @par Sync (or) Async : Synchronous API
3902 * @param[in] handle pointer to the application info handle.
3903 * @param[out] effective_appid pointer to hold app effective_appid
3904 * @return 0 if success, error code(<0) if fail
3905 * @retval PMINFO_R_OK success
3906 * @retval PMINFO_R_EINVAL invalid argument
3907 * @retval PMINFO_R_ERROR internal error
3908 * @pre pkgmgrinfo_appinfo_get_appinfo()
3909 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3910 * @see pkgmgrinfo_appinfo_get_appid()
3912 static int get_effective_appid(const char *appid)
3915 char *effective_appid= 0;
3916 pkgmgrinfo_appinfo_h handle = NULL;
3917 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3918 if (ret != PMINFO_R_OK)
3920 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3921 if (ret != PMINFO_R_OK) {
3922 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3925 printf("effective_appid: %s\n", effective_appid);
3926 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3931 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3934 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3935 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3937 * @par This API is for package-manager client application
3938 * @par Sync (or) Async : Synchronous API
3940 * @param[in] handle pointer to the appinfo handle.
3941 * @param[out] tep_name pointer to hold tep name
3942 * @return 0 if success, error code(<0) if fail
3943 * @retval PMINFO_R_OK success
3944 * @retval PMINFO_R_EINVAL invalid argument
3945 * @retval PMINFO_R_ERROR internal error
3946 * @pre pkgmgrinfo_appinfo_get_appinfo()
3947 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3948 * @see pkgmgrinfo_appinfo_get_appid()
3950 static int get_tep_name(const char *appid)
3953 char *tep_name = NULL;
3954 pkgmgrinfo_appinfo_h handle = NULL;
3955 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3956 if (ret != PMINFO_R_OK)
3958 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3959 if (ret != PMINFO_R_OK) {
3960 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3963 printf("TEP name is: %s\n", tep_name);
3964 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3969 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3972 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3973 * @brief This API gets zip mount file name associated with the package which contain given application
3974 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3976 * @par This API is for package-manager client application
3977 * @par Sync (or) Async : Synchronous API
3979 * @param[in] handle pointer to the appinfo handle.
3980 * @param[out] zip_mount_file pointer to hold zip mount file name
3981 * @return 0 if success, error code(<0) if fail
3982 * @retval PMINFO_R_OK success
3983 * @retval PMINFO_R_EINVAL invalid argument
3984 * @retval PMINFO_R_ERROR internal error
3985 * @pre pkgmgrinfo_appinfo_get_appinfo()
3986 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3987 * @see pkgmgrinfo_appinfo_get_appid()
3989 static int get_zip_mount_file(const char *appid)
3992 char *zip_mount_file = NULL;
3993 pkgmgrinfo_appinfo_h handle = NULL;
3994 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3995 if (ret != PMINFO_R_OK)
3997 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3998 if (ret != PMINFO_R_OK) {
3999 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4002 printf("Mount file name is: %s\n", zip_mount_file);
4003 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4008 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4011 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4012 * @brief This API gets the root path of application
4014 * @par Sync (or) Async : Synchronous API
4016 * @param[in] handle pointer to appinfo handle
4017 * @param[out] path pointer to hold root path of application
4018 * @return 0 if success, error code(<0) if fail
4019 * @retval PMINFO_R_OK success
4020 * @retval PMINFO_R_EINVAL invalid argument
4021 * @retval PMINFO_R_ERROR internal error
4023 static int get_root_path(const char *appid)
4027 pkgmgrinfo_appinfo_h handle;
4028 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4029 if (ret != PMINFO_R_OK)
4032 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4033 if (ret != PMINFO_R_OK) {
4034 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4037 printf("path : %s\n", path);
4038 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4044 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4047 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4048 * @brief This API gets the application api_version from the application ID
4050 * @par This API is for package-manager client application
4051 * @par Sync (or) Async : Synchronous API
4053 * @param[in] handle pointer to appinfo handle
4054 * @param[out] api_version pointer to hold application api_version
4055 * @return 0 if success, error code(<0) if fail
4056 * @retval PMINFO_R_OK success
4057 * @retval PMINFO_R_EINVAL invalid argument
4058 * @retval PMINFO_R_ERROR internal error
4059 * @pre pkgmgrinfo_appinfo_get_appinfo()
4060 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4061 * @see pkgmgrinfo_appinfo_get_appid()
4063 static int get_app_api_version(const char *appid)
4066 char *api_version = NULL;
4067 pkgmgrinfo_appinfo_h handle = NULL;
4068 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4069 if (ret != PMINFO_R_OK)
4071 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4072 if (ret != PMINFO_R_OK) {
4073 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4076 printf("app api_version: %s\n", api_version);
4077 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4082 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4085 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4086 * @brief This API gets the installed_time of the application
4088 * @par This API is for package-manager client application
4089 * @par Sync (or) Async : Synchronous API
4091 * @param[in] handle pointer to the application info handle.
4092 * @param[out] installed_time pointer to hold installed_time
4093 * @return 0 if success, error code(<0) if fail
4094 * @retval PMINFO_R_OK success
4095 * @retval PMINFO_R_EINVAL invalid argument
4096 * @retval PMINFO_R_ERROR internal error
4097 * @pre pkgmgrinfo_appinfo_get_appinfo()
4098 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4099 * @see pkgmgrinfo_appinfo_get_appid()
4100 * @see pkgmgrinfo_appinfo_is_multiple()
4102 static int get_app_installed_time(const char *appid)
4105 int installed_time = 0;
4106 pkgmgrinfo_appinfo_h handle = NULL;
4107 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4108 if (ret != PMINFO_R_OK)
4110 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4111 if (ret != PMINFO_R_OK) {
4112 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4115 printf("installed_time: %d\n", installed_time);
4116 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4121 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4124 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4125 * @brief This API gets the support_mode of the application
4127 * @par This API is for package-manager client application
4128 * @par Sync (or) Async : Synchronous API
4130 * @param[in] handle pointer to the application info handle.
4131 * @param[out] support_mode pointer to hold app support_mode
4132 * @return 0 if success, error code(<0) if fail
4133 * @retval PMINFO_R_OK success
4134 * @retval PMINFO_R_EINVAL invalid argument
4135 * @retval PMINFO_R_ERROR internal error
4136 * @pre pkgmgrinfo_appinfo_get_appinfo()
4137 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4138 * @see pkgmgrinfo_appinfo_get_appid()
4140 static int get_app_support_mode(const char *appid)
4143 int support_mode = 0;
4144 pkgmgrinfo_appinfo_h handle = NULL;
4145 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4146 if (ret != PMINFO_R_OK)
4148 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4149 if (ret != PMINFO_R_OK) {
4150 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4153 printf("support_mode: %s\n", support_mode);
4154 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4159 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4163 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4164 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4165 * @brief This API gets the list of category for a particular application
4167 * @par This API is for package-manager client application
4168 * @par Sync (or) Async : Synchronous API
4169 * @param[in] handle pointer to the application info handle.
4170 * @param[in] category_func callback function for list
4171 * @param[in] user_data user data to be passed to callback function
4172 * @return 0 if success, error code(<0) if fail
4173 * @retval PMINFO_R_OK success
4174 * @retval PMINFO_R_EINVAL invalid argument
4175 * @retval PMINFO_R_ERROR internal error
4176 * @pre pkgmgrinfo_appinfo_get_appinfo()
4177 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4179 int category_func(const char *name, void *user_data)
4181 if (strcmp(name, (char *)user_data) == 0)
4187 static int list_category(const char *appid, char *category)
4190 pkgmgrinfo_appinfo_h handle;
4191 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4192 if (ret != PMINFO_R_OK)
4194 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4195 if (ret != PMINFO_R_OK) {
4196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4199 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4204 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4205 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4208 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4209 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4210 * @brief This API gets the list of metadata for a particular application
4212 * @par This API is for package-manager client application
4213 * @par Sync (or) Async : Synchronous API
4214 * @param[in] handle pointer to the application info handle.
4215 * @param[in] metadata_func callback function for list
4216 * @param[in] user_data user data to be passed to callback function
4217 * @return 0 if success, error code(<0) if fail
4218 * @retval PMINFO_R_OK success
4219 * @retval PMINFO_R_EINVAL invalid argument
4220 * @retval PMINFO_R_ERROR internal error
4221 * @pre pkgmgrinfo_appinfo_get_appinfo()
4222 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4224 int metadata_func(const char *key, const char *value, void *user_data)
4226 if (strcmp(key, (char *)user_data) == 0) {
4227 printf("Value is %s\n", value);
4234 static int list_metadata(const char *appid, char *key)
4237 pkgmgrinfo_appinfo_h handle;
4238 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4239 if (ret != PMINFO_R_OK)
4241 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4242 if (ret != PMINFO_R_OK) {
4243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4246 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4251 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4252 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4255 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4256 * const char *operation,
4257 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4259 * @brief This API gets the list of privileges for a particular
4260 * appllication's app_control
4262 * @par This API is for package-manager client application
4263 * @par Sync (or) Async : Synchronous API
4264 * @param[in] appid application id
4265 * @param[in] operation operation of appcontrol
4266 * @param[in] privilege_func callback function for list
4267 * @param[in] user_data user data to be passed to callback function
4268 * @return 0 if success, error code(<0) if fail
4269 * @retval PMINFO_R_OK success
4270 * @retval PMINFO_R_EINVAL invalid argument
4271 * @retval PMINFO_R_ERROR internal error
4273 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4274 const char *operation,
4275 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4276 void *user_data, uid_t uid);
4277 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4278 const char *operation,
4279 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4283 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4284 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4285 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4286 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4287 * @brief This API gets the list of app-control for a particular application
4289 * @par This API is for package-manager client application
4290 * @par Sync (or) Async : Synchronous API
4291 * @param[in] handle pointer to the application info handle.
4292 * @param[in] appcontrol_func callback function for list
4293 * @param[in] user_data user data to be passed to callback function
4294 * @param[in] uid the addressee user id of the instruction
4295 * @return 0 if success, error code(<0) if fail
4296 * @retval PMINFO_R_OK success
4297 * @retval PMINFO_R_EINVAL invalid argument
4298 * @retval PMINFO_R_ERROR internal error
4299 * @pre pkgmgrinfo_appinfo_get_appinfo()
4300 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4302 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4306 char *compare_data = (char *)user_data;
4307 if (strcmp(operation, compare_data) == 0)
4313 static int check_operation(const char *appid, char *operation)
4316 pkgmgrinfo_appinfo_h handle;
4317 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4318 if (ret != PMINFO_R_OK)
4320 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4321 if (ret != PMINFO_R_OK) {
4322 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4330 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4331 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4333 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4334 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4339 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4340 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4343 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4344 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4345 * @brief This API gets the list of splashscreen for a particular application
4347 * @par This API is for package-manager client application
4348 * @par Sync (or) Async : Synchronous API
4349 * @param[in] handle pointer to the application info handle.
4350 * @param[in] splash_screen_func callback function for list
4351 * @param[in] user_data user data to be passed to callback function
4352 * @return 0 if success, error code(<0) if fail
4353 * @retval PMINFO_R_OK success
4354 * @retval PMINFO_R_EINVAL invalid argument
4355 * @retval PMINFO_R_ERROR internal error
4356 * @pre pkgmgrinfo_appinfo_get_appinfo()
4357 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4360 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4361 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4364 * @fn int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4365 pkgmgrinfo_app_res_control_list_cb res_control_func, void *user_data);
4366 * @brief This API gets the list of resource control for a particular application
4368 * @par This API is for package-manager client application
4369 * @par Sync (or) Async : Synchronous API
4370 * @param[in] handle pointer to the application info handle.
4371 * @param[in] res_control_func callback function for list
4372 * @param[in] user_data user data to be passed to callback function
4373 * @return 0 if success, error code(<0) if fail
4374 * @retval PMINFO_R_OK success
4375 * @retval PMINFO_R_EINVAL invalid argument
4376 * @retval PMINFO_R_ERROR internal error
4377 * @pre pkgmgrinfo_appinfo_get_appinfo()
4378 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4380 int res_control_func(const char *res_type,
4381 const char *min_res_version, const char *max_res_version,
4382 const char *auto_close, void *user_data)
4384 printf("res_type : %s\n", res_type);
4388 static int list_res_control(const char *appid, char *key)
4391 pkgmgrinfo_appinfo_h handle;
4392 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4393 if (ret != PMINFO_R_OK)
4395 ret = pkgmgrinfo_appinfo_foreach_res_control(handle, res_control_func, NULL);
4396 if (ret != PMINFO_R_OK) {
4397 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4400 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4405 int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4406 pkgmgrinfo_app_res_control_list_cb res_control_func,
4410 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4411 * @brief This API gets the application 'nodisplay' value from the app ID
4413 * @par This API is for package-manager client application
4414 * @par Sync (or) Async : Synchronous API
4416 * @param[in] handle pointer to application info handle
4417 * @param[out] nodisplay pointer to hold package nodisplay value
4418 * @return 0 if success, error code(<0) if fail
4419 * @retval PMINFO_R_OK success
4420 * @retval PMINFO_R_EINVAL invalid argument
4421 * @retval PMINFO_R_ERROR internal error
4422 * @pre pkgmgrinfo_appinfo_get_appinfo()
4423 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4424 * @see pkgmgrinfo_appinfo_get_appid()
4425 * @see pkgmgrinfo_appinfo_is_multiple()
4427 static int get_app_nodisplay(const char *appid)
4431 pkgmgrinfo_appinfo_h handle;
4432 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4433 if (ret != PMINFO_R_OK)
4435 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4436 if (ret != PMINFO_R_OK) {
4437 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4440 printf("app nodisplay: %d\n", nodisplay);
4441 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4446 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4449 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4450 * @brief This API gets the application 'multiple' value from the app ID
4452 * @par This API is for package-manager client application
4453 * @par Sync (or) Async : Synchronous API
4455 * @param[in] handle pointer to application info handle
4456 * @param[out] multiple pointer to hold package multiple value
4457 * @return 0 if success, error code(<0) if fail
4458 * @retval PMINFO_R_OK success
4459 * @retval PMINFO_R_EINVAL invalid argument
4460 * @retval PMINFO_R_ERROR internal error
4461 * @pre pkgmgrinfo_appinfo_get_appinfo()
4462 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4463 * @see pkgmgrinfo_appinfo_get_appid()
4464 * @see pkgmgrinfo_appinfo_is_nodisplay()
4466 static int get_app_multiple(const char *appid)
4470 pkgmgrinfo_appinfo_h handle;
4471 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4472 if (ret != PMINFO_R_OK)
4474 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4475 if (ret != PMINFO_R_OK) {
4476 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4479 printf("app multiple: %d\n", multiple);
4480 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4485 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4488 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4489 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4490 * application launching effect. If fales, indicator will be hidden during application launching effect
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] indicator_disp contains indicator display status for application launching effect
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_nodisplay()
4506 static int get_app_indicator_display(const char *appid)
4509 bool indicator_disp;
4510 pkgmgrinfo_appinfo_h handle;
4511 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4512 if (ret != PMINFO_R_OK)
4514 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4515 if (ret != PMINFO_R_OK){
4516 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4519 printf("app indicator disp : %d\n", indicator_disp);
4520 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4525 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4528 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4529 * @brief This API gets the application 'taskmanage' value from the app ID
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] taskmanage pointer to hold package taskmanage value
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_taskmanage(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_taskmanage(handle, &taskmanage);
4554 if (ret != PMINFO_R_OK) {
4555 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4558 printf("app taskmanage: %d\n", taskmanage);
4559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4564 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4567 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4568 * @brief This API gets the application 'taskmanage' value from the app ID
4570 * @par This API is for package-manager client application
4571 * @par Sync (or) Async : Synchronous API
4573 * @param[in] handle pointer to application info handle
4574 * @param[out] enabled pointer to hold package enabled value
4575 * @return 0 if success, error code(<0) if fail
4576 * @retval PMINFO_R_OK success
4577 * @retval PMINFO_R_EINVAL invalid argument
4578 * @retval PMINFO_R_ERROR internal error
4579 * @pre pkgmgrinfo_appinfo_get_appinfo()
4580 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4581 * @see pkgmgrinfo_appinfo_get_appid()
4582 * @see pkgmgrinfo_appinfo_is_multiple()
4584 static int get_app_enabled(const char *appid)
4588 pkgmgrinfo_appinfo_h handle;
4589 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4590 if (ret != PMINFO_R_OK)
4592 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4593 if (ret != PMINFO_R_OK) {
4594 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4597 printf("app enabled: %d\n", enabled);
4598 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4603 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4606 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4607 * @brief This API gets the application 'onboot' value from the app ID
4609 * @par This API is for package-manager client application
4610 * @par Sync (or) Async : Synchronous API
4612 * @param[in] handle pointer to application info handle
4613 * @param[out] onboot pointer to hold package onboot value
4614 * @return 0 if success, error code(<0) if fail
4615 * @retval PMINFO_R_OK success
4616 * @retval PMINFO_R_EINVAL invalid argument
4617 * @retval PMINFO_R_ERROR internal error
4618 * @pre pkgmgrinfo_appinfo_get_appinfo()
4619 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4620 * @see pkgmgrinfo_appinfo_get_appid()
4621 * @see pkgmgrinfo_appinfo_is_multiple()
4623 static int get_app_onboot(const char *appid)
4627 pkgmgrinfo_appinfo_h handle;
4628 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4629 if (ret != PMINFO_R_OK)
4631 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4632 if (ret != PMINFO_R_OK) {
4633 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4636 printf("app onboot: %d\n", onboot);
4637 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4642 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4645 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4646 * @brief This API gets the application 'autorestart' value from the app ID
4648 * @par This API is for package-manager client application
4649 * @par Sync (or) Async : Synchronous API
4651 * @param[in] handle pointer to application info handle
4652 * @param[out] autorestart pointer to hold package autorestart value
4653 * @return 0 if success, error code(<0) if fail
4654 * @retval PMINFO_R_OK success
4655 * @retval PMINFO_R_EINVAL invalid argument
4656 * @retval PMINFO_R_ERROR internal error
4657 * @pre pkgmgrinfo_appinfo_get_appinfo()
4658 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4659 * @see pkgmgrinfo_appinfo_get_appid()
4660 * @see pkgmgrinfo_appinfo_is_multiple()
4662 static int get_app_autorestart(const char *appid)
4666 pkgmgrinfo_appinfo_h handle;
4667 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4668 if (ret != PMINFO_R_OK)
4670 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4671 if (ret != PMINFO_R_OK) {
4672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4675 printf("app autorestart: %d\n", autorestart);
4676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4681 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4684 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4685 * @brief This API gets the value for given application is main app or not from handle
4687 * @par This API is for package-manager client application
4688 * @par Sync (or) Async : Synchronous API
4690 * @param[in] handle pointer to application info handle
4691 * @param[out] mainapp pointer to hold package mainapp is or not
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()
4699 * @see pkgmgrinfo_appinfo_is_multiple()
4701 static int get_app_mainapp(const char *appid)
4705 pkgmgrinfo_appinfo_h handle;
4706 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4707 if (ret != PMINFO_R_OK)
4709 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4710 if (ret != PMINFO_R_OK) {
4711 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4714 printf("mainapp: %d\n", mainapp);
4715 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4720 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4724 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4725 * @brief This API gets the value for given application is preload or not from handle
4727 * @par This API is for package-manager client application
4728 * @par Sync (or) Async : Synchronous API
4730 * @param[in] handle pointer to application info handle
4731 * @param[out] preload pointer to hold preload is or not
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
4736 * @pre pkgmgrinfo_appinfo_get_appinfo()
4737 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4738 * @see pkgmgrinfo_appinfo_get_appid()
4739 * @see pkgmgrinfo_appinfo_is_multiple()
4741 static int get_app_preload(const char *appid)
4745 pkgmgrinfo_appinfo_h handle = NULL;
4746 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4747 if (ret != PMINFO_R_OK)
4749 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4750 if (ret != PMINFO_R_OK) {
4751 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4754 printf("preload: %d\n", preload);
4755 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4760 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4763 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4764 * @brief This API gets the value for given application is submode or not from handle
4766 * @par This API is for package-manager client application
4767 * @par Sync (or) Async : Synchronous API
4769 * @param[in] handle pointer to application info handle
4770 * @param[out] submode pointer to hold submode is or not
4771 * @return 0 if success, error code(<0) if fail
4772 * @retval PMINFO_R_OK success
4773 * @retval PMINFO_R_EINVAL invalid argument
4774 * @retval PMINFO_R_ERROR internal error
4775 * @pre pkgmgrinfo_appinfo_get_appinfo()
4776 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4777 * @see pkgmgrinfo_appinfo_get_appid()
4778 * @see pkgmgrinfo_appinfo_is_multiple()
4780 static int get_app_submode(const char *appid)
4784 pkgmgrinfo_appinfo_h handle = NULL;
4785 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4786 if (ret != PMINFO_R_OK)
4788 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4789 if (ret != PMINFO_R_OK) {
4790 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4793 printf("submode: %d\n", submode);
4794 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4799 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4802 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4803 * @brief This API gets the value for given application is process_pool or not from handle
4805 * @par This API is for package-manager client application
4806 * @par Sync (or) Async : Synchronous API
4808 * @param[in] handle pointer to application info handle
4809 * @param[out] process_pool pointer to hold process_pool is or not
4810 * @return 0 if success, error code(<0) if fail
4811 * @retval PMINFO_R_OK success
4812 * @retval PMINFO_R_EINVAL invalid argument
4813 * @retval PMINFO_R_ERROR internal error
4814 * @pre pkgmgrinfo_appinfo_get_appinfo()
4815 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4816 * @see pkgmgrinfo_appinfo_get_appid()
4818 static int get_app_process_pool(const char *appid)
4821 bool process_pool = 0;
4822 pkgmgrinfo_appinfo_h handle = NULL;
4823 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4824 if (ret != PMINFO_R_OK)
4826 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4827 if (ret != PMINFO_R_OK) {
4828 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4831 printf("process_pool: %d\n", process_pool);
4832 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4837 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4840 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4841 * @brief This API gets the installed storage location of the application
4843 * @par This API is for package-manager client application
4844 * @par Sync (or) Async : Synchronous API
4846 * @param[in] handle pointer to the application info handle.
4847 * @param[out] app_type pointer to hold installed storage location
4848 * @return 0 if success, error code(<0) if fail
4849 * @retval PMINFO_R_OK success
4850 * @retval PMINFO_R_EINVAL invalid argument
4851 * @retval PMINFO_R_ERROR internal error
4852 * @pre pkgmgrinfo_appinfo_get_appinfo()
4853 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4854 * @see pkgmgrinfo_appinfo_get_appid()
4856 static int get_app_installed_location(const char *appid)
4859 pkgmgrinfo_installed_storage storage;
4860 pkgmgrinfo_appinfo_h handle = NULL;
4861 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4862 if (ret != PMINFO_R_OK)
4864 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4865 if (ret != PMINFO_R_OK) {
4866 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4869 printf("Installed storage location : %d\n", storage);
4870 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4875 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4879 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4880 * @brief This API checks if the application has the given category
4882 * @par This API is for package-manager client application
4883 * @par Sync (or) Async : Synchronous API
4885 * @param[in] handle pointer to the application info handle
4886 * @param[in] category category
4887 * @param[out] exist value Gets whether the application has the given category
4888 * @return 0 if success, error code(<0) if fail
4889 * @retval PMINFO_R_OK success
4890 * @retval PMINFO_R_EINVAL invalid argument
4891 * @retval PMINFO_R_ERROR internal error
4893 static int is_category_exist(const char *appid, const char *category)
4896 pkgmgrinfo_appinfo_h handle;
4899 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4900 if (ret != PMINFO_R_OK)
4903 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4904 if (ret != PMINFO_R_OK) {
4905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4909 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4914 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4917 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4918 * @brief This API gets the application 'ui_gadget' value from the app ID
4920 * @par This API is for package-manager client application
4921 * @par Sync (or) Async : Synchronous API
4923 * @param[in] handle pointer to application info handle
4924 * @param[out] ui_gadget pointer to hold package ui_gadget value
4925 * @return 0 if success, error code(<0) if fail
4926 * @retval PMINFO_R_OK success
4927 * @retval PMINFO_R_EINVAL invalid argument
4928 * @pre pkgmgrinfo_appinfo_get_appinfo()
4929 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4931 static int get_app_ui_gadget(const char *appid)
4935 pkgmgrinfo_appinfo_h handle = NULL;
4936 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4937 if (ret != PMINFO_R_OK)
4939 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4940 if (ret != PMINFO_R_OK) {
4941 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4944 printf("app ui_gadget: %d\n", ui_gadget);
4945 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4950 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4953 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4954 * @brief This API gets the application 'support_disable' value from the app ID
4956 * @par This API is for package-manager client application
4957 * @par Sync (or) Async : Synchronous API
4959 * @param[in] handle pointer to application info handle
4960 * @param[out] support_disable pointer to hold package support_disable value
4961 * @return 0 if success, error code(<0) if fail
4962 * @retval PMINFO_R_OK success
4963 * @retval PMINFO_R_EINVAL invalid argument
4964 * @pre pkgmgrinfo_appinfo_get_appinfo()
4965 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4967 static int get_app_support_disable(const char *appid)
4970 bool support_disable;
4971 pkgmgrinfo_appinfo_h handle = NULL;
4972 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4973 if (ret != PMINFO_R_OK)
4975 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4976 if (ret != PMINFO_R_OK) {
4977 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4980 printf("app support_disable: %d\n", support_disable);
4981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4986 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4989 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4990 * @brief This API gets the application 'removable' value from the app ID
4992 * @par This API is for package-manager client application
4993 * @par Sync (or) Async : Synchronous API
4995 * @param[in] handle pointer to application info handle
4996 * @param[out] removable pointer to hold package removable value
4997 * @return 0 if success, error code(<0) if fail
4998 * @retval PMINFO_R_OK success
4999 * @retval PMINFO_R_EINVAL invalid argument
5000 * @retval PMINFO_R_ERROR internal error
5001 * @pre pkgmgrinfo_appinfo_get_appinfo()
5002 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5003 * @see pkgmgrinfo_appinfo_get_appid()
5005 static int get_app_removable(const char *appid)
5009 pkgmgrinfo_appinfo_h handle = NULL;
5010 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5011 if (ret != PMINFO_R_OK)
5013 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5014 if (ret != PMINFO_R_OK) {
5015 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5018 printf("app removable: %d\n", removable);
5019 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5024 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5027 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5028 * @brief This API gets the application 'system' value from the app ID
5030 * @par This API is for package-manager client application
5031 * @par Sync (or) Async : Synchronous API
5033 * @param[in] handle pointer to application info handle
5034 * @param[out] system pointer to hold package system value
5035 * @return 0 if success, error code(<0) if fail
5036 * @retval PMINFO_R_OK success
5037 * @retval PMINFO_R_EINVAL invalid argument
5038 * @retval PMINFO_R_ERROR internal error
5039 * @pre pkgmgrinfo_appinfo_get_appinfo()
5040 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5041 * @see pkgmgrinfo_appinfo_get_appid()
5043 static int get_app_system(const char *appid)
5046 bool system = false;
5047 pkgmgrinfo_appinfo_h handle = NULL;
5048 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5049 if (ret != PMINFO_R_OK)
5051 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5052 if (ret != PMINFO_R_OK) {
5053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5056 printf("app system: %d\n", system);
5057 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5062 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5066 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5067 * @brief This API gets the application 'is_disable' value from the app ID
5069 * @par This API is for package-manager client application
5070 * @par Sync (or) Async : Synchronous API
5072 * @param[in] handle pointer to application info handle
5073 * @param[out] disabled pointer to hold application is_disabled value
5074 * @return 0 if success, error code(<0) if fail
5075 * @retval PMINFO_R_OK success
5076 * @retval PMINFO_R_EINVAL invalid argument
5077 * @pre pkgmgrinfo_appinfo_get_appinfo()
5078 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5080 static int get_app_is_disable(const char *appid)
5084 pkgmgrinfo_appinfo_h handle = NULL;
5085 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5086 if (ret != PMINFO_R_OK)
5088 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5089 if (ret != PMINFO_R_OK) {
5090 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5093 printf("app is_disable: %d\n", is_disable);
5094 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5099 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5102 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5103 * @brief This API gets whether the given application is global application or user application
5105 * @par This API is for package-manager client application
5106 * @par Sync (or) Async : Synchronous API
5108 * @param[in] handle pointer to application info handle
5109 * @param[in] global pointer to hold application global value
5110 * @return 0 if success, error code(<0) if fail
5111 * @retval PMINFO_R_OK success
5112 * @retval PMINFO_R_EINVAL invalid argument
5113 * @retval PMINFO_R_ERROR internal error
5114 * @pre pkgmgrinfo_appinfo_get_appinfo()
5115 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5116 * @see pkgmgrinfo_appinfo_get_appid()
5117 static int get_app_is_global(const char *appid)
5121 pkgmgrinfo_appinfo_h handle = NULL;
5122 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5123 if (ret != PMINFO_R_OK)
5125 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5126 if (ret != PMINFO_R_OK) {
5127 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5130 printf("app is_global: %d\n", global);
5131 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5136 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5139 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5140 * @brief This API gets the application 'splash_screen_display' value from the app ID
5142 * @par This API is for package-manager client application
5143 * @par Sync (or) Async : Synchronous API
5145 * @param[in] handle pointer to application info handle
5146 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5147 * @return 0 if success, error code(<0) if fail
5148 * @retval PMINFO_R_OK success
5149 * @retval PMINFO_R_EINVAL invalid argument
5150 * @retval PMINFO_R_ERROR internal error
5152 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5155 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5156 * @brief This API gets the application 'setup_appid' value from the app ID
5158 * @par This API is for package-manager client application
5159 * @par Sync (or) Async : Synchronous API
5161 * @param[in] handle pointer to application info handle
5162 * @param[out] setup_appid pointer to hold package setup_appid value
5163 * @return 0 if success, error code(<0) if fail
5164 * @retval PMINFO_R_OK success
5165 * @retval PMINFO_R_EINVAL invalid argument
5166 * @retval PMINFO_R_ERROR internal error
5168 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5171 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5172 * @brief This API gets the application 'support_ambient' value from the app ID
5174 * @par This API is for package-manager client application
5175 * @par Sync (or) Async : Synchronous API
5177 * @param[in] handle pointer to application info handle
5178 * @param[out] support_ambient pointer to hold package support_ambient value
5179 * @return 0 if success, error code(<0) if fail
5180 * @retval PMINFO_R_OK success
5181 * @retval PMINFO_R_EINVAL invalid argument
5182 * @retval PMINFO_R_ERROR internal error
5184 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5187 * @fn int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char *mode)
5188 * @brief This API gets the application 'light_user_switch_mode' value from the app ID
5190 * @par This API is for package-manager client application
5191 * @par Sync (or) Async : Synchronous API
5193 * @param[in] handle pointer to application info handle
5194 * @param[out] mode pointer to hold package light_user_switch_mode value
5195 * @return 0 if success, error code(<0) if fail
5196 * @retval PMINFO_R_OK success
5197 * @retval PMINFO_R_EINVAL invalid argument
5198 * @retval PMINFO_R_ERROR internal error
5200 int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
5203 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5204 * @brief This API destroys the application information handle freeing up all the resources
5206 * @par This API is for package-manager client application
5207 * @par Sync (or) Async : Synchronous API
5209 * @param[in] handle pointer to the application info handle.
5210 * @return 0 if success, error code(<0) if fail
5211 * @retval PMINFO_R_OK success
5212 * @retval PMINFO_R_EINVAL invalid argument
5213 * @retval PMINFO_R_ERROR internal error
5214 * @pre pkgmgrinfo_appinfo_get_appinfo()
5216 * @see pkgmgrinfo_appinfo_get_pkgid()
5217 * @see pkgmgrinfo_appinfo_is_multiple()
5219 static int get_app_type(const char *appid)
5223 pkgmgrinfo_appinfo_h handle;
5224 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5225 if (ret != PMINFO_R_OK)
5227 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5228 if (ret != PMINFO_R_OK) {
5229 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5232 printf("apptype: %s\n", type);
5233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5238 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5241 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5242 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5243 The query will search the entire application information collected from the manifest file of all the installed packages
5245 * @par This API is for package-manager client application
5246 * @par Sync (or) Async : Synchronous API
5248 * @param[out] handle pointer to the application info filter handle.
5249 * @return 0 if success, error code(<0) if fail
5250 * @retval PMINFO_R_OK success
5251 * @retval PMINFO_R_EINVAL invalid argument
5252 * @retval PMINFO_R_ERROR internal error
5254 * @post pkgmgrinfo_appinfo_filter_destroy()
5255 * @see pkgmgrinfo_appinfo_filter_count()
5256 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5258 static int get_capp_count()
5262 pkgmgrinfo_appinfo_filter_h handle;
5263 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5264 if (ret != PMINFO_R_OK)
5266 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5267 if (ret != PMINFO_R_OK) {
5268 pkgmgrinfo_appinfo_filter_destroy(handle);
5271 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5272 if (ret != PMINFO_R_OK) {
5273 pkgmgrinfo_appinfo_filter_destroy(handle);
5276 printf("No of capp: %d\n", count);
5277 pkgmgrinfo_appinfo_filter_destroy(handle);
5282 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5285 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5286 * @brief This API destroys the application information filter handle freeing up all the resources
5288 * @par This API is for package-manager client application
5289 * @par Sync (or) Async : Synchronous API
5291 * @param[in] handle pointer to the application info filter handle.
5292 * @return 0 if success, error code(<0) if fail
5293 * @retval PMINFO_R_OK success
5294 * @retval PMINFO_R_EINVAL invalid argument
5295 * @retval PMINFO_R_ERROR internal error
5296 * @pre pkgmgrinfo_appinfo_filter_create()
5298 * @see pkgmgrinfo_appinfo_filter_count()
5299 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5301 static int get_capp_count()
5305 pkgmgrinfo_appinfo_filter_h handle;
5306 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5307 if (ret != PMINFO_R_OK)
5309 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5310 if (ret != PMINFO_R_OK) {
5311 pkgmgrinfo_appinfo_filter_destroy(handle);
5314 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5315 if (ret != PMINFO_R_OK) {
5316 pkgmgrinfo_appinfo_filter_destroy(handle);
5319 printf("No of capp: %d\n", count);
5320 pkgmgrinfo_appinfo_filter_destroy(handle);
5325 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5328 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5329 * @brief This API adds a boolean filter property to the filter handle
5331 * @par This API is for package-manager client application
5332 * @par Sync (or) Async : Synchronous API
5334 * @param[in] handle pointer to the application info filter handle.
5335 * @param[in] property boolean property name.
5336 * @param[in] value value corresponding to the property.
5337 * @return 0 if success, error code(<0) if fail
5338 * @retval PMINFO_R_OK success
5339 * @retval PMINFO_R_EINVAL invalid argument
5340 * @retval PMINFO_R_ERROR internal error
5341 * @pre pkgmgrinfo_appinfo_filter_create()
5342 * @post pkgmgrinfo_appinfo_filter_destroy()
5343 * @see pkgmgrinfo_appinfo_filter_count()
5344 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5346 static int get_taskmanageable_app_count()
5350 pkgmgrinfo_appinfo_filter_h handle;
5351 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5352 if (ret != PMINFO_R_OK)
5354 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5355 if (ret != PMINFO_R_OK) {
5356 pkgmgrinfo_appinfo_filter_destroy(handle);
5359 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5360 if (ret != PMINFO_R_OK) {
5361 pkgmgrinfo_appinfo_filter_destroy(handle);
5364 printf("No of taskmanageable apps: %d\n", count);
5365 pkgmgrinfo_appinfo_filter_destroy(handle);
5370 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5371 const char *property, const bool value);
5374 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5375 * @brief This API adds an integer filter property to the filter handle
5377 * @par This API is for package-manager client application
5378 * @par Sync (or) Async : Synchronous API
5380 * @param[in] handle pointer to the application info filter handle.
5381 * @param[in] property integer property name.
5382 * @param[in] value value corresponding to the property.
5383 * @return 0 if success, error code(<0) if fail
5384 * @retval PMINFO_R_OK success
5385 * @retval PMINFO_R_EINVAL invalid argument
5386 * @retval PMINFO_R_ERROR internal error
5387 * @pre pkgmgrinfo_appinfo_filter_create()
5388 * @post pkgmgrinfo_appinfo_filter_destroy()
5389 * @see pkgmgrinfo_appinfo_filter_count()
5390 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5392 static int get_taskmanageable_app_count()
5396 pkgmgrinfo_appinfo_filter_h handle;
5397 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5398 if (ret != PMINFO_R_OK)
5400 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5401 if (ret != PMINFO_R_OK) {
5402 pkgmgrinfo_appinfo_filter_destroy(handle);
5405 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5406 if (ret != PMINFO_R_OK) {
5407 pkgmgrinfo_appinfo_filter_destroy(handle);
5410 printf("No of apps: %d\n", count);
5411 pkgmgrinfo_appinfo_filter_destroy(handle);
5416 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5417 const char *property, const int value);
5420 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5421 * @brief This API adds a string filter property to the filter handle
5423 * @par This API is for package-manager client application
5424 * @par Sync (or) Async : Synchronous API
5426 * @param[in] handle pointer to the application info filter handle.
5427 * @param[in] property string property name.
5428 * @param[in] value value corresponding to the property.
5429 * @return 0 if success, error code(<0) if fail
5430 * @retval PMINFO_R_OK success
5431 * @retval PMINFO_R_EINVAL invalid argument
5432 * @retval PMINFO_R_ERROR internal error
5433 * @pre pkgmgrinfo_appinfo_filter_create()
5434 * @post pkgmgrinfo_appinfo_filter_destroy()
5435 * @see pkgmgrinfo_appinfo_filter_count()
5436 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5438 static int get_capp_count()
5442 pkgmgrinfo_appinfo_filter_h handle;
5443 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5444 if (ret != PMINFO_R_OK)
5446 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5447 if (ret != PMINFO_R_OK) {
5448 pkgmgrinfo_appinfo_filter_destroy(handle);
5451 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5452 if (ret != PMINFO_R_OK) {
5453 pkgmgrinfo_appinfo_filter_destroy(handle);
5456 printf("No of capp: %d\n", count);
5457 pkgmgrinfo_appinfo_filter_destroy(handle);
5462 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5463 const char *property, const char *value);
5466 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5467 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5469 * @par This API is for package-manager client application
5470 * @par Sync (or) Async : Synchronous API
5472 * @param[in] handle pointer to the application info filter handle.
5473 * @param[in] app_cb callback function.
5474 * @param[in] user_data user data to be passed to the callback function
5475 * @return 0 if success, error code(<0) if fail
5476 * @retval PMINFO_R_OK success
5477 * @retval PMINFO_R_EINVAL invalid argument
5478 * @retval PMINFO_R_ERROR internal error
5479 * @pre pkgmgrinfo_appinfo_filter_create()
5480 * @post pkgmgrinfo_appinfo_filter_destroy()
5481 * @see pkgmgrinfo_appinfo_filter_count()
5483 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5486 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5487 printf("appid : %s\n", appid);
5491 static int get_capp_list()
5494 pkgmgrinfo_appinfo_filter_h handle;
5495 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5496 if (ret != PMINFO_R_OK)
5498 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5499 if (ret != PMINFO_R_OK) {
5500 pkgmgrinfo_appinfo_filter_destroy(handle);
5503 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5504 if (ret != PMINFO_R_OK) {
5505 pkgmgrinfo_appinfo_filter_destroy(handle);
5508 pkgmgrinfo_appinfo_filter_destroy(handle);
5513 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5514 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5515 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5516 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5519 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5520 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5521 * @brief This API counts the application that satisfy the filter conditions
5523 * @par This API is for package-manager client application
5524 * @par Sync (or) Async : Synchronous API
5526 * @param[in] handle pointer to the application info filter handle.
5527 * @param[in] count pointer to store count value
5528 * @param[in] uid the addressee user id of the instruction
5529 * @return 0 if success, error code(<0) if fail
5530 * @retval PMINFO_R_OK success
5531 * @retval PMINFO_R_EINVAL invalid argument
5532 * @retval PMINFO_R_ERROR internal error
5533 * @pre pkgmgrinfo_appinfo_filter_create()
5534 * @post pkgmgrinfo_appinfo_filter_destroy()
5535 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5537 static int get_capp_count()
5541 pkgmgrinfo_appinfo_filter_h handle;
5542 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5543 if (ret != PMINFO_R_OK)
5545 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5546 if (ret != PMINFO_R_OK) {
5547 pkgmgrinfo_appinfo_filter_destroy(handle);
5550 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5551 if (ret != PMINFO_R_OK) {
5552 pkgmgrinfo_appinfo_filter_destroy(handle);
5555 printf("No of capp: %d\n", count);
5556 pkgmgrinfo_appinfo_filter_destroy(handle);
5561 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5562 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5564 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5565 * @brief This API creates the application's metadata information filter handle from db.
5567 * @par This API is for package-manager client application
5568 * @par Sync (or) Async : Synchronous API
5570 * @param[out] handle pointer to the application metadata info filter handle.
5571 * @return 0 if success, error code(<0) if fail
5572 * @retval PMINFO_R_OK success
5573 * @retval PMINFO_R_EINVAL invalid argument
5574 * @retval PMINFO_R_ERROR internal error
5576 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5577 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5579 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5582 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5583 printf("appid : %s\n", appid);
5587 static int get_app_list(const char *mkey, const char *mvalue)
5590 pkgmgrinfo_appinfo_metadata_filter_h handle;
5591 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5592 if (ret != PMINFO_R_OK)
5594 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5595 if (ret != PMINFO_R_OK) {
5596 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5599 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5600 if (ret != PMINFO_R_OK) {
5601 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5604 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5609 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5612 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5613 * @brief This API destroys the application's metadata information filter handle.
5615 * @par This API is for package-manager client application
5616 * @par Sync (or) Async : Synchronous API
5618 * @param[in] handle pointer to the application metadata info filter handle.
5619 * @return 0 if success, error code(<0) if fail
5620 * @retval PMINFO_R_OK success
5621 * @retval PMINFO_R_EINVAL invalid argument
5622 * @retval PMINFO_R_ERROR internal error
5623 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5625 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5627 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5630 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5631 printf("appid : %s\n", appid);
5635 static int get_app_list(const char *mkey, const char *mvalue)
5638 pkgmgrinfo_appinfo_metadata_filter_h handle;
5639 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5640 if (ret != PMINFO_R_OK)
5642 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5643 if (ret != PMINFO_R_OK) {
5644 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5647 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5648 if (ret != PMINFO_R_OK) {
5649 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5652 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5657 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5660 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5661 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5662 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5664 * @par This API is for package-manager client application
5665 * @par Sync (or) Async : Synchronous API
5667 * @param[in] handle pointer to the application metadata info filter handle.
5668 * @param[in] key pointer to metadata key
5669 * @param[in] value pointer to metadata value
5670 * @return 0 if success, error code(<0) if fail
5671 * @retval PMINFO_R_OK success
5672 * @retval PMINFO_R_EINVAL invalid argument
5673 * @retval PMINFO_R_ERROR internal error
5674 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5675 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5676 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5678 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5681 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5682 printf("appid : %s\n", appid);
5686 static int get_app_list(const char *mkey, const char *mvalue)
5689 pkgmgrinfo_appinfo_metadata_filter_h handle;
5690 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5691 if (ret != PMINFO_R_OK)
5693 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5694 if (ret != PMINFO_R_OK) {
5695 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5698 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5699 if (ret != PMINFO_R_OK) {
5700 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5703 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5708 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5709 const char *key, const char *value);
5712 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5713 * @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)
5714 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5715 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5716 * negative value, no more callbacks will be called and API will return.
5718 * @par This API is for package-manager client application
5719 * @par Sync (or) Async : Synchronous API
5721 * @param[in] handle pointer to the application metadata info filter handle.
5722 * @param[in] app_cb function pointer to callback
5723 * @param[in] user_data pointer to user data
5724 * @param[in] uid the addressee user id of the instruction
5725 * @return 0 if success, error code(<0) if fail
5726 * @retval PMINFO_R_OK success
5727 * @retval PMINFO_R_EINVAL invalid argument
5728 * @retval PMINFO_R_ERROR internal error
5729 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5730 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5732 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5735 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5736 printf("appid : %s\n", appid);
5740 static int get_app_list(const char *mkey, const char *mvalue)
5743 pkgmgrinfo_appinfo_metadata_filter_h handle;
5744 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5745 if (ret != PMINFO_R_OK)
5747 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5748 if (ret != PMINFO_R_OK) {
5749 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5752 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5753 if (ret != PMINFO_R_OK) {
5754 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5757 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5762 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5763 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5764 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5765 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5768 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5769 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5770 * @fn int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5771 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5772 * @brief This API gets the list of app-control for a particular application
5774 * @par This API is for package-manager client application
5775 * @par Sync (or) Async : Synchronous API
5776 * @param[in] handle pointer to the application info handle.
5777 * @param[in] appcontrol_func callback function for list
5778 * @param[in] user_data user data to be passed to callback function
5779 * @return 0 if success, error code(<0) if fail
5780 * @retval PMINFO_R_OK success
5781 * @retval PMINFO_R_EINVAL invalid argument
5782 * @retval PMINFO_R_ERROR internal error
5783 * @pre pkgmgrinfo_appinfo_get_appinfo()
5784 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5786 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5787 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5789 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5790 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5793 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5794 * @brief This API creates the package cert information handle to get data from db.
5796 * @par This API is for package-manager client application
5797 * @par Sync (or) Async : Synchronous API
5799 * @param[out] handle pointer to the package cert handle.
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
5805 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5806 * @see pkgmgrinfo_pkginfo_get_cert_value()
5807 * @see pkgmgrinfo_pkginfo_load_certinfo()
5809 static int get_cert_info(const char *pkgid)
5812 pkgmgrinfo_certinfo_h handle;
5813 char *auth_cert = NULL;
5814 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5815 if (ret != PMINFO_R_OK)
5817 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5818 if (ret != PMINFO_R_OK) {
5819 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5822 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5823 if (ret != PMINFO_R_OK) {
5824 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5827 printf("Author root certificate: %s\n", auth_root);
5828 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5833 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5836 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5837 * @brief This API loads the package cert information handle with data from db.
5839 * @par This API is for package-manager client application
5840 * @par Sync (or) Async : Synchronous API
5842 * @param[in] pkgid pointer to the package ID.
5843 * @param[in] handle pointer to the package cert handle.
5844 * @return 0 if success, error code(<0) if fail
5845 * @retval PMINFO_R_OK success
5846 * @retval PMINFO_R_EINVAL invalid argument
5847 * @retval PMINFO_R_ERROR internal error
5848 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5849 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5850 * @see pkgmgrinfo_pkginfo_get_cert_value()
5852 static int get_cert_info(const char *pkgid)
5855 pkgmgrinfo_certinfo_h handle;
5856 char *auth_cert = NULL;
5857 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5858 if (ret != PMINFO_R_OK)
5860 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5861 if (ret != PMINFO_R_OK) {
5862 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5865 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5866 if (ret != PMINFO_R_OK) {
5867 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5870 printf("Author root certificate: %s\n", auth_root);
5871 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5876 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5879 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5880 * @brief This API gets the package cert information from the handle
5882 * @par This API is for package-manager client application
5883 * @par Sync (or) Async : Synchronous API
5885 * @param[in] handle pointer to the package cert handle.
5886 * @param[in] cert_type certificate type
5887 * @param[out] cert_value pointer to hold certificate value
5888 * @return 0 if success, error code(<0) if fail
5889 * @retval PMINFO_R_OK success
5890 * @retval PMINFO_R_EINVAL invalid argument
5891 * @retval PMINFO_R_ERROR internal error
5892 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5893 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5894 * @see pkgmgrinfo_pkginfo_load_certinfo()
5896 static int get_cert_info(const char *pkgid)
5899 pkgmgrinfo_certinfo_h handle;
5900 char *auth_cert = NULL;
5901 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5902 if (ret != PMINFO_R_OK)
5904 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5905 if (ret != PMINFO_R_OK) {
5906 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5909 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5910 if (ret != PMINFO_R_OK) {
5911 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5914 printf("Author root certificate: %s\n", auth_root);
5915 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5920 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5923 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5924 * @brief This API destroys the package cert information handle freeing up all the resources
5926 * @par This API is for package-manager client application
5927 * @par Sync (or) Async : Synchronous API
5929 * @param[in] handle pointer to the package cert handle.
5930 * @return 0 if success, error code(<0) if fail
5931 * @retval PMINFO_R_OK success
5932 * @retval PMINFO_R_EINVAL invalid argument
5933 * @retval PMINFO_R_ERROR internal error
5934 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5936 * @see pkgmgrinfo_pkginfo_load_certinfo()
5938 static int get_cert_info(const char *pkgid)
5941 pkgmgrinfo_certinfo_h handle;
5942 char *auth_cert = NULL;
5943 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5944 if (ret != PMINFO_R_OK)
5946 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5947 if (ret != PMINFO_R_OK) {
5948 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5951 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5952 if (ret != PMINFO_R_OK) {
5953 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5956 printf("Author root certificate: %s\n", auth_root);
5957 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5962 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5965 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5966 * @brief This API deletes the package cert information from DB
5968 * @par This API is for package-manager client application
5969 * @par Sync (or) Async : Synchronous API
5971 * @param[in] pkgid pointer to the package ID.
5972 * @return 0 if success, error code(<0) if fail
5973 * @retval PMINFO_R_OK success
5974 * @retval PMINFO_R_EINVAL invalid argument
5975 * @retval PMINFO_R_ERROR internal error
5979 static int delete_cert_info(const char *pkgid)
5982 ret = pkgmgrinfo_delete_certinfo(pkgid);
5983 if (ret != PMINFO_R_OK)
5989 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5990 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5993 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5994 * @brief This API creates the package cert information handle to set data in db.
5996 * @par This API is for package-manager client application
5997 * @par Sync (or) Async : Synchronous API
5999 * @param[out] handle pointer to the package cert handle.
6000 * @return 0 if success, error code(<0) if fail
6001 * @retval PMINFO_R_OK success
6002 * @retval PMINFO_R_EINVAL invalid argument
6003 * @retval PMINFO_R_ERROR internal error
6005 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6006 * @see pkgmgrinfo_set_cert_value()
6007 * @see pkgmgrinfo_save_certinfo()
6009 static int set_cert_in_db(const char *pkgid)
6012 pkgmgrinfo_instcertinfo_h handle;
6013 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6014 if (ret != PMINFO_R_OK)
6016 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6017 if (ret != PMINFO_R_OK) {
6018 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6021 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6022 if (ret != PMINFO_R_OK) {
6023 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6026 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6031 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
6034 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
6035 * @brief This API sets the package cert information in the handle.
6037 * @par This API is for package-manager client application
6038 * @par Sync (or) Async : Synchronous API
6040 * @param[in] handle pointer to the package cert handle.
6041 * @param[in] cert_type certificate type.
6042 * @param[in] cert_value certificate value.
6043 * @return 0 if success, error code(<0) if fail
6044 * @retval PMINFO_R_OK success
6045 * @retval PMINFO_R_EINVAL invalid argument
6046 * @retval PMINFO_R_ERROR internal error
6047 * @pre pkgmgrinfo_create_certinfo_set_handle()
6048 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6049 * @see pkgmgrinfo_save_certinfo()
6051 static int set_cert_in_db(const char *pkgid)
6054 pkgmgrinfo_instcertinfo_h handle;
6055 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6056 if (ret != PMINFO_R_OK)
6058 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6059 if (ret != PMINFO_R_OK) {
6060 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6063 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6064 if (ret != PMINFO_R_OK) {
6065 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6068 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6073 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6076 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6077 * @brief This API saves the package cert information in the DB.
6079 * @par This API is for package-manager client application
6080 * @par Sync (or) Async : Synchronous API
6082 * @param[in] pkgid pointer to the package ID.
6083 * @param[in] handle pointer to the package cert handle.
6084 * @return 0 if success, error code(<0) if fail
6085 * @retval PMINFO_R_OK success
6086 * @retval PMINFO_R_EINVAL invalid argument
6087 * @retval PMINFO_R_ERROR internal error
6088 * @pre pkgmgrinfo_create_certinfo_set_handle()
6089 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6090 * @see pkgmgrinfo_save_certinfo()
6092 static int set_cert_in_db(const char *pkgid)
6095 pkgmgrinfo_instcertinfo_h handle;
6096 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6097 if (ret != PMINFO_R_OK)
6099 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6100 if (ret != PMINFO_R_OK) {
6101 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6104 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6105 if (ret != PMINFO_R_OK) {
6106 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6109 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6114 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6117 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6118 * @brief This API destroys the package cert information handle freeing up all the resources.
6120 * @par This API is for package-manager client application
6121 * @par Sync (or) Async : Synchronous API
6123 * @param[in] handle pointer to the package cert handle.
6124 * @return 0 if success, error code(<0) if fail
6125 * @retval PMINFO_R_OK success
6126 * @retval PMINFO_R_EINVAL invalid argument
6127 * @retval PMINFO_R_ERROR internal error
6128 * @pre pkgmgrinfo_create_certinfo_set_handle()
6130 * @see pkgmgrinfo_save_certinfo()
6132 static int set_cert_in_db(const char *pkgid)
6135 pkgmgrinfo_instcertinfo_h handle;
6136 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6137 if (ret != PMINFO_R_OK)
6139 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6140 if (ret != PMINFO_R_OK) {
6141 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6144 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6145 if (ret != PMINFO_R_OK) {
6146 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6149 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6154 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6157 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6158 * @brief This API gets the application 'guest mode visibility' value from the DB
6160 * @par This API is for package-manager client application
6161 * @par Sync (or) Async : Synchronous API
6163 * @param[in] handle pointer to application info handle
6164 * @param[out] status pointer to hold app guest mode visibility value
6165 * @return 0 if success, error code(<0) if fail
6166 * @retval PMINFO_R_OK success
6167 * @retval PMINFO_R_EINVAL invalid argument
6168 * @retval PMINFO_R_ERROR internal error
6169 * @pre pkgmgrinfo_appinfo_get_appinfo()
6170 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6171 * @see pkgmgrinfo_appinfo_get_appid()
6172 * @see pkgmgrinfo_appinfo_is_multiple()
6174 static int get_app_guestmode_visibility(const char *appid)
6178 pkgmgrinfo_appinfo_h handle;
6179 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6180 if (ret != PMINFO_R_OK)
6182 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6183 if (ret != PMINFO_R_OK) {
6184 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6187 printf("app guest mode visibility: %d\n", status);
6188 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6193 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6196 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6197 * @brief This API sets the package 'installed_storage' value in db
6199 * @par This API is for package-manager client application
6200 * @par Sync (or) Async : Synchronous API
6202 * @param[in] pkgid pointer to the package ID.
6203 * @param[in] location package install location
6204 * @param[in] external_pkg_path image path if pkg has installed at external storage
6205 * @return 0 if success, error code(<0) if fail
6206 * @retval PMINFO_R_OK success
6207 * @retval PMINFO_R_EINVAL invalid argument
6208 * @retval PMINFO_R_ERROR internal error
6210 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6214 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6215 if (ret != PMINFO_R_OK) {
6222 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6223 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6225 /* version compare */
6226 int pkgmgrinfo_compare_package_version(const char *current_version,
6227 const char *target_version, pkgmgrinfo_version_compare_type *res);
6230 * @fn int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6231 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6233 * @brief This API gets the list of dependency of a particular package
6235 * @par This API is for package-manager client application
6236 * @par Sync (or) Async : Synchronous API
6237 * @param[in] handle pointer to the package info handle.
6238 * @param[in] dependency_cb callback function for list
6239 * @param[in] user_data user data to be passed to callback function
6240 * @return 0 if success, error code(<0) if fail
6241 * @retval PMINFO_R_OK success
6242 * @retval PMINFO_R_EINVAL invalid argument
6243 * @retval PMINFO_R_ERROR internal error
6244 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6245 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6247 int dependency_cb(const char *from const char *to, const char *type,
6248 const char *required_version,void *user_data)
6250 printf("this package %s %s", type, to);
6251 if (required_version)
6252 printf("required version : %s", required_version);
6256 static int list_dependency(const char *package)
6259 pkgmgrinfo_pkginfo_h handle;
6260 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6261 if (ret != PMINFO_R_OK)
6263 ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6264 if (ret != PMINFO_R_OK) {
6265 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6268 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6273 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6274 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6278 * @fn int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6279 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6281 * @brief This API gets the list of packages which has dependency directly
6282 * and indirectly of a particular package
6284 * @par This API is for package-manager client application
6285 * @par Sync (or) Async : Synchronous API
6286 * @param[in] handle pointer to the package info handle.
6287 * @param[in] dependency_cb callback function for list
6288 * @param[in] user_data user data to be passed to callback function
6289 * @return 0 if success, error code(<0) if fail
6290 * @retval PMINFO_R_OK success
6291 * @retval PMINFO_R_EINVAL invalid argument
6292 * @retval PMINFO_R_ERROR internal error
6293 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6294 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6296 int dependency_cb(const char *from, const char *to, const char *type,
6297 const char *required_version,void *user_data)
6299 printf("%s %s %s package", from, to, type);
6300 if (required_version)
6301 printf("required version : %s", required_version);
6305 static int list_depends_on(const char *package)
6308 pkgmgrinfo_pkginfo_h handle;
6309 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6310 if (ret != PMINFO_R_OK)
6312 ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6313 if (ret != PMINFO_R_OK) {
6314 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6317 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6322 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6323 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6327 * @fn int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6328 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6330 * @brief This API gets the list of allowed package for a particular package
6332 * @par This API is for package-manager client application
6333 * @par Sync (or) Async : Synchronous API
6334 * @param[in] handle pointer to the package info handle.
6335 * @param[in] res_allowed_package_cb callback function for list
6336 * @param[in] user_data user data to be passed to callback function
6337 * @return 0 if success, error code(<0) if fail
6338 * @retval PMINFO_R_OK success
6339 * @retval PMINFO_R_EINVAL invalid argument
6340 * @retval PMINFO_R_ERROR internal error
6341 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6342 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6344 int res_allowed_package_cb(const char *allowed_package,
6345 required_privilege_h handle, void *user_data)
6347 printf("allowed package : %s", allowed_package);
6352 static int list_res_allowed_package(const char *package)
6355 pkgmgrinfo_pkginfo_h handle;
6356 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6357 if (ret != PMINFO_R_OK)
6359 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6360 if (ret != PMINFO_R_OK) {
6361 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6364 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6369 int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6370 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6374 * @fn int pkgmgrinfo_pkginfo_foreach_required_privilege(
6375 required_privilege_h handle,
6376 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6378 * @brief This API gets the list of allowed package's required privileges
6380 * @par This API is for package-manager client application
6381 * @par Sync (or) Async : Synchronous API
6382 * @param[in] handle pointer to the required privilege handle.
6383 * @param[in] privilege_func callback function for list
6384 * @param[in] user_data user data to be passed to callback function
6385 * @return 0 if success, error code(<0) if fail
6386 * @retval PMINFO_R_OK success
6387 * @retval PMINFO_R_EINVAL invalid argument
6388 * @pre pkgmgrinfo_pkginfo_foreach_res_allowed_package()
6391 int privilege_func(const char *privilege_name, void *user_data)
6393 printf("required privilege : %s", privilege_name);
6398 int res_allowed_package_cb(const char *allowed_package,
6399 required_privilege_h handle, void *user_data)
6402 printf("allowed package : %s", allowed_package);
6404 ret = pkgmgrinfo_pkginfo_foreach_required_privilege(handle, privilege_func, user_data);
6405 if (ret != PMINFO_R_OK)
6411 static int list_res_allowed_package(const char *package)
6414 pkgmgrinfo_pkginfo_h handle;
6415 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6416 if (ret != PMINFO_R_OK)
6418 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6419 if (ret != PMINFO_R_OK) {
6420 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6428 int pkgmgrinfo_pkginfo_foreach_required_privilege(
6429 required_privilege_h handle,
6430 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6434 * @fn int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6435 * @brief This API gets list of installed packages using flag that used for masking package's information
6437 * @par This API is for package-manager client application
6438 * @par Sync (or) Async : Synchronous API
6439 * @param[in] pkg_list_cb iteration function for list
6440 * @param[in] flag enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6441 * @param[in] user_data user data to be passed to callback function
6442 * @return 0 if success, error code(<0) if fail
6443 * @retval PMINFO_R_OK success
6444 * @retval PMINFO_R_EINVAL invalid argument
6445 * @retval PMINFO_R_ERROR internal error
6448 * @see pkgmgrinfo_pkginfo_get_option
6450 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6452 char *label1 = NULL;
6453 char *label2 = NULL;
6454 label1 = (char *)user_data;
6455 pkgmgrinfo_pkginfo_get_label(handle, &label2);
6456 if (strcmp(label1, label2) == 0)
6462 static int list_pkgs()
6465 char *label = "helloworld";
6466 ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6467 if (ret != PMINFO_R_OK)
6473 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6474 int flag, void *user_data, uid_t uid);
6475 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6476 int flag, void *user_data);
6479 * @fn int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6480 * @brief This API gets list of installed applications from all packages using flag that used for masking application's information
6482 * @par This API is for package-manager client application
6483 * @par Sync (or) Async : Synchronous API
6484 * @param[in] app_func iteration function for list
6485 * @param[in] flag enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6486 * @param[in] user_data user data to be passed to callback function
6487 * @return 0 if success, error code(<0) if fail
6488 * @retval PMINFO_R_OK success
6489 * @retval PMINFO_R_EINVAL invalid argument
6490 * @retval PMINFO_R_ERROR internal error
6493 * @see pkgmgrinfo_appinfo_get_option
6495 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6498 char *label1 = NULL;
6499 char *label2 = NULL;
6500 label1 = (char *)user_data;
6501 ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6502 if (ret != PMINFO_R_OK) {
6503 printf("pkgmgrinfo_appinfo_get_label fail");
6506 if (strcmp(label1, label2) == 0)
6512 static int list_apps()
6515 char *label = "helloworld";
6516 ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6517 if (ret != PMINFO_R_OK)
6523 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6524 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6526 int pkgmgrinfo_appinfo_get_installed_list_full(
6527 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6530 * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6531 * @brief This API creates the package archive information handle from given path
6533 * @par This API is for package-manager client application
6534 * @par Sync (or) Async : Synchronous API
6536 * @param[in] path path of package archive
6537 * @param[out] handle pointer to the package archive info handle
6538 * @return 0 if success, error code(<0) if fail
6539 * @retval PMINFO_R_OK success
6540 * @retval PMINFO_R_EINVAL invalid argument
6541 * @retval PMINFO_R_ERROR internal error
6543 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6545 static int get_pkg_archive_type(const char *path)
6549 pkgmgrinfo_archiveinfo_h handle;
6550 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6551 if (ret != PMINFO_R_OK)
6553 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6554 if (ret != PMINFO_R_OK) {
6555 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6558 printf("pkg archive type: %s\n", type);
6559 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6564 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6565 pkgmgrinfo_archiveinfo_h *handle);
6568 * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6569 * @brief This API destroys the package archive information handle freeing up all the resources
6571 * @par This API is for package-manager client application
6572 * @par Sync (or) Async : Synchronous API
6574 * @param[in] handle pointer to the package archive info handle
6575 * @return 0 if success, error code(<0) if fail
6576 * @retval PMINFO_R_OK success
6577 * @retval PMINFO_R_EINVAL invalid argument
6578 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6581 static int get_pkg_archive_type(const char *path)
6585 pkgmgrinfo_archiveinfo_h handle;
6586 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6587 if (ret != PMINFO_R_OK)
6589 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6590 if (ret != PMINFO_R_OK) {
6591 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6594 printf("pkg archive type: %s\n", type);
6595 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6600 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6603 * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6604 * @brief This API gets the package id from the package archive info handle
6606 * @par This API is for package-manager client application
6607 * @par Sync (or) Async : Synchronous API
6609 * @param[in] handle pointer to package archive info handle
6610 * @param[out] pkgid pointer to hold package id
6611 * @return 0 if success, error code(<0) if fail
6612 * @retval PMINFO_R_OK success
6613 * @retval PMINFO_R_EINVAL invalid argument
6614 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6615 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6617 static int get_pkg_archive_id(const char *path)
6620 char *pkg_id = NULL;
6621 pkgmgrinfo_archiveinfo_h handle;
6622 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6623 if (ret != PMINFO_R_OK)
6625 ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6626 if (ret != PMINFO_R_OK) {
6627 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6630 printf("pkg archive id: %s\n", pkg_id);
6631 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6636 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6637 const char **pkgid);
6640 * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6641 * @brief This API gets the package type from the package archive info handle
6643 * @par This API is for package-manager client application
6644 * @par Sync (or) Async : Synchronous API
6646 * @param[in] handle pointer to package archive info handle
6647 * @param[out] type pointer to hold package type
6648 * @return 0 if success, error code(<0) if fail
6649 * @retval PMINFO_R_OK success
6650 * @retval PMINFO_R_EINVAL invalid argument
6651 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6652 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6654 static int get_pkg_archive_type(const char *path)
6658 pkgmgrinfo_archiveinfo_h handle;
6659 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6660 if (ret != PMINFO_R_OK)
6662 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6663 if (ret != PMINFO_R_OK) {
6664 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6667 printf("pkg archive type: %s\n", type);
6668 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6673 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6677 * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
6678 * @brief This API gets the package version from the package archive info handle
6680 * @par This API is for package-manager client application
6681 * @par Sync (or) Async : Synchronous API
6683 * @param[in] handle pointer to package archive info handle
6684 * @param[out] version pointer to hold package version
6685 * @return 0 if success, error code(<0) if fail
6686 * @retval PMINFO_R_OK success
6687 * @retval PMINFO_R_EINVAL invalid argument
6688 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6689 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6691 static int get_pkg_archive_version(const char *path)
6694 char *version = NULL;
6695 pkgmgrinfo_archiveinfo_h handle;
6696 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6697 if (ret != PMINFO_R_OK)
6699 ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
6700 if (ret != PMINFO_R_OK) {
6701 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6704 printf("pkg archive version: %s\n", version);
6705 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6710 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6711 const char **version);
6714 * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
6715 * @brief This API gets the package api version from the package archive info handle
6717 * @par This API is for package-manager client application
6718 * @par Sync (or) Async : Synchronous API
6720 * @param[in] handle pointer to package archive info handle
6721 * @param[out] api_version pointer to hold package api_version
6722 * @return 0 if success, error code(<0) if fail
6723 * @retval PMINFO_R_OK success
6724 * @retval PMINFO_R_EINVAL invalid argument
6725 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6726 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6728 static int get_pkg_archive_api_version(const char *path)
6731 char *api_version = NULL;
6732 pkgmgrinfo_archiveinfo_h handle;
6733 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6734 if (ret != PMINFO_R_OK)
6736 ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
6737 if (ret != PMINFO_R_OK) {
6738 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6741 printf("pkg archive api_version: %s\n", api_version);
6742 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6747 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6748 const char **api_version);
6751 * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
6752 * @brief This API gets the package description from the package archive info handle
6754 * @par This API is for package-manager client application
6755 * @par Sync (or) Async : Synchronous API
6757 * @param[in] handle pointer to package archive info handle
6758 * @param[out] description pointer to hold package description
6759 * @return 0 if success, error code(<0) if fail
6760 * @retval PMINFO_R_OK success
6761 * @retval PMINFO_R_EINVAL invalid argument
6762 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6763 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6765 static int get_pkg_archive_description(const char *path)
6768 char *description = NULL;
6769 pkgmgrinfo_archiveinfo_h handle;
6770 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6771 if (ret != PMINFO_R_OK)
6773 ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
6774 if (ret != PMINFO_R_OK) {
6775 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6778 printf("pkg archive description: %s\n", description);
6779 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6784 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6785 const char **description);
6788 * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
6789 * @brief This API gets the package label from the package archive info handle
6791 * @par This API is for package-manager client application
6792 * @par Sync (or) Async : Synchronous API
6794 * @param[in] handle pointer to package archive info handle
6795 * @param[out] label pointer to hold package label
6796 * @return 0 if success, error code(<0) if fail
6797 * @retval PMINFO_R_OK success
6798 * @retval PMINFO_R_EINVAL invalid argument
6799 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6800 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6802 static int get_pkg_archive_label(const char *path)
6806 pkgmgrinfo_archiveinfo_h handle;
6807 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6808 if (ret != PMINFO_R_OK)
6810 ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
6811 if (ret != PMINFO_R_OK) {
6812 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6815 printf("pkg archive label: %s\n", label);
6816 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6821 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6822 const char **label);
6825 * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
6826 * @brief This API gets the package author from the package archive info handle
6828 * @par This API is for package-manager client application
6829 * @par Sync (or) Async : Synchronous API
6831 * @param[in] handle pointer to package archive info handle
6832 * @param[out] author pointer to hold package author
6833 * @return 0 if success, error code(<0) if fail
6834 * @retval PMINFO_R_OK success
6835 * @retval PMINFO_R_EINVAL invalid argument
6836 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6837 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6839 static int get_pkg_archive_author(const char *path)
6842 char *author = NULL;
6843 pkgmgrinfo_archiveinfo_h handle;
6844 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6845 if (ret != PMINFO_R_OK)
6847 ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
6848 if (ret != PMINFO_R_OK) {
6849 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6852 printf("pkg archive author: %s\n", author);
6853 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6858 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6859 const char **author);
6862 * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
6863 * @brief This API gets the package icon and size from the package archive info handle
6865 * @par This API is for package-manager client application
6866 * @par Sync (or) Async : Synchronous API
6868 * @param[in] handle pointer to package archive info handle
6869 * @param[out] icon pointer to hold package icon
6870 * @param[out] size pointer to hold size of package icon
6871 * @return 0 if success, error code(<0) if fail
6872 * @retval PMINFO_R_OK success
6873 * @retval PMINFO_R_EINVAL invalid argument
6874 * @retval PMINFO_R_ENOENT no result
6875 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6876 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6878 static int get_pkg_archive_icon(const char *path)
6881 unsigned char *icon = NULL;
6882 size_t icon_size = 0;
6883 pkgmgrinfo_archiveinfo_h handle;
6884 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6885 if (ret != PMINFO_R_OK)
6887 ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
6888 if (ret != PMINFO_R_OK) {
6889 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6892 printf("pkg archive icon size : %zu\n", icon_size);
6893 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6898 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6899 const unsigned char **icon, size_t *size);
6902 * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
6903 * @brief This API retrieve the dependency information and invoke given callback for it.
6905 * @par This API is for package-manager client application
6906 * @par Sync (or) Async : Synchronous API
6908 * @param[in] handle pointer to package archive info handle
6909 * @param[in] callback callback to be invoked for each retrieved dependency information
6910 * @param[in] user_data user data to be passed to callback
6911 * @return 0 if success, error code(<0) if fail
6912 * @retval PMINFO_R_OK success
6913 * @retval PMINFO_R_EINVAL invalid argument
6914 * @retval PMINFO_R_ERROR internal error
6915 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6916 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6918 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
6921 size_t icon_size = 0;
6922 pkgmgrinfo_archiveinfo_h handle;
6923 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6924 if (ret != PMINFO_R_OK)
6926 ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
6927 if (ret != PMINFO_R_OK) {
6928 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6931 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6936 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
6937 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
6940 * @pkgmgrinfo client API end
6948 #endif /* __PKG_INFO_H__ */