4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
117 /** Integer property for filtering based on package info*/
118 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
147 /** Integer property for filtering app support mode */
148 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
173 /** will be updated*/
174 /** string property for filtering based on pkg info*/
175 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
177 /* For multiuser support */
178 const char *getIconPath(uid_t uid, bool readonly);
179 char *getUserPkgParserDBPath(void);
180 char *getUserPkgParserDBPathUID(uid_t uid);
181 char *getUserPkgCertDBPath(void);
182 char *getUserPkgCertDBPathUID(uid_t uid);
183 const char *getUserManifestPath(uid_t uid, bool readonly);
186 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
187 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
188 * @brief This API gets list of installed packages
190 * @par This API is for package-manager client application
191 * @par Sync (or) Async : Synchronous API
192 * @param[in] pkg_list_cb iteration function for list
193 * @param[in] user_data user data to be passed to callback function
194 * @param[in] uid the addressee user id of the instruction
195 * @return 0 if success, error code(<0) if fail
196 * @retval PMINFO_R_OK success
197 * @retval PMINFO_R_EINVAL invalid argument
198 * @retval PMINFO_R_ERROR internal error
202 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
206 pkgid1 = (char *)user_data;
207 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
208 if (strcmp(pkgid1, pkgid2) == 0) {
215 static int list_pkgs()
218 char *name = "helloworld";
219 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
220 if (ret != PMINFO_R_OK) {
227 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
228 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
231 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
232 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
233 * @brief This API gets list of disabled packages
235 * @par This API is for package-manager client application
236 * @par Sync (or) Async : Synchronous API
237 * @param[in] pkg_list_cb iteration function for list
238 * @param[in] user_data user data to be passed to callback function
239 * @param[in] uid the addressee user id of the instruction
240 * @return 0 if success, error code(<0) if fail
241 * @retval PMINFO_R_OK success
242 * @retval PMINFO_R_EINVAL invalid argument
243 * @retval PMINFO_R_ERROR internal error
247 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
248 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
251 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
252 * @brief This API creates the package information handle from db which is not disabled
254 * @par This API is for package-manager client application
255 * @par Sync (or) Async : Synchronous API
257 * @param[in] pkgid pointer to package ID
258 * @param[in] uid the addressee user id of the instruction
259 * @param[out] handle pointer to the package info handle.
260 * @return 0 if success, error code(<0) if fail
261 * @retval PMINFO_R_OK success
262 * @retval PMINFO_R_EINVAL invalid argument
263 * @retval PMINFO_R_ERROR internal error
265 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
266 * @see pkgmgrinfo_pkginfo_get_pkgid()
267 * @see pkgmgrinfo_pkginfo_is_removable()
269 static int get_pkg_type(const char *pkgid)
273 pkgmgrinfo_pkginfo_h handle;
274 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
275 if (ret != PMINFO_R_OK)
277 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
278 if (ret != PMINFO_R_OK) {
279 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
282 printf("pkgtype: %s\n", type);
283 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
288 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
289 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
292 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
293 * @brief This API creates the disabled package information handle from db
295 * @par This API is for package-manager client application
296 * @par Sync (or) Async : Synchronous API
298 * @param[in] pkgid pointer to package ID
299 * @param[in] uid the addressee user id of the instruction
300 * @param[out] handle pointer to the package info handle.
301 * @return 0 if success, error code(<0) if fail
302 * @retval PMINFO_R_OK success
303 * @retval PMINFO_R_EINVAL invalid argument
304 * @retval PMINFO_R_ERROR internal error
306 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
307 * @see pkgmgrinfo_pkginfo_get_pkginfo()
309 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
310 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
313 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
314 * @brief This API creates the package information handle from db regardless of its disable or storage status
316 * @par This API is for package-manager client application
317 * @par Sync (or) Async : Synchronous API
319 * @param[in] pkgid pointer to package ID
320 * @param[in] uid the addressee user id of the instruction
321 * @param[out] handle pointer to the package info handle.
322 * @return 0 if success, error code(<0) if fail
323 * @retval PMINFO_R_OK success
324 * @retval PMINFO_R_EINVAL invalid argument
325 * @retval PMINFO_R_ERROR internal error
327 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
328 * @see pkgmgrinfo_pkginfo_get_pkgid()
329 * @see pkgmgrinfo_pkginfo_is_removable()
331 static int get_pkg_type(const char *pkgid)
335 pkgmgrinfo_pkginfo_h handle;
336 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
337 if (ret != PMINFO_R_OK)
339 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
340 if (ret != PMINFO_R_OK) {
341 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
344 printf("pkgtype: %s\n", type);
345 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
350 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
351 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
354 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
355 * @brief This API gets the package name from the package ID
357 * @par This API is for package-manager client application
358 * @par Sync (or) Async : Synchronous API
360 * @param[in] handle pointer to package info handle
361 * @param[out] pkg_name pointer to hold package name
362 * @return 0 if success, error code(<0) if fail
363 * @retval PMINFO_R_OK success
364 * @retval PMINFO_R_EINVAL invalid argument
365 * @retval PMINFO_R_ERROR internal error
366 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
367 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
368 * @see pkgmgrinfo_pkginfo_get_type()
369 * @see pkgmgrinfo_pkginfo_is_removable()
371 static int get_pkg_name(const char *pkgid)
374 char *pkgname = NULL;
375 pkgmgrinfo_pkginfo_h handle;
376 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
377 if (ret != PMINFO_R_OK)
379 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
380 if (ret != PMINFO_R_OK) {
381 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
384 printf("pkgname: %s\n", pkgname);
385 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
390 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
393 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
394 * @brief This API gets the package id from the package ID
396 * @par This API is for package-manager client application
397 * @par Sync (or) Async : Synchronous API
399 * @param[in] handle pointer to package info handle
400 * @param[out] pkgid pointer to hold package id
401 * @return 0 if success, error code(<0) if fail
402 * @retval PMINFO_R_OK success
403 * @retval PMINFO_R_EINVAL invalid argument
404 * @retval PMINFO_R_ERROR internal error
405 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
406 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
407 * @see pkgmgrinfo_pkginfo_get_type()
408 * @see pkgmgrinfo_pkginfo_is_removable()
410 static int get_pkgid(const char *pkgid)
414 pkgmgrinfo_pkginfo_h handle;
415 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
416 if (ret != PMINFO_R_OK)
418 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
419 if (ret != PMINFO_R_OK) {
420 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
423 printf("pkg id: %s\n", pkg_id);
424 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
429 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
432 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
433 * @brief This API gets the package type from the package ID
435 * @par This API is for package-manager client application
436 * @par Sync (or) Async : Synchronous API
438 * @param[in] handle pointer to package info handle
439 * @param[out] type pointer to hold package type
440 * @return 0 if success, error code(<0) if fail
441 * @retval PMINFO_R_OK success
442 * @retval PMINFO_R_EINVAL invalid argument
443 * @retval PMINFO_R_ERROR internal error
444 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
445 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
446 * @see pkgmgrinfo_pkginfo_get_pkgid()
447 * @see pkgmgrinfo_pkginfo_is_removable()
449 static int get_pkg_type(const char *pkgid)
453 pkgmgrinfo_pkginfo_h handle;
454 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
455 if (ret != PMINFO_R_OK)
457 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
458 if (ret != PMINFO_R_OK) {
459 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
462 printf("pkgtype: %s\n", type);
463 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
468 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
471 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
472 * @brief This API gets the package version from the package ID
474 * @par This API is for package-manager client application
475 * @par Sync (or) Async : Synchronous API
477 * @param[in] handle pointer to package info handle
478 * @param[out] version pointer to hold package version
479 * @return 0 if success, error code(<0) if fail
480 * @retval PMINFO_R_OK success
481 * @retval PMINFO_R_EINVAL invalid argument
482 * @retval PMINFO_R_ERROR internal error
483 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
484 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
485 * @see pkgmgrinfo_pkginfo_get_pkgid()
486 * @see pkgmgrinfo_pkginfo_is_removable()
488 static int get_pkg_version(const char *pkgid)
491 char *version = NULL;
492 pkgmgrinfo_pkginfo_h handle;
493 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
494 if (ret != PMINFO_R_OK)
496 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
497 if (ret != PMINFO_R_OK) {
498 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
501 printf("pkg version: %s\n", version);
502 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
507 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
510 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
511 * @brief This API gets the package api_version from the package ID
513 * @par This API is for package-manager client application
514 * @par Sync (or) Async : Synchronous API
516 * @param[in] handle pointer to package info handle
517 * @param[out] api_version pointer to hold package api_version
518 * @return 0 if success, error code(<0) if fail
519 * @retval PMINFO_R_OK success
520 * @retval PMINFO_R_EINVAL invalid argument
521 * @retval PMINFO_R_ERROR internal error
522 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
523 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
524 * @see pkgmgrinfo_pkginfo_get_pkgid()
525 * @see pkgmgrinfo_pkginfo_is_removable()
527 static int get_pkg_api_version(const char *pkgid)
530 char *api_version = NULL;
531 pkgmgrinfo_pkginfo_h handle = NULL;
532 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
533 if (ret != PMINFO_R_OK)
535 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
536 if (ret != PMINFO_R_OK) {
537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
540 printf("pkg api_version: %s\n", api_version);
541 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
546 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
549 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
550 * @brief This API gets tep(tizen expansion package) file name associated with the package
552 * @par This API is for package-manager client application
553 * @par Sync (or) Async : Synchronous API
555 * @param[in] handle pointer to the pkginfo handle.
556 * @param[out] tep_name pointer to hold tep name
557 * @return 0 if success, error code(<0) if fail
558 * @retval PMINFO_R_OK success
559 * @retval PMINFO_R_EINVAL invalid argument
560 * @retval PMINFO_R_ERROR internal error
561 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
562 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
563 * @see pkgmgrinfo_pkginfo_get_pkgid()
565 static int get_tep_name(const char *pkgid)
568 char *tep_name = NULL;
569 pkgmgrinfo_pkginfo_h handle = NULL;
570 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
571 if (ret != PMINFO_R_OK)
573 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
574 if (ret != PMINFO_R_OK) {
575 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
578 printf("TEP name is: %s\n", tep_name);
579 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
584 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
587 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
588 * @brief This API gets package mount point path associated with the package
589 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
591 * @par This API is for package-manager client application
592 * @par Sync (or) Async : Synchronous API
594 * @param[in] handle pointer to the pkginfo handle.
595 * @param[out] zip_mount_file pointer to hold zip mount file
596 * @return 0 if success, error code(<0) if fail
597 * @retval PMINFO_R_OK success
598 * @retval PMINFO_R_EINVAL invalid argument
599 * @retval PMINFO_R_ERROR internal error
600 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
601 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
602 * @see pkgmgrinfo_pkginfo_get_pkgid()
604 static int get_zip_mount_file(const char *pkgid)
607 char *zip_mount_file = NULL;
608 pkgmgrinfo_pkginfo_h handle = NULL;
609 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
610 if (ret != PMINFO_R_OK)
612 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
613 if (ret != PMINFO_R_OK) {
614 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
617 if (zip_mount_file != NULL)
618 printf("Zip mount path is: %s\n", zip_mount_file);
619 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
624 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
627 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
628 * @brief This API gets package external image path associated with the package
629 * if package is installed in external storage.
630 * Otherwise, the return value will be PMINFO_R_ENOENT.
632 * @par This API is for package-manager client application
633 * @par Sync (or) Async : Synchronous API
635 * @param[in] handle pointer to the pkginfo handle.
636 * @param[out] ext_image_path pointer to hold external image path
637 * @return 0 if success, error code(<0) if fail
638 * @retval PMINFO_R_OK success
639 * @retval PMINFO_R_EINVAL invalid argument
640 * @retval PMINFO_R_ERROR internal error
641 * @revall PMINFO_R_ENOENT no valid data
642 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
643 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
644 * @see pkgmgrinfo_pkginfo_get_pkgid()
646 static int get_external_image_path(const char *pkgid)
649 char *ext_image_path = NULL;
650 pkgmgrinfo_pkginfo_h handle = NULL;
651 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
652 if (ret != PMINFO_R_OK)
654 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
655 if (ret != PMINFO_R_OK) {
656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
659 printf("external image path is: %s\n", ext_image_path);
660 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
665 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
668 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
669 * @brief This API gets the package install location from the package ID
671 * @par This API is for package-manager client application
672 * @par Sync (or) Async : Synchronous API
674 * @param[in] handle pointer to package info handle
675 * @param[out] location pointer to hold package install location
676 * @return 0 if success, error code(<0) if fail
677 * @retval PMINFO_R_OK success
678 * @retval PMINFO_R_EINVAL invalid argument
679 * @retval PMINFO_R_ERROR internal error
680 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
681 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
682 * @see pkgmgrinfo_pkginfo_get_pkgid()
683 * @see pkgmgrinfo_pkginfo_is_removable()
685 static int get_pkg_install_location(const char *pkgid)
688 pkgmgrinfo_install_location location;
689 pkgmgrinfo_pkginfo_h handle;
690 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
691 if (ret != PMINFO_R_OK)
693 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
694 if (ret != PMINFO_R_OK) {
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
698 printf("pkg install location: %d\n", location);
699 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
704 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
707 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
708 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
709 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
710 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
712 * @par This API is for package-manager client application
713 * @par Sync (or) Async : Synchronous API
715 * @param[in] handle pointer to package info handle
716 * @param[out] size pointer to hold package size
717 * @return 0 if success, error code(<0) if fail
718 * @retval PMINFO_R_OK success
719 * @retval PMINFO_R_EINVAL invalid argument
720 * @retval PMINFO_R_ERROR internal error
721 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
722 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
723 * @see pkgmgrinfo_pkginfo_get_pkgid()
724 * @see pkgmgrinfo_pkginfo_is_removable()
726 static int get_pkg_size(const char *pkgid)
730 pkgmgrinfo_pkginfo_h handle;
731 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
732 if (ret != PMINFO_R_OK)
734 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
735 if (ret != PMINFO_R_OK) {
736 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
739 printf("pkgsize: %d\n", size);
740 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
745 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
748 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
749 * @brief This API gets the package icon from the package ID
751 * @par This API is for package-manager client application
752 * @par Sync (or) Async : Synchronous API
754 * @param[in] handle pointer to package info handle
755 * @param[out] icon pointer to hold package icon
756 * @return 0 if success, error code(<0) if fail
757 * @retval PMINFO_R_OK success
758 * @retval PMINFO_R_EINVAL invalid argument
759 * @retval PMINFO_R_ERROR internal error
760 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
761 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
762 * @see pkgmgrinfo_pkginfo_get_pkgid()
763 * @see pkgmgrinfo_pkginfo_is_removable()
765 static int get_pkg_icon(const char *pkgid)
769 pkgmgrinfo_pkginfo_h handle;
770 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
771 if (ret != PMINFO_R_OK)
773 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
774 if (ret != PMINFO_R_OK) {
775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
778 printf("pkg icon: %s\n", icon);
779 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
784 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
787 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
788 * @brief This API gets the package label from the package ID
790 * @par This API is for package-manager client application
791 * @par Sync (or) Async : Synchronous API
793 * @param[in] handle pointer to package info handle
794 * @param[out] label pointer to hold package label
795 * @return 0 if success, error code(<0) if fail
796 * @retval PMINFO_R_OK success
797 * @retval PMINFO_R_EINVAL invalid argument
798 * @retval PMINFO_R_ERROR internal error
799 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
800 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
801 * @see pkgmgrinfo_pkginfo_get_pkgid()
802 * @see pkgmgrinfo_pkginfo_is_removable()
804 static int get_pkg_label(const char *pkgid)
808 pkgmgrinfo_pkginfo_h handle;
809 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
810 if (ret != PMINFO_R_OK)
812 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
813 if (ret != PMINFO_R_OK) {
814 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
817 printf("pkg label: %s\n", label);
818 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
823 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
826 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
827 * @brief This API gets the package description from the package ID
829 * @par This API is for package-manager client application
830 * @par Sync (or) Async : Synchronous API
832 * @param[in] handle pointer to package info handle
833 * @param[out] description pointer to hold package description
834 * @return 0 if success, error code(<0) if fail
835 * @retval PMINFO_R_OK success
836 * @retval PMINFO_R_EINVAL invalid argument
837 * @retval PMINFO_R_ERROR internal error
838 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
839 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
840 * @see pkgmgrinfo_pkginfo_get_pkgid()
841 * @see pkgmgrinfo_pkginfo_is_removable()
843 static int get_pkg_description(const char *pkgid)
846 char *description = NULL;
847 pkgmgrinfo_pkginfo_h handle;
848 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
849 if (ret != PMINFO_R_OK)
851 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
852 if (ret != PMINFO_R_OK) {
853 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
856 printf("pkg description: %s\n", description);
857 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
862 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
865 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
866 * @brief This API gets the package's author name from the package ID
868 * @par This API is for package-manager client application
869 * @par Sync (or) Async : Synchronous API
871 * @param[in] handle pointer to package info handle
872 * @param[out] author_name pointer to hold package author name
873 * @return 0 if success, error code(<0) if fail
874 * @retval PMINFO_R_OK success
875 * @retval PMINFO_R_EINVAL invalid argument
876 * @retval PMINFO_R_ERROR internal error
877 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
878 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
879 * @see pkgmgrinfo_pkginfo_get_pkgid()
880 * @see pkgmgrinfo_pkginfo_is_removable()
882 static int get_pkg_author_name(const char *pkgid)
885 char *author_name = NULL;
886 pkgmgrinfo_pkginfo_h handle;
887 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
888 if (ret != PMINFO_R_OK)
890 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
891 if (ret != PMINFO_R_OK) {
892 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
895 printf("pkg author name: %s\n", author_name);
896 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
901 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
904 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
905 * @brief This API gets the package's author email from the package ID
907 * @par This API is for package-manager client application
908 * @par Sync (or) Async : Synchronous API
910 * @param[in] handle pointer to package info handle
911 * @param[out] author_email pointer to hold package author email
912 * @return 0 if success, error code(<0) if fail
913 * @retval PMINFO_R_OK success
914 * @retval PMINFO_R_EINVAL invalid argument
915 * @retval PMINFO_R_ERROR internal error
916 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
917 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
918 * @see pkgmgrinfo_pkginfo_get_pkgid()
919 * @see pkgmgrinfo_pkginfo_is_removable()
921 static int get_pkg_author_email(const char *pkgid)
924 char *author_email = NULL;
925 pkgmgrinfo_pkginfo_h handle;
926 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
927 if (ret != PMINFO_R_OK)
929 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
930 if (ret != PMINFO_R_OK) {
931 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
934 printf("pkg author email: %s\n", author_email);
935 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
940 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
943 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
944 * @brief This API gets the package's author href from the package ID
946 * @par This API is for package-manager client application
947 * @par Sync (or) Async : Synchronous API
949 * @param[in] handle pointer to package info handle
950 * @param[out] author_href pointer to hold package author href
951 * @return 0 if success, error code(<0) if fail
952 * @retval PMINFO_R_OK success
953 * @retval PMINFO_R_EINVAL invalid argument
954 * @retval PMINFO_R_ERROR internal error
955 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
956 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
957 * @see pkgmgrinfo_pkginfo_get_pkgid()
958 * @see pkgmgrinfo_pkginfo_is_removable()
960 static int get_pkg_author_href(const char *pkgid)
963 char *author_href = NULL;
964 pkgmgrinfo_pkginfo_h handle;
965 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
966 if (ret != PMINFO_R_OK)
968 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
969 if (ret != PMINFO_R_OK) {
970 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
973 printf("pkg author href: %s\n", author_href);
974 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
979 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
982 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
983 * @brief This API gets the package installed storagae value from the package ID
985 * @par This API is for package-manager client application
986 * @par Sync (or) Async : Synchronous API
988 * @param[in] handle pointer to package info handle
989 * @param[out] storage pointer to hold package installed storage
990 * @return 0 if success, error code(<0) if fail
991 * @retval PMINFO_R_OK success
992 * @retval PMINFO_R_EINVAL invalid argument
993 * @retval PMINFO_R_ERROR internal error
994 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
995 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
996 * @see pkgmgrinfo_pkginfo_get_pkgid()
997 * @see pkgmgrinfo_pkginfo_is_removable()
999 static int get_pkg_installed_storage(const char *pkgid)
1002 pkgmgrinfo_installed_storage storage;
1003 pkgmgrinfo_pkginfo_h handle;
1004 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1005 if (ret != PMINFO_R_OK)
1007 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1008 if (ret != PMINFO_R_OK) {
1009 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1012 printf("pkg installed storage: %d\n", storage);
1013 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1018 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1021 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1022 * @brief This API gets the installed time of package from the package ID
1024 * @par This API is for package-manager client application
1025 * @par Sync (or) Async : Synchronous API
1027 * @param[in] handle pointer to package info handle
1028 * @param[out] installed_time pointer to hold installed time of package
1029 * @return 0 if success, error code(<0) if fail
1030 * @retval PMINFO_R_OK success
1031 * @retval PMINFO_R_EINVAL invalid argument
1032 * @retval PMINFO_R_ERROR internal error
1033 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1034 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1035 * @see pkgmgrinfo_pkginfo_get_pkgid()
1036 * @see pkgmgrinfo_pkginfo_is_removable()
1038 static int get_pkg_installed_time(const char *pkgid)
1041 int installed_time = 0;
1042 pkgmgrinfo_pkginfo_h handle;
1043 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1044 if (ret != PMINFO_R_OK)
1046 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1047 if (ret != PMINFO_R_OK) {
1048 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1051 printf("installed_time: %d\n", installed_time);
1052 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1057 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1060 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1061 * @brief This API creates the update info handle
1063 * @par This API is for package-manager client application
1064 * @par Sync (or) Async : Synchronous API
1066 * @param[out] handle pointer to package update info handle
1067 * @return 0 if success, error code(<0) if fail
1068 * @retval PMINFO_R_OK success
1069 * @retval PMINFO_R_EINVAL invalid argument
1070 * @retval PMINFO_R_ERROR internal error
1071 * @post pkgmgrinfo_updateinfo_destroy()
1072 * @see pkgmgrinfo_updateinfo_set_pkgid()
1073 * @see pkgmgrinfo_updateinfo_set_version()
1074 * @see pkgmgrinfo_updateinfo_set_type()
1075 * @see pkgmgr_client_register_pkg_updateinfo()
1077 static int updateinfo_handle_create()
1081 pkgmgrinfo_updateinfo_h handle;
1082 ret = pkgmgrinfo_updateinfo_create(&handle);
1083 if (ret != PMINFO_R_OK)
1085 pkgmgrinfo_update_infodestroy(handle);
1090 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1093 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1094 * @brief This API destroy the update info handle
1096 * @par This API is for package-manager client application
1097 * @par Sync (or) Async : Synchronous API
1099 * @param[in] handle pointer to package update info handle
1100 * @return 0 if success, error code(<0) if fail
1101 * @retval PMINFO_R_OK success
1102 * @retval PMINFO_R_EINVAL invalid argument
1103 * @pre pkgmgrinfo_updateinfo_create()
1104 * @see pkgmgr_client_register_pkg_updateinfo()
1106 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1110 ret = pkgmgrinfo_updateinfo_destroy(handle);
1111 if (ret != PMINFO_R_OK)
1117 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1120 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1121 * @brief This API creates the package update information handle from db
1123 * @par This API is for package-manager client application
1124 * @par Sync (or) Async : Synchronous API
1126 * @param[in] pkgid pointer to package ID
1127 * @param[in] uid the addressee user id of the instruction
1128 * @param[out] update_handle pointer to the package update info handle.
1129 * @return 0 if success, error code(<0) if fail
1130 * @retval PMINFO_R_OK success
1131 * @retval PMINFO_R_EINVAL invalid argument
1132 * @retval PMINFO_R_ERROR internal error
1134 * @post pkgmgrinfo_updateinfo_destroy()
1135 * @see pkgmgrinfo_updateinfo_get_pkgid()
1136 * @see pkgmgrinfo_updateinfo_get_version()
1137 * @see pkgmgrinfo_updateinfo_get_update_type()
1139 static int get_pkg_update_info(const char *pkgid)
1143 pkgmgrinfo_updateinfo_h handle;
1144 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1145 if (ret != PMINFO_R_OK)
1147 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1148 if (ret != PMINFO_R_OK) {
1149 pkgmgrinfo_updateinfo_destroy(handle);
1152 printf("pkg update version: %s\n", version
1153 pkgmgrinfo_updateinfo_destroy(handle);
1158 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1159 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1162 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1163 * @brief This API sets given pkgid into handle
1165 * @par This API is for package-manager client application
1166 * @par Sync (or) Async : Synchronous API
1168 * @param[in] handle pointer to package update info handle
1169 * @param[in] pkgid package id
1170 * @return 0 if success, error code(<0) if fail
1171 * @retval PMINFO_R_OK success
1172 * @retval PMINFO_R_EINVAL invalid argument
1173 * @retval PMINFO_R_ERROR internal error
1175 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1179 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1180 if (ret != PMINFO_R_OK)
1186 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1189 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1190 * @brief This API sets given version into handle
1192 * @par This API is for package-manager client application
1193 * @par Sync (or) Async : Synchronous API
1195 * @param[in] handle pointer to package update info handle
1196 * @param[in] version update version
1197 * @return 0 if success, error code(<0) if fail
1198 * @retval PMINFO_R_OK success
1199 * @retval PMINFO_R_EINVAL invalid argument
1200 * @retval PMINFO_R_ERROR internal error
1202 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1206 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1207 if (ret != PMINFO_R_OK)
1213 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1216 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1217 * @brief This API sets given update type into handle
1219 * @par This API is for package-manager client application
1220 * @par Sync (or) Async : Synchronous API
1222 * @param[in] handle pointer to package update info handle
1223 * @param[in] type update type
1224 * @return 0 if success, error code(<0) if fail
1225 * @retval PMINFO_R_OK success
1226 * @retval PMINFO_R_EINVAL invalid argument
1227 * @retval PMINFO_R_ERROR internal error
1229 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1233 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1234 if (ret != PMINFO_R_OK)
1240 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1243 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1244 * @brief This API retrieves the pkgid from given update info
1246 * @par This API is for package-manager client application
1247 * @par Sync (or) Async : Synchronous API
1249 * @param[in] handle pointer to package update info handle
1250 * @param[out] pkgid package id
1251 * @return 0 if success, error code(<0) if fail
1252 * @retval PMINFO_R_OK success
1253 * @retval PMINFO_R_EINVAL invalid argument
1254 * @retval PMINFO_R_ERROR internal error
1256 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1261 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1262 if (ret != PMINFO_R_OK)
1268 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1271 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1272 * @brief This API retrieves the version from given update info
1274 * @par This API is for package-manager client application
1275 * @par Sync (or) Async : Synchronous API
1277 * @param[in] handle pointer to package update info handle
1278 * @param[out] version update version
1279 * @return 0 if success, error code(<0) if fail
1280 * @retval PMINFO_R_OK success
1281 * @retval PMINFO_R_EINVAL invalid argument
1282 * @retval PMINFO_R_ERROR internal error
1284 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1289 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1290 if (ret != PMINFO_R_OK)
1296 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1299 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1300 * @brief This API retrieves the update type from given update info
1302 * @par This API is for package-manager client application
1303 * @par Sync (or) Async : Synchronous API
1305 * @param[in] handle pointer to package update info handle
1306 * @param[out] type update type
1307 * @return 0 if success, error code(<0) if fail
1308 * @retval PMINFO_R_OK success
1309 * @retval PMINFO_R_EINVAL invalid argument
1310 * @retval PMINFO_R_ERROR internal error
1312 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1315 pkgmgrinfo_updateinfo_update_type *type;
1317 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1318 if (ret != PMINFO_R_OK)
1324 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1328 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1329 * @brief This API retrieve the update informations and invoke given callback for it.
1331 * @par This API is for package-manager client application
1332 * @par Sync (or) Async : Synchronous API
1334 * @param[in] callback callback to be invoked for each retrieved informations
1335 * @param[in] user_data user data to be passed to callback
1336 * @return 0 if success, error code(<0) if fail
1337 * @retval PMINFO_R_OK success
1338 * @retval PMINFO_R_EINVAL invalid argument
1339 * @retval PMINFO_R_ERROR internal error
1341 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1345 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1346 if (ret != PMINFO_R_OK)
1352 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1353 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1356 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1357 * @brief This API gets the launch mode of package from the package ID
1359 * @par This API is for package-manager client application
1360 * @par Sync (or) Async : Synchronous API
1362 * @param[in] handle pointer to package info handle
1363 * @param[out] mode pointer to hold launch mode of package
1364 * @return 0 if success, error code(<0) if fail
1365 * @retval PMINFO_R_OK success
1366 * @retval PMINFO_R_EINVAL invalid argument
1367 * @retval PMINFO_R_ERROR internal error
1368 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1369 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1370 * @see pkgmgrinfo_pkginfo_get_pkgid()
1371 * @see pkgmgrinfo_pkginfo_is_removable()
1373 static int get_pkg_launch_mode(const char *pkgid)
1376 char *launch_mode = NULL;
1377 pkgmgrinfo_pkginfo_h handle;
1378 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1379 if (ret != PMINFO_R_OK)
1381 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1382 if (ret != PMINFO_R_OK) {
1383 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1386 printf("launch mode: %s\n", mode);
1387 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1392 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1395 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1396 * @brief This API gets the store client id of package from the package ID
1398 * @par This API is for package-manager client application
1399 * @par Sync (or) Async : Synchronous API
1401 * @param[in] handle pointer to package info handle
1402 * @param[out] storeclientid pointer to hold store client id of package
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
1407 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1408 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1409 * @see pkgmgrinfo_pkginfo_get_pkgid()
1410 * @see pkgmgrinfo_pkginfo_is_removable()
1412 static int get_pkg_storeclientid(const char *pkgid)
1415 char *storeclientid = 0;
1416 pkgmgrinfo_pkginfo_h handle;
1417 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1418 if (ret != PMINFO_R_OK)
1420 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1421 if (ret != PMINFO_R_OK) {
1422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1425 printf(store client id: %s\n", storeclientid);
1426 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1431 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1434 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1435 * @brief This API gets the main app id of package from the package ID
1437 * @par This API is for package-manager client application
1438 * @par Sync (or) Async : Synchronous API
1440 * @param[in] handle pointer to package info handle
1441 * @param[out] mainappid pointer to hold main app id of package
1442 * @return 0 if success, error code(<0) if fail
1443 * @retval PMINFO_R_OK success
1444 * @retval PMINFO_R_EINVAL invalid argument
1445 * @retval PMINFO_R_ERROR internal error
1446 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1447 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1448 * @see pkgmgrinfo_pkginfo_get_pkgid()
1449 * @see pkgmgrinfo_pkginfo_is_removable()
1451 static int get_pkg_mainappid(const char *pkgid)
1454 char *mainappid = 0;
1455 pkgmgrinfo_pkginfo_h handle;
1456 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1457 if (ret != PMINFO_R_OK)
1459 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1460 if (ret != PMINFO_R_OK) {
1461 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1464 printf(main app id: %s\n", mainappid);
1465 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1470 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1473 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1474 * @brief This API gets the url of package from the package ID
1476 * @par This API is for package-manager client application
1477 * @par Sync (or) Async : Synchronous API
1479 * @param[in] handle pointer to package info handle
1480 * @param[out] url pointer to hold url of package
1481 * @return 0 if success, error code(<0) if fail
1482 * @retval PMINFO_R_OK success
1483 * @retval PMINFO_R_EINVAL invalid argument
1484 * @retval PMINFO_R_ERROR internal error
1485 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1486 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1487 * @see pkgmgrinfo_pkginfo_get_pkgid()
1488 * @see pkgmgrinfo_pkginfo_is_removable()
1490 static int get_pkg_url(const char *pkgid)
1494 pkgmgrinfo_pkginfo_h handle;
1495 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1496 if (ret != PMINFO_R_OK)
1498 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1499 if (ret != PMINFO_R_OK) {
1500 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1503 printf("url : %s\n", url);
1504 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1509 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1512 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1513 * @brief This API gets the root path of package
1515 * @par Sync (or) Async : Synchronous API
1517 * @param[in] handle pointer to package info handle
1518 * @param[out] path pointer to hold root path of package
1519 * @return 0 if success, error code(<0) if fail
1520 * @retval PMINFO_R_OK success
1521 * @retval PMINFO_R_EINVAL invalid argument
1522 * @retval PMINFO_R_ERROR internal error
1524 static int get_root_path(const char *pkgid)
1528 pkgmgrinfo_pkginfo_h handle;
1529 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1530 if (ret != PMINFO_R_OK)
1533 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1534 if (ret != PMINFO_R_OK) {
1535 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1538 printf("path : %s\n", path);
1539 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1545 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1549 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1550 * @brief This API gets the csc path of package
1552 * @par Sync (or) Async : Synchronous API
1554 * @param[in] handle pointer to package info handle
1555 * @param[out] path pointer to hold csc path of package
1556 * @return 0 if success, error code(<0) if fail
1557 * @retval PMINFO_R_OK success
1558 * @retval PMINFO_R_EINVAL invalid argument
1559 * @retval PMINFO_R_ERROR internal error
1561 static int get_csc_path(const char *pkgid)
1565 pkgmgrinfo_pkginfo_h handle;
1566 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1567 if (ret != PMINFO_R_OK)
1570 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1571 if (ret != PMINFO_R_OK) {
1572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1575 printf("path : %s\n", path);
1576 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1582 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1585 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1586 * @brief This API gets the support_mode of package
1588 * @par Sync (or) Async : Synchronous API
1590 * @param[in] handle pointer to package info handle
1591 * @param[out] support_mode pointer to hold support_mode of package
1592 * @return 0 if success, error code(<0) if fail
1593 * @retval PMINFO_R_OK success
1594 * @retval PMINFO_R_EINVAL invalid argument
1595 * @retval PMINFO_R_ERROR internal error
1597 static int get_support_mode(const char *pkgid)
1600 int support_mode = 0;
1601 pkgmgrinfo_pkginfo_h handle = NULL;
1602 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1603 if (ret != PMINFO_R_OK)
1606 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1607 if (ret != PMINFO_R_OK) {
1608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611 printf("support_mode : %s\n", support_mode);
1612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1618 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1621 * @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)
1622 * @brief This API compare the cert information from given package id
1624 * @par This API is for package-manager client application
1625 * @par Sync (or) Async : Synchronous API
1627 * @param[in] lhs_package_id pointer to first package ID
1628 * @param[in] rhs_package_id pointer to second package ID
1629 * @param[out] compare_result pointer to the compare result.
1630 * @return 0 if success, error code(<0) if fail
1631 * @retval PMINFO_R_OK success
1632 * @retval PMINFO_R_EINVAL invalid argument
1633 * @retval PMINFO_R_ERROR internal error
1635 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1636 * @see pkgmgrinfo_pkginfo_get_pkgid()
1637 * @see pkgmgrinfo_pkginfo_is_removable()
1639 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1642 pkgmgrinfo_cert_compare_result_type_e result;
1644 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1645 if (ret != PMINFO_R_OK) {
1648 printf("result: %d\n", result);
1653 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);
1654 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);
1656 * @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)
1657 * @brief This API compare the cert information from given app id
1659 * @par This API is for package-manager client application
1660 * @par Sync (or) Async : Synchronous API
1662 * @param[in] lhs_app_id pointer to first app ID
1663 * @param[in] rhs_app_id pointer to second app ID
1664 * @param[out] compare_result pointer to the compare result.
1665 * @return 0 if success, error code(<0) if fail
1666 * @retval PMINFO_R_OK success
1667 * @retval PMINFO_R_EINVAL invalid argument
1668 * @retval PMINFO_R_ERROR internal error
1670 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1671 * @see pkgmgrinfo_pkginfo_get_pkgid()
1672 * @see pkgmgrinfo_pkginfo_is_removable()
1674 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1677 pkgmgrinfo_cert_compare_result_type_e result;
1679 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1680 if (ret != PMINFO_R_OK) {
1683 printf("result: %d\n", result);
1688 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);
1689 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);
1691 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1692 * @brief This API gets the package 'removable' value from the package ID
1694 * @par This API is for package-manager client application
1695 * @par Sync (or) Async : Synchronous API
1697 * @param[in] handle pointer to package info handle
1698 * @param[out] removable pointer to hold package removable value
1699 * @return 0 if success, error code(<0) if fail
1700 * @retval PMINFO_R_OK success
1701 * @retval PMINFO_R_EINVAL invalid argument
1702 * @retval PMINFO_R_ERROR internal error
1703 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1704 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1705 * @see pkgmgrinfo_pkginfo_get_pkgid()
1706 * @see pkgmgrinfo_pkginfo_is_readonly()
1708 static int get_pkg_removable(const char *pkgid)
1712 pkgmgrinfo_pkginfo_h handle;
1713 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1714 if (ret != PMINFO_R_OK)
1716 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1717 if (ret != PMINFO_R_OK) {
1718 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1721 printf("pkg removable: %d\n", removable);
1722 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1727 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1730 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1731 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1733 * @par This API is for package-manager client application
1734 * @par Sync (or) Async : Synchronous API
1736 * @param[in] handle pointer to package info handle
1737 * @param[out] movable pointer to hold package movable state
1738 * @return 0 if success, error code(<0) if fail
1739 * @retval PMINFO_R_OK success
1740 * @retval PMINFO_R_EINVAL invalid argument
1741 * @retval PMINFO_R_ERROR internal error
1742 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1743 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1744 * @see pkgmgrinfo_pkginfo_get_pkgid()
1746 static int get_pkg_movable(const char *pkgid)
1750 pkgmgrinfo_pkginfo_h handle;
1751 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1752 if (ret != PMINFO_R_OK)
1754 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1755 if (ret != PMINFO_R_OK) {
1756 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1759 printf("pkg movable: %d\n", movable);
1760 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1765 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1768 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1769 * @brief This API gets the package 'preload' value from the package ID
1771 * @par This API is for package-manager client application
1772 * @par Sync (or) Async : Synchronous API
1774 * @param[in] handle pointer to package info handle
1775 * @param[out] preload pointer to hold package preload value
1776 * @return 0 if success, error code(<0) if fail
1777 * @retval PMINFO_R_OK success
1778 * @retval PMINFO_R_EINVAL invalid argument
1779 * @retval PMINFO_R_ERROR internal error
1780 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1781 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1782 * @see pkgmgrinfo_pkginfo_get_pkgid()
1783 * @see pkgmgrinfo_pkginfo_is_readonly()
1785 static int get_pkg_preload(const char *pkgid)
1789 pkgmgrinfo_pkginfo_h handle;
1790 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1791 if (ret != PMINFO_R_OK)
1793 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1794 if (ret != PMINFO_R_OK) {
1795 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1798 printf("pkg preload: %d\n", preload);
1799 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1804 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1807 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1808 * @brief This API gets the value for given handle is system or not
1810 * @par This API is for package-manager client application
1811 * @par Sync (or) Async : Synchronous API
1813 * @param[in] handle pointer to package info handle
1814 * @param[out] system pointer to hold system is or not
1815 * @return 0 if success, error code(<0) if fail
1816 * @retval PMINFO_R_OK success
1817 * @retval PMINFO_R_EINVAL invalid argument
1818 * @retval PMINFO_R_ERROR internal error
1819 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1820 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1821 * @see pkgmgrinfo_pkginfo_get_pkgid()
1822 * @see pkgmgrinfo_pkginfo_is_readonly()
1824 static int get_pkg_system(const char *pkgid)
1827 bool system = false;
1828 pkgmgrinfo_pkginfo_h handle = NULL;
1829 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1830 if (ret != PMINFO_R_OK)
1832 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1833 if (ret != PMINFO_R_OK) {
1834 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1837 printf("pkg system: %d\n", system);
1838 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1843 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1846 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1847 * @brief This API gets the package 'readonly' value from the package ID
1849 * @par This API is for package-manager client application
1850 * @par Sync (or) Async : Synchronous API
1852 * @param[in] handle pointer to package info handle
1853 * @param[out] readonly pointer to hold package readonly value
1854 * @return 0 if success, error code(<0) if fail
1855 * @retval PMINFO_R_OK success
1856 * @retval PMINFO_R_EINVAL invalid argument
1857 * @retval PMINFO_R_ERROR internal error
1858 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1859 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1860 * @see pkgmgrinfo_pkginfo_get_pkgid()
1861 * @see pkgmgrinfo_pkginfo_is_removable()
1863 static int get_pkg_readonly(const char *pkgid)
1867 pkgmgrinfo_pkginfo_h handle;
1868 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1869 if (ret != PMINFO_R_OK)
1871 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1872 if (ret != PMINFO_R_OK) {
1873 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1876 printf("pkg readonly: %d\n", readonly);
1877 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1882 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1886 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1887 * @brief This API gets the package 'upate' value from the package ID
1889 * @par This API is for package-manager client application
1890 * @par Sync (or) Async : Synchronous API
1892 * @param[in] handle pointer to package info handle
1893 * @param[out] update pointer to hold package update value
1894 * @return 0 if success, error code(<0) if fail
1895 * @retval PMINFO_R_OK success
1896 * @retval PMINFO_R_EINVAL invalid argument
1897 * @retval PMINFO_R_ERROR internal error
1898 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1899 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1900 * @see pkgmgrinfo_pkginfo_get_pkgid()
1902 static int get_pkg_update(const char *pkgid)
1906 pkgmgrinfo_pkginfo_h handle;
1907 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1908 if (ret != PMINFO_R_OK)
1910 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1911 if (ret != PMINFO_R_OK) {
1912 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1915 printf("pkg update: %d\n", update);
1916 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1921 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1924 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1925 * @brief This API gets the package 'support_disable' value from the package ID
1927 * @par This API is for package-manager client application
1928 * @par Sync (or) Async : Synchronous API
1930 * @param[in] handle pointer to package info handle
1931 * @param[out] support_disable pointer to hold package support_disable value
1932 * @return 0 if success, error code(<0) if fail
1933 * @retval PMINFO_R_OK success
1934 * @retval PMINFO_R_EINVAL invalid argument
1935 * @retval PMINFO_R_ERROR internal error
1936 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1937 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1938 * @see pkgmgrinfo_pkginfo_get_pkgid()
1940 static int get_pkg_support_disable(const char *pkgid)
1943 bool support_disable;
1944 pkgmgrinfo_pkginfo_h handle = NULL;
1945 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1946 if (ret != PMINFO_R_OK)
1948 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1949 if (ret != PMINFO_R_OK) {
1950 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1953 printf("pkg support_disable: %d\n", support_disable);
1954 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1959 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1962 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1963 * @brief This API gets whethere the given package is global package or user package
1965 * @par This API is for package-manager client application
1966 * @par Sync (or) Async : Synchronous API
1968 * @param[in] handle pointer to package info handle
1969 * @param[in] global pointer to hold package global value
1970 * @return 0 if success, error code(<0) if fail
1971 * @retval PMINFO_R_OK success
1972 * @retval PMINFO_R_EINVAL invalid argument
1973 * @retval PMINFO_R_ERROR internal error
1974 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1975 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1976 * @see pkgmgrinfo_pkginfo_get_pkgid()
1977 static int get_pkg_support_disable(const char *pkgid)
1981 pkgmgrinfo_pkginfo_h handle = NULL;
1982 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1983 if (ret != PMINFO_R_OK)
1985 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1986 if (ret != PMINFO_R_OK) {
1987 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1990 printf("pkg is_global: %d\n", global);
1991 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1996 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1999 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2000 * @brief This API gets the package 'accessible' value from the package ID
2002 * @par This API is for package-manager client application
2003 * @par Sync (or) Async : Synchronous API
2005 * @param[in] handle pointer to package info handle
2006 * @param[out] accessible pointer to hold package accessible value
2007 * @return 0 if success, error code(<0) if fail
2008 * @retval PMINFO_R_OK success
2009 * @retval PMINFO_R_EINVAL invalid argument
2010 * @retval PMINFO_R_ERROR internal error
2011 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2012 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2013 * @see pkgmgrinfo_pkginfo_get_pkgid()
2014 * @see pkgmgrinfo_pkginfo_is_readonly()
2016 static int get_pkg_accessible(const char *pkgid)
2020 pkgmgrinfo_pkginfo_h handle;
2021 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2022 if (ret != PMINFO_R_OK)
2024 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2025 if (ret != PMINFO_R_OK) {
2026 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2029 printf("pkg accessible: %d\n", accessible);
2030 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2035 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2038 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2039 * @brief This API destroys the package information handle freeing up all the resources
2041 * @par This API is for package-manager client application
2042 * @par Sync (or) Async : Synchronous API
2044 * @param[in] handle pointer to the package info handle
2045 * @return 0 if success, error code(<0) if fail
2046 * @retval PMINFO_R_OK success
2047 * @retval PMINFO_R_EINVAL invalid argument
2048 * @retval PMINFO_R_ERROR internal error
2049 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2051 * @see pkgmgrinfo_pkginfo_get_pkgid()
2052 * @see pkgmgrinfo_pkginfo_is_removable()
2054 static int get_pkg_type(const char *pkgid)
2058 pkgmgrinfo_pkginfo_h handle;
2059 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2060 if (ret != PMINFO_R_OK)
2062 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2063 if (ret != PMINFO_R_OK) {
2064 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2067 printf("pkgtype: %s\n", type);
2068 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2073 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2076 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2077 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2078 The query will search the entire package information collected from the manifest file of all the installed packages
2080 * @par This API is for package-manager client application
2081 * @par Sync (or) Async : Synchronous API
2083 * @param[out] handle pointer to the package info filter handle.
2084 * @return 0 if success, error code(<0) if fail
2085 * @retval PMINFO_R_OK success
2086 * @retval PMINFO_R_EINVAL invalid argument
2087 * @retval PMINFO_R_ERROR internal error
2089 * @post pkgmgrinfo_pkginfo_filter_destroy()
2090 * @see pkgmgrinfo_pkginfo_filter_count()
2091 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2093 static int get_tpk_pkg_count()
2097 pkgmgrinfo_pkginfo_filter_h handle;
2098 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2099 if (ret != PMINFO_R_OK)
2101 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2102 if (ret != PMINFO_R_OK) {
2103 pkgmgrinfo_pkginfo_filter_destroy(handle);
2106 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2107 if (ret != PMINFO_R_OK) {
2108 pkgmgrinfo_pkginfo_filter_destroy(handle);
2111 printf("No of tpk pkgs: %d\n", count);
2112 pkgmgrinfo_pkginfo_filter_destroy(handle);
2117 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2120 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2121 * @brief This API destroys the package information filter handle freeing up all the resources
2123 * @par This API is for package-manager client application
2124 * @par Sync (or) Async : Synchronous API
2126 * @param[in] handle pointer to the package info filter handle.
2127 * @return 0 if success, error code(<0) if fail
2128 * @retval PMINFO_R_OK success
2129 * @retval PMINFO_R_EINVAL invalid argument
2130 * @retval PMINFO_R_ERROR internal error
2131 * @pre pkgmgrinfo_pkginfo_filter_create()
2133 * @see pkgmgrinfo_pkginfo_filter_count()
2134 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2136 static int get_tpk_pkg_count()
2140 pkgmgrinfo_pkginfo_filter_h handle;
2141 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2142 if (ret != PMINFO_R_OK)
2144 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2145 if (ret != PMINFO_R_OK) {
2146 pkgmgrinfo_pkginfo_filter_destroy(handle);
2149 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2150 if (ret != PMINFO_R_OK) {
2151 pkgmgrinfo_pkginfo_filter_destroy(handle);
2154 printf("No of tpk pkgs: %d\n", count);
2155 pkgmgrinfo_pkginfo_filter_destroy(handle);
2160 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2163 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2164 * @brief This API adds a boolean filter property to the filter handle
2166 * @par This API is for package-manager client application
2167 * @par Sync (or) Async : Synchronous API
2169 * @param[in] handle pointer to the package info filter handle.
2170 * @param[in] property boolean property name.
2171 * @param[in] value value corresponding to the property.
2172 * @return 0 if success, error code(<0) if fail
2173 * @retval PMINFO_R_OK success
2174 * @retval PMINFO_R_EINVAL invalid argument
2175 * @retval PMINFO_R_ERROR internal error
2176 * @pre pkgmgrinfo_pkginfo_filter_create()
2177 * @post pkgmgrinfo_pkginfo_filter_destroy()
2178 * @see pkgmgrinfo_pkginfo_filter_count()
2179 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2181 static int get_preload_pkg_count()
2185 pkgmgrinfo_pkginfo_filter_h handle;
2186 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2187 if (ret != PMINFO_R_OK)
2189 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2190 if (ret != PMINFO_R_OK) {
2191 pkgmgrinfo_pkginfo_filter_destroy(handle);
2194 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2195 if (ret != PMINFO_R_OK) {
2196 pkgmgrinfo_pkginfo_filter_destroy(handle);
2199 printf("No of preload pkgs: %d\n", count);
2200 pkgmgrinfo_pkginfo_filter_destroy(handle);
2205 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2206 const char *property, const bool value);
2209 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2210 * @brief This API adds an integer filter property to the filter handle
2212 * @par This API is for package-manager client application
2213 * @par Sync (or) Async : Synchronous API
2215 * @param[in] handle pointer to the package info filter handle.
2216 * @param[in] property integer property name.
2217 * @param[in] value value corresponding to the property.
2218 * @return 0 if success, error code(<0) if fail
2219 * @retval PMINFO_R_OK success
2220 * @retval PMINFO_R_EINVAL invalid argument
2221 * @retval PMINFO_R_ERROR internal error
2222 * @pre pkgmgrinfo_pkginfo_filter_create()
2223 * @post pkgmgrinfo_pkginfo_filter_destroy()
2224 * @see pkgmgrinfo_pkginfo_filter_count()
2225 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2227 static int get_pkg_count()
2231 pkgmgrinfo_pkginfo_filter_h handle;
2232 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2233 if (ret != PMINFO_R_OK)
2235 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2236 if (ret != PMINFO_R_OK) {
2237 pkgmgrinfo_pkginfo_filter_destroy(handle);
2240 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2241 if (ret != PMINFO_R_OK) {
2242 pkgmgrinfo_pkginfo_filter_destroy(handle);
2245 printf("No of preload pkgs: %d\n", count);
2246 pkgmgrinfo_pkginfo_filter_destroy(handle);
2251 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2252 const char *property, const int value);
2255 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2256 * @brief This API adds a string filter property to the filter handle
2258 * @par This API is for package-manager client application
2259 * @par Sync (or) Async : Synchronous API
2261 * @param[in] handle pointer to the package info filter handle.
2262 * @param[in] property string property name.
2263 * @param[in] value value corresponding to the property.
2264 * @return 0 if success, error code(<0) if fail
2265 * @retval PMINFO_R_OK success
2266 * @retval PMINFO_R_EINVAL invalid argument
2267 * @retval PMINFO_R_ERROR internal error
2268 * @pre pkgmgrinfo_pkginfo_filter_create()
2269 * @post pkgmgrinfo_pkginfo_filter_destroy()
2270 * @see pkgmgrinfo_pkginfo_filter_count()
2271 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2273 static int get_tpk_pkg_count()
2277 pkgmgrinfo_pkginfo_filter_h handle;
2278 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2279 if (ret != PMINFO_R_OK)
2281 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2282 if (ret != PMINFO_R_OK) {
2283 pkgmgrinfo_pkginfo_filter_destroy(handle);
2286 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2287 if (ret != PMINFO_R_OK) {
2288 pkgmgrinfo_pkginfo_filter_destroy(handle);
2291 printf("No of tpk pkgs: %d\n", count);
2292 pkgmgrinfo_pkginfo_filter_destroy(handle);
2297 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2298 const char *property, const char *value);
2301 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2302 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2304 * @par This API is for package-manager client application
2305 * @par Sync (or) Async : Synchronous API
2307 * @param[in] handle pointer to the package info filter handle.
2308 * @param[in] pkg_cb callback function.
2309 * @param[in] user_data user data to be passed to the callback function
2310 * @return 0 if success, error code(<0) if fail
2311 * @retval PMINFO_R_OK success
2312 * @retval PMINFO_R_EINVAL invalid argument
2313 * @retval PMINFO_R_ERROR internal error
2314 * @pre pkgmgrinfo_pkginfo_filter_create()
2315 * @post pkgmgrinfo_pkginfo_filter_destroy()
2316 * @see pkgmgrinfo_pkginfo_filter_count()
2318 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2321 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2322 printf("pkg id : %s\n", pkgid);
2326 static int get_tpk_pkg_list()
2329 pkgmgrinfo_pkginfo_filter_h handle;
2330 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2331 if (ret != PMINFO_R_OK)
2333 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2334 if (ret != PMINFO_R_OK) {
2335 pkgmgrinfo_pkginfo_filter_destroy(handle);
2338 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2339 if (ret != PMINFO_R_OK) {
2340 pkgmgrinfo_pkginfo_filter_destroy(handle);
2343 pkgmgrinfo_pkginfo_filter_destroy(handle);
2348 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2349 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2350 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2351 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2354 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2355 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2356 * @brief This API counts the package that satisfy the filter conditions
2358 * @par This API is for package-manager client application
2359 * @par Sync (or) Async : Synchronous API
2361 * @param[in] handle pointer to the package info filter handle.
2362 * @param[in] count pointer to store the count value.
2363 * @param[in] uid the addressee user id of the instruction
2364 * @return 0 if success, error code(<0) if fail
2365 * @retval PMINFO_R_OK success
2366 * @retval PMINFO_R_EINVAL invalid argument
2367 * @retval PMINFO_R_ERROR internal error
2368 * @pre pkgmgrinfo_pkginfo_filter_create()
2369 * @post pkgmgrinfo_pkginfo_filter_destroy()
2370 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2372 static int get_tpk_pkg_count()
2376 pkgmgrinfo_pkginfo_filter_h handle;
2377 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2378 if (ret != PMINFO_R_OK)
2380 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2381 if (ret != PMINFO_R_OK) {
2382 pkgmgrinfo_pkginfo_filter_destroy(handle);
2385 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2386 if (ret != PMINFO_R_OK) {
2387 pkgmgrinfo_pkginfo_filter_destroy(handle);
2390 printf("No of tpk pkgs: %d\n", count);
2391 pkgmgrinfo_pkginfo_filter_destroy(handle);
2396 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2397 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2400 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2401 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2402 * @brief This API gets the list of privilege for a particular package
2404 * @par This API is for package-manager client application
2405 * @par Sync (or) Async : Synchronous API
2406 * @param[in] handle pointer to the package info handle.
2407 * @param[in] privilege_func callback function for list
2408 * @param[in] user_data user data to be passed to callback function
2409 * @return 0 if success, error code(<0) if fail
2410 * @retval PMINFO_R_OK success
2411 * @retval PMINFO_R_EINVAL invalid argument
2412 * @retval PMINFO_R_ERROR internal error
2413 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2414 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2416 int privilege_func(const char *name, void *user_data)
2418 if (strcmp(name, (char *)user_data) == 0)
2424 static int list_privilege(const char *package, char *privilege)
2427 pkgmgrinfo_pkginfo_h handle;
2428 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2429 if (ret != PMINFO_R_OK)
2431 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2432 if (ret != PMINFO_R_OK) {
2433 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2436 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2441 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2442 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2445 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2446 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2447 * @brief This API gets the list of appdefined privilege for a particular package
2449 * @par This API is for package-manager client application
2450 * @par Sync (or) Async : Synchronous API
2451 * @param[in] handle pointer to the package info handle.
2452 * @param[in] privilege_func callback function for list
2453 * @param[in] user_data user data to be passed to callback function
2454 * @return 0 if success, error code(<0) if fail
2455 * @retval PMINFO_R_OK success
2456 * @retval PMINFO_R_EINVAL invalid argument
2457 * @retval PMINFO_R_ERROR internal error
2458 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2459 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2461 int privilege_func(const char *name, const char *license_path, void *user_data)
2463 printf("appdefined privilege : %s", name);
2465 printf("licensed privilege, lecense path : %s", license_path);
2469 static int list_appdefined_privilege(const char *package)
2472 pkgmgrinfo_pkginfo_h handle;
2473 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2474 if (ret != PMINFO_R_OK)
2476 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2477 if (ret != PMINFO_R_OK) {
2478 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2481 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2486 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2487 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2489 /* TODO: add doxygen comment here */
2490 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2493 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2494 * @brief This API copy the application information handle
2496 * @par This API is for package-manager client application
2497 * @par Sync (or) Async : Synchronous API
2499 * @param[in] handle pointer to the package info handle.
2500 * @param[out] handle pointer to the package info handle.
2501 * @return 0 if success, error code(<0) if fail
2502 * @retval PMINFO_R_OK success
2503 * @retval PMINFO_R_EINVAL invalid argument
2504 * @retval PMINFO_R_ERROR internal error
2506 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2508 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2512 pkgmgrinfo_pkginfo_h clone;
2514 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2515 if (ret != PMINFO_R_OK)
2519 printf("package: %s\n", clone->package);
2520 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2525 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2529 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2530 pkgmgrinfo_app_list_cb app_func, void *user_data)
2531 * @brief This API gets list of installed applications for a particular package
2533 * @par This API is for package-manager client application
2534 * @par Sync (or) Async : Synchronous API
2535 * @param[in] handle package info handle
2536 * @param[in] component application component
2537 * @param[in] app_func iteration function for list
2538 * @param[in] user_data user data to be passed to callback function
2539 * @return 0 if success, error code(<0) if fail
2540 * @retval PMINFO_R_OK success
2541 * @retval PMINFO_R_EINVAL invalid argument
2542 * @retval PMINFO_R_ERROR internal error
2543 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2544 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2546 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2549 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2550 printf("appid : %s\n", appid);
2554 static int list_apps(const char *pkgid)
2557 pkgmgrinfo_pkginfo_h handle;
2558 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2559 if (ret != PMINFO_R_OK)
2561 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2562 if (ret != PMINFO_R_OK) {
2563 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2566 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2571 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2572 pkgmgrinfo_app_list_cb app_func, void *user_data);
2573 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2574 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2577 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2578 * @brief This API gets list of installed applications from all packages with minimum informaion.
2580 * @par This API is for package-manager client application
2581 * @par Sync (or) Async : Synchronous API
2582 * @param[in] app_func iteration function for list
2583 * @param[in] user_data user data to be passed to callback function
2584 * @return 0 if success, error code(<0) if fail
2585 * @retval PMINFO_R_OK success
2586 * @retval PMINFO_R_EINVAL invalid argument
2587 * @retval PMINFO_R_ERROR internal error
2591 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2593 char *pkgid1 = NULL;
2594 char *pkgid2 = NULL;
2595 pkgid1 = (char *)user_data;
2596 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2597 if (strcmp(pkgid1, pkgid2) == 0) {
2604 static int list_apps()
2607 char *name = "helloworld";
2608 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2609 if (ret != PMINFO_R_OK) {
2616 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2617 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2620 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2621 * @brief This API gets list of installed applications from all packages.
2623 * @par This API is for package-manager client application
2624 * @par Sync (or) Async : Synchronous API
2625 * @param[in] app_func iteration function for list
2626 * @param[in] user_data user data to be passed to callback function
2627 * @return 0 if success, error code(<0) if fail
2628 * @retval PMINFO_R_OK success
2629 * @retval PMINFO_R_EINVAL invalid argument
2630 * @retval PMINFO_R_ERROR internal error
2634 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2636 char *pkgid1 = NULL;
2637 char *pkgid2 = NULL;
2638 pkgid1 = (char *)user_data;
2639 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2640 if (strcmp(pkgid1, pkgid2) == 0) {
2647 static int list_apps()
2650 char *name = "helloworld";
2651 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2652 if (ret != PMINFO_R_OK) {
2659 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2660 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2663 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2664 * @brief This API creates the disabled application information handle from db
2666 * @par This API is for package-manager client application
2667 * @par Sync (or) Async : Synchronous API
2669 * @param[in] appid pointer to appid
2670 * @param[out] handle pointer to the application info handle.
2671 * @return 0 if success, error code(<0) if fail
2672 * @retval PMINFO_R_OK success
2673 * @retval PMINFO_R_EINVAL invalid argument
2674 * @retval PMINFO_R_ERROR internal error
2676 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2677 * @see pkgmgrinfo_appinfo_get_pkgid()
2678 * @see pkgmgrinfo_appinfo_is_multiple()
2680 static int get_disabled_app_type(const char *appid)
2684 pkgmgrinfo_appinfo_h handle;
2685 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2686 if (ret != PMINFO_R_OK)
2688 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2689 if (ret != PMINFO_R_OK) {
2690 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2693 printf("apptype: %s\n", type);
2694 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2699 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2700 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2703 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2704 * @brief This API creates the application information handle from db
2706 * @par This API is for package-manager client application
2707 * @par Sync (or) Async : Synchronous API
2709 * @param[in] appid pointer to appid
2710 * @param[out] handle pointer to the application info handle.
2711 * @return 0 if success, error code(<0) if fail
2712 * @retval PMINFO_R_OK success
2713 * @retval PMINFO_R_EINVAL invalid argument
2714 * @retval PMINFO_R_ERROR internal error
2716 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2717 * @see pkgmgrinfo_appinfo_get_pkgid()
2718 * @see pkgmgrinfo_appinfo_is_multiple()
2720 static int get_app_type(const char *appid)
2724 pkgmgrinfo_appinfo_h handle;
2725 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2726 if (ret != PMINFO_R_OK)
2728 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2729 if (ret != PMINFO_R_OK) {
2730 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2733 printf("apptype: %s\n", type);
2734 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2739 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2740 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2743 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2744 * @brief This API creates the application information handle from db regardless of its disable or storage status
2746 * @par This API is for package-manager client application
2747 * @par Sync (or) Async : Synchronous API
2749 * @param[in] appid pointer to appid
2750 * @param[out] handle pointer to the application info handle.
2751 * @return 0 if success, error code(<0) if fail
2752 * @retval PMINFO_R_OK success
2753 * @retval PMINFO_R_EINVAL invalid argument
2754 * @retval PMINFO_R_ERROR internal error
2756 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2757 * @see pkgmgrinfo_appinfo_get_pkgid()
2758 * @see pkgmgrinfo_appinfo_is_multiple()
2760 static int get_app_type(const char *appid)
2764 pkgmgrinfo_appinfo_h handle;
2765 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2766 if (ret != PMINFO_R_OK)
2768 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2769 if (ret != PMINFO_R_OK) {
2770 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2773 printf("apptype: %s\n", type);
2774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2779 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2780 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2783 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2784 * @brief This API gets the application ID
2786 * @par This API is for package-manager client application
2787 * @par Sync (or) Async : Synchronous API
2789 * @param[in] handle pointer to the application info handle.
2790 * @param[out] appid pointer to hold appid
2791 * @return 0 if success, error code(<0) if fail
2792 * @retval PMINFO_R_OK success
2793 * @retval PMINFO_R_EINVAL invalid argument
2794 * @retval PMINFO_R_ERROR internal error
2795 * @pre pkgmgrinfo_appinfo_get_appinfo()
2796 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2797 * @see pkgmgrinfo_appinfo_get_pkgid()
2798 * @see pkgmgrinfo_appinfo_is_multiple()
2800 static int get_app_id(const char *appid)
2803 char *app_id = NULL;
2804 pkgmgrinfo_appinfo_h handle;
2805 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2806 if (ret != PMINFO_R_OK)
2808 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2809 if (ret != PMINFO_R_OK) {
2810 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2813 printf("app id: %s\n", app_id);
2814 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2819 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2822 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2823 * @brief This API gets the package name of the application
2825 * @par This API is for package-manager client application
2826 * @par Sync (or) Async : Synchronous API
2828 * @param[in] handle pointer to the application info handle.
2829 * @param[out] pkg_name pointer to hold package name
2830 * @return 0 if success, error code(<0) if fail
2831 * @retval PMINFO_R_OK success
2832 * @retval PMINFO_R_EINVAL invalid argument
2833 * @retval PMINFO_R_ERROR internal error
2834 * @pre pkgmgrinfo_appinfo_get_appinfo()
2835 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2836 * @see pkgmgrinfo_appinfo_get_appid()
2837 * @see pkgmgrinfo_appinfo_is_multiple()
2839 static int get_app_pkgname(const char *appid)
2842 char *pkgname = NULL;
2843 pkgmgrinfo_appinfo_h handle;
2844 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2845 if (ret != PMINFO_R_OK)
2847 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2848 if (ret != PMINFO_R_OK) {
2849 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2852 printf("pkg name: %s\n", pkgname);
2853 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2858 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2861 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2862 * @brief This API gets the package id of the application
2864 * @par This API is for package-manager client application
2865 * @par Sync (or) Async : Synchronous API
2867 * @param[in] handle pointer to the application info handle.
2868 * @param[out] pkgid pointer to hold package id
2869 * @return 0 if success, error code(<0) if fail
2870 * @retval PMINFO_R_OK success
2871 * @retval PMINFO_R_EINVAL invalid argument
2872 * @retval PMINFO_R_ERROR internal error
2873 * @pre pkgmgrinfo_appinfo_get_appinfo()
2874 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2875 * @see pkgmgrinfo_appinfo_get_appid()
2876 * @see pkgmgrinfo_appinfo_is_multiple()
2878 static int get_app_pkgid(const char *appid)
2882 pkgmgrinfo_appinfo_h handle;
2883 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2884 if (ret != PMINFO_R_OK)
2886 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2887 if (ret != PMINFO_R_OK) {
2888 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2891 printf("pkg id: %s\n", pkgid);
2892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2897 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2900 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2901 * @brief This API gets the package type of the application
2903 * @par This API is for package-manager client application
2904 * @par Sync (or) Async : Synchronous API
2906 * @param[in] handle pointer to the application info handle.
2907 * @param[out] pkgtype pointer to hold package type
2908 * @return 0 if success, error code(<0) if fail
2909 * @retval PMINFO_R_OK success
2910 * @retval PMINFO_R_EINVAL invalid argument
2911 * @retval PMINFO_R_ERROR internal error
2912 * @pre pkgmgrinfo_appinfo_get_appinfo()
2913 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2914 * @see pkgmgrinfo_appinfo_get_appid()
2915 * @see pkgmgrinfo_appinfo_is_multiple()
2917 static int get_app_pkgtype(const char *appid)
2920 char *pkgtype = NULL;
2921 pkgmgrinfo_appinfo_h handle = NULL;
2922 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2923 if (ret != PMINFO_R_OK)
2925 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2926 if (ret != PMINFO_R_OK) {
2927 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2930 printf("pkgtype: %s\n", pkgtype);
2931 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2936 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2939 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2940 * @brief This API gets the executable name of the application
2942 * @par This API is for package-manager client application
2943 * @par Sync (or) Async : Synchronous API
2945 * @param[in] handle pointer to the application info handle.
2946 * @param[out] exec pointer to hold app exec name
2947 * @return 0 if success, error code(<0) if fail
2948 * @retval PMINFO_R_OK success
2949 * @retval PMINFO_R_EINVAL invalid argument
2950 * @retval PMINFO_R_ERROR internal error
2951 * @pre pkgmgrinfo_appinfo_get_appinfo()
2952 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2953 * @see pkgmgrinfo_appinfo_get_appid()
2954 * @see pkgmgrinfo_appinfo_is_multiple()
2956 static int get_app_exec(const char *appid)
2960 pkgmgrinfo_appinfo_h handle;
2961 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2962 if (ret != PMINFO_R_OK)
2964 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2965 if (ret != PMINFO_R_OK) {
2966 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2969 printf("exec name: %s\n", exec);
2970 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2975 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2978 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2979 * @brief This API gets the icon name of the application
2981 * @par This API is for package-manager client application
2982 * @par Sync (or) Async : Synchronous API
2984 * @param[in] handle pointer to the application info handle.
2985 * @param[out] icon pointer to hold app icon name
2986 * @return 0 if success, error code(<0) if fail
2987 * @retval PMINFO_R_OK success
2988 * @retval PMINFO_R_EINVAL invalid argument
2989 * @retval PMINFO_R_ERROR internal error
2990 * @pre pkgmgrinfo_appinfo_get_appinfo()
2991 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2992 * @see pkgmgrinfo_appinfo_get_appid()
2993 * @see pkgmgrinfo_appinfo_is_multiple()
2995 static int get_app_icon(const char *appid)
2999 pkgmgrinfo_appinfo_h handle;
3000 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3001 if (ret != PMINFO_R_OK)
3003 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3004 if (ret != PMINFO_R_OK) {
3005 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3008 printf("icon name: %s\n", icon);
3009 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3014 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3017 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3018 * @brief This API gets the label of the application
3020 * @par This API is for package-manager client application
3021 * @par Sync (or) Async : Synchronous API
3023 * @param[in] handle pointer to the application info handle.
3024 * @param[out] label pointer to hold app label
3025 * @return 0 if success, error code(<0) if fail
3026 * @retval PMINFO_R_OK success
3027 * @retval PMINFO_R_EINVAL invalid argument
3028 * @retval PMINFO_R_ERROR internal error
3029 * @pre pkgmgrinfo_appinfo_get_appinfo()
3030 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3031 * @see pkgmgrinfo_appinfo_get_appid()
3032 * @see pkgmgrinfo_appinfo_is_multiple()
3034 static int get_app_label(const char *appid)
3038 pkgmgrinfo_appinfo_h handle;
3039 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3040 if (ret != PMINFO_R_OK)
3042 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3043 if (ret != PMINFO_R_OK) {
3044 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3047 printf("label : %s\n", label);
3048 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3053 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3056 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3057 * @brief This API gets exactly matched label by given appid and locale
3059 * @par This API is for package-manager client application
3060 * @par Sync (or) Async : Synchronous API
3062 * @param[in] appid pointer to appid
3063 * @param[in] locale pointer to locale
3064 * @param[out] label pointer to hold app label
3065 * @return 0 if success, error code(<0) if fail
3066 * @retval PMINFO_R_OK success
3067 * @retval PMINFO_R_EINVAL invalid argument
3068 * @retval PMINFO_R_ERROR internal error
3070 static int get_localed_label(const char *appid, const char *locale)
3075 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3076 if (ret != PMINFO_R_OK)
3079 printf("localed label: %s\n", label);
3087 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3088 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3091 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3092 * @brief This API gets metadata value by given metadata key
3094 * @par This API is for package-manager client application
3095 * @par Sync (or) Async : Synchronous API
3097 * @param[in] handle pointer to the application info handle
3098 * @param[in] metadata_key metadata key
3099 * @param[out] metadata_value pointer to hold metadata value
3100 * @return 0 if success, error code(<0) if fail
3101 * @retval PMINFO_R_OK success
3102 * @retval PMINFO_R_EINVAL invalid argument
3104 static int get_metadata_value(const char *appid, const char *metadata_key)
3107 pkgmgrinfo_appinfo_h handle = NULL;
3108 char *metadata_value = NULL;
3110 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3111 if (ret != PMINFO_R_OK)
3114 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3115 if (ret != PMINFO_R_OK) {
3116 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3120 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3125 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3128 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3129 * @brief This API gets the component of the application
3131 * @par This API is for package-manager client application
3132 * @par Sync (or) Async : Synchronous API
3134 * @param[in] handle pointer to the application info handle.
3135 * @param[out] component pointer to hold app component
3136 * @return 0 if success, error code(<0) if fail
3137 * @retval PMINFO_R_OK success
3138 * @retval PMINFO_R_EINVAL invalid argument
3139 * @retval PMINFO_R_ERROR internal error
3140 * @pre pkgmgrinfo_appinfo_get_appinfo()
3141 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3142 * @see pkgmgrinfo_appinfo_get_appid()
3143 * @see pkgmgrinfo_appinfo_is_multiple()
3145 static int get_app_component(const char *appid)
3148 pkgmgrinfo_app_component component;
3149 pkgmgrinfo_appinfo_h handle;
3150 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3151 if (ret != PMINFO_R_OK)
3153 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3154 if (ret != PMINFO_R_OK) {
3155 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3158 printf("component : %s\n", component);
3159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3164 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3167 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3168 * @brief This API gets the apptype of the application
3170 * @par This API is for package-manager client application
3171 * @par Sync (or) Async : Synchronous API
3173 * @param[in] handle pointer to the application info handle.
3174 * @param[out] app_type pointer to hold apptype
3175 * @return 0 if success, error code(<0) if fail
3176 * @retval PMINFO_R_OK success
3177 * @retval PMINFO_R_EINVAL invalid argument
3178 * @retval PMINFO_R_ERROR internal error
3179 * @pre pkgmgrinfo_appinfo_get_appinfo()
3180 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3181 * @see pkgmgrinfo_appinfo_get_appid()
3182 * @see pkgmgrinfo_appinfo_is_multiple()
3184 static int get_app_type(const char *appid)
3187 char *apptype = NULL;
3188 pkgmgrinfo_appinfo_h handle;
3189 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3190 if (ret != PMINFO_R_OK)
3192 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3193 if (ret != PMINFO_R_OK) {
3194 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3197 printf("apptype : %s\n", apptype);
3198 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3203 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3206 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3207 int *operation_count, char ***operation)
3208 * @brief This API gets the list of operation of the application
3210 * @par This API is for package-manager client application
3211 * @par Sync (or) Async : Synchronous API
3213 * @param[in] handle pointer to the appcontrol handle.
3214 * @param[out] operation_count pointer to hold number of operations
3215 * @param[out] operation pointer to hold list of operations
3216 * @return 0 if success, error code(<0) if fail
3217 * @retval PMINFO_R_OK success
3218 * @retval PMINFO_R_EINVAL invalid argument
3219 * @retval PMINFO_R_ERROR internal error
3220 * @pre pkgmgrinfo_appinfo_get_appinfo()
3221 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3222 * @see pkgmgrinfo_appinfo_get_uri()
3223 * @see pkgmgrinfo_appinfo_get_mime()
3225 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3230 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3231 for (i = 0; i < oc; i++) {
3232 if (strcmp(operation[i], (char *)user_data) == 0)
3239 static int check_operation(const char *appid, char *operation)
3242 pkgmgrinfo_appinfo_h handle;
3243 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3244 if (ret != PMINFO_R_OK)
3246 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3247 if (ret != PMINFO_R_OK) {
3248 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3251 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3256 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3257 int *operation_count, char ***operation);
3260 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3261 int *uri_count, char ***uri)
3262 * @brief This API gets the list of uri of the application
3264 * @par This API is for package-manager client application
3265 * @par Sync (or) Async : Synchronous API
3267 * @param[in] handle pointer to the appcontrol handle.
3268 * @param[out] uri_count pointer to hold number of uris
3269 * @param[out] uri pointer to hold list of uris
3270 * @return 0 if success, error code(<0) if fail
3271 * @retval PMINFO_R_OK success
3272 * @retval PMINFO_R_EINVAL invalid argument
3273 * @retval PMINFO_R_ERROR internal error
3274 * @pre pkgmgrinfo_appinfo_get_appinfo()
3275 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3276 * @see pkgmgrinfo_appinfo_get_operation()
3277 * @see pkgmgrinfo_appinfo_get_mime()
3279 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3284 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
3285 for (i = 0; i < uc; i++) {
3286 if (strcmp(uri[i], (char *)user_data) == 0)
3293 static int check_uri(const char *appid, char *uri)
3296 pkgmgrinfo_appinfo_h handle;
3297 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3298 if (ret != PMINFO_R_OK)
3300 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
3301 if (ret != PMINFO_R_OK) {
3302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3305 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3310 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3311 int *uri_count, char ***uri);
3314 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3315 int *mime_count, char ***mime)
3316 * @brief This API gets the list of mime of the application
3318 * @par This API is for package-manager client application
3319 * @par Sync (or) Async : Synchronous API
3321 * @param[in] handle pointer to the appcontrol handle.
3322 * @param[out] mime_count pointer to hold number of mimes
3323 * @param[out] mime pointer to hold list of mimes
3324 * @return 0 if success, error code(<0) if fail
3325 * @retval PMINFO_R_OK success
3326 * @retval PMINFO_R_EINVAL invalid argument
3327 * @retval PMINFO_R_ERROR internal error
3328 * @pre pkgmgrinfo_appinfo_get_appinfo()
3329 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3330 * @see pkgmgrinfo_appinfo_get_uri()
3331 * @see pkgmgrinfo_appinfo_get_operation()
3333 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3338 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
3339 for (i = 0; i < mc; i++) {
3340 if (strcmp(mime[i], (char *)user_data) == 0)
3347 static int check_mime(const char *appid, char *mime)
3350 pkgmgrinfo_appinfo_h handle;
3351 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3352 if (ret != PMINFO_R_OK)
3354 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3355 if (ret != PMINFO_R_OK) {
3356 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3359 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3364 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3365 int *mime_count, char ***mime);
3368 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3369 int *subapp_count, char ***subapp)
3370 * @brief This API gets the list of subapp of the application
3372 * @par This API is for package-manager client application
3373 * @par Sync (or) Async : Synchronous API
3375 * @param[in] handle pointer to the appcontrol handle.
3376 * @param[out] subapp_count pointer to hold number of subapp
3377 * @param[out] subapp pointer to hold list of subapp
3378 * @return 0 if success, error code(<0) if fail
3379 * @retval PMINFO_R_OK success
3380 * @retval PMINFO_R_EINVAL invalid argument
3381 * @retval PMINFO_R_ERROR internal error
3382 * @pre pkgmgrinfo_appinfo_get_appinfo()
3383 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3384 * @see pkgmgrinfo_appinfo_get_uri()
3385 * @see pkgmgrinfo_appinfo_get_operation()
3387 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3391 char **subapp = NULL;
3392 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3393 for (i = 0; i < sc; i++) {
3394 if (strcmp(subapp[i], (char *)user_data) == 0)
3401 static int check_subapp(const char *appid, char *subapp)
3404 pkgmgrinfo_appinfo_h handle = NULL;
3405 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3406 if (ret != PMINFO_R_OK)
3408 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3409 if (ret != PMINFO_R_OK) {
3410 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3413 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3418 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3419 int *subapp_count, char ***subapp);
3422 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3423 * @brief This API gets the notification icon of the application
3425 * @par This API is for package-manager client application
3426 * @par Sync (or) Async : Synchronous API
3428 * @param[in] handle pointer to the application info handle.
3429 * @param[out] path pointer to hold notification icon
3430 * @return 0 if success, error code(<0) if fail
3431 * @retval PMINFO_R_OK success
3432 * @retval PMINFO_R_EINVAL invalid argument
3433 * @retval PMINFO_R_ERROR internal error
3434 * @pre pkgmgrinfo_appinfo_get_appinfo()
3435 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3436 * @see pkgmgrinfo_appinfo_get_appid()
3437 * @see pkgmgrinfo_appinfo_is_multiple()
3439 static int get_app_notification_icon(const char *appid)
3442 char *notification_icon = NULL;
3443 pkgmgrinfo_appinfo_h handle;
3444 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3445 if (ret != PMINFO_R_OK)
3447 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3448 if (ret != PMINFO_R_OK) {
3449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3452 printf("notification icon : %s\n", notification_icon);
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3458 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3461 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3462 * @brief This API gets the type of recent image on app-tray
3464 * @par This API is for package-manager client application
3465 * @par Sync (or) Async : Synchronous API
3467 * @param[in] handle pointer to the application info handle.
3468 * @param[out] type pointer to hold image type
3469 * @return 0 if success, error code(<0) if fail
3470 * @retval PMINFO_R_OK success
3471 * @retval PMINFO_R_EINVAL invalid argument
3472 * @retval PMINFO_R_ERROR internal error
3473 * @pre pkgmgrinfo_appinfo_get_appinfo()
3474 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3475 * @see pkgmgrinfo_appinfo_get_appid()
3476 * @see pkgmgrinfo_appinfo_is_multiple()
3478 static int get_app_recent_image_type(const char *appid)
3481 pkgmgrinfo_app_recentimage type;
3482 pkgmgrinfo_appinfo_h handle;
3483 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3484 if (ret != PMINFO_R_OK)
3486 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3487 if (ret != PMINFO_R_OK) {
3488 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3491 printf("recent image type: %d\n", type);
3492 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3497 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3501 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3502 * @brief This API gets the preview image of application
3504 * @par Sync (or) Async : Synchronous API
3506 * @param[in] handle pointer to the application info handle.
3507 * @param[out] preview_img pointer to hold preview image path
3508 * @return 0 if success, error code(<0) if fail
3509 * @retval PMINFO_R_OK success
3510 * @retval PMINFO_R_EINVAL invalid argument
3511 * @retval PMINFO_R_ERROR internal error
3512 * @pre pkgmgrinfo_appinfo_get_appinfo()
3513 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3514 * @see pkgmgrinfo_appinfo_get_appid()
3516 static int get_app_previewimage(const char *appid)
3519 char *preview = NULL;
3520 pkgmgrinfo_appinfo_h handle = NULL;
3521 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3522 if (ret != PMINFO_R_OK)
3524 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3525 if (ret != PMINFO_R_OK) {
3526 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3529 printf("preview image path : %s\n", preview);
3530 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3535 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3539 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3540 * @brief This API gets the package permission type of the application
3542 * @par This API is for package-manager client application
3543 * @par Sync (or) Async : Synchronous API
3545 * @param[in] handle pointer to the application info handle.
3546 * @param[out] permission pointer to hold package permission
3547 * @return 0 if success, error code(<0) if fail
3548 * @retval PMINFO_R_OK success
3549 * @retval PMINFO_R_EINVAL invalid argument
3550 * @retval PMINFO_R_ERROR internal error
3551 * @pre pkgmgrinfo_appinfo_get_appinfo()
3552 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3553 * @see pkgmgrinfo_appinfo_get_appid()
3555 static int get_app_permission(const char *appid)
3558 pkgmgrinfo_permission_type permission = 0;
3559 pkgmgrinfo_appinfo_h handle;
3561 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3562 if (ret != PMINFO_R_OK)
3564 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3565 if (ret != PMINFO_R_OK) {
3566 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3569 printf("permission type: %d\n", permission);
3570 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3575 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3578 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3579 * @brief This API gets the component_type
3581 * @par This API is for package-manager client application
3582 * @par Sync (or) Async : Synchronous API
3584 * @param[in] handle pointer to the application info handle.
3585 * @param[out] component_type pointer to hold component_type
3586 * @return 0 if success, error code(<0) if fail
3587 * @retval PMINFO_R_OK success
3588 * @retval PMINFO_R_EINVAL invalid argument
3589 * @retval PMINFO_R_ERROR internal error
3590 * @pre pkgmgrinfo_appinfo_get_appinfo()
3591 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3592 * @see pkgmgrinfo_appinfo_get_pkgid()
3593 * @see pkgmgrinfo_appinfo_is_multiple()
3595 static int get_component_type(const char *appid)
3598 char *component_type = NULL;
3599 pkgmgrinfo_appinfo_h handle;
3600 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3601 if (ret != PMINFO_R_OK)
3603 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3604 if (ret != PMINFO_R_OK) {
3605 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3608 printf("component_type: %s\n", component_type);
3609 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3614 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3617 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3618 * @brief This API gets the application 'hwacceleration' value from the app ID
3620 * @par This API is for package-manager client application
3621 * @par Sync (or) Async : Synchronous API
3623 * @param[in] handle pointer to application info handle
3624 * @param[out] hwacceleration pointer to hold package hwacceleration value
3625 * @return 0 if success, error code(<0) if fail
3626 * @retval PMINFO_R_OK success
3627 * @retval PMINFO_R_EINVAL invalid argument
3628 * @retval PMINFO_R_ERROR internal error
3629 * @pre pkgmgrinfo_appinfo_get_appinfo()
3630 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3631 * @see pkgmgrinfo_appinfo_get_appid()
3632 * @see pkgmgrinfo_appinfo_is_multiple()
3634 static int get_app_hwacceleration(const char *appid)
3637 pkgmgrinfo_app_hwacceleration hwacceleration;
3638 pkgmgrinfo_appinfo_h handle;
3639 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3640 if (ret != PMINFO_R_OK)
3642 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3643 if (ret != PMINFO_R_OK) {
3644 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3647 printf("app hwacceleration: %d\n", hwacceleration);
3648 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3653 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3656 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3657 * @brief This API gets the application 'screenreader' value from the app ID
3659 * @par This API is for package-manager client application
3660 * @par Sync (or) Async : Synchronous API
3662 * @param[in] handle pointer to application info handle
3663 * @param[out] screenreader pointer to hold package accessibility value
3664 * @return 0 if success, error code(<0) if fail
3665 * @retval PMINFO_R_OK success
3666 * @retval PMINFO_R_EINVAL invalid argument
3667 * @retval PMINFO_R_ERROR internal error
3668 * @pre pkgmgrinfo_appinfo_get_appinfo()
3669 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3670 * @see pkgmgrinfo_appinfo_get_appid()
3671 * @see pkgmgrinfo_appinfo_is_multiple()
3673 static int get_app_screenreader(const char *appid)
3676 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3677 pkgmgrinfo_appinfo_h handle = NULL;
3678 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3679 if (ret != PMINFO_R_OK)
3681 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3682 if (ret != PMINFO_R_OK) {
3683 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3686 printf("app screenreader: %d\n", screenreader);
3687 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3692 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3695 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3696 * @brief This API gets the application's landscape & portrait effect images
3698 * @par This API is for package-manager client application
3699 * @par Sync (or) Async : Synchronous API
3701 * @param[in] handle pointer to application info handle
3702 * @param[out] portrait_img contains portrait mode effect image
3703 * @param[out] landscape_img contains landscape mode effect image
3704 * @return 0 if success, error code(<0) if fail
3705 * @retval PMINFO_R_OK success
3706 * @retval PMINFO_R_EINVAL invalid argument
3707 * @retval PMINFO_R_ERROR internal error
3708 * @pre pkgmgrinfo_appinfo_get_appinfo()
3709 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3710 * @see pkgmgrinfo_appinfo_get_appid()
3711 * @see pkgmgrinfo_appinfo_is_nodisplay()
3713 static int get_app_effectimages(const char *appid)
3716 char *portraitimg = NULL;
3717 char *landscapeimg = NULL;
3718 pkgmgrinfo_appinfo_h handle;
3719 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3720 if (ret != PMINFO_R_OK)
3722 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3723 if (ret != PMINFO_R_OK) {
3724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3727 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3728 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3733 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3736 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3737 * @brief This API gets the application's effect image type
3739 * @par This API is for package-manager client application
3740 * @par Sync (or) Async : Synchronous API
3742 * @param[in] handle pointer to application info handle
3743 * @param[out] effectimg_type contains effect image type
3744 * @return 0 if success, error code(<0) if fail
3745 * @retval PMINFO_R_OK success
3746 * @retval PMINFO_R_EINVAL invalid argument
3747 * @retval PMINFO_R_ERROR internal error
3748 * @pre pkgmgrinfo_appinfo_get_appinfo()
3749 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3750 * @see pkgmgrinfo_appinfo_get_appid()
3751 * @see pkgmgrinfo_appinfo_is_nodisplay()
3753 static int get_app_effectimage_type(const char *appid)
3756 char *effectimg_type = NULL;
3757 pkgmgrinfo_appinfo_h handle = NULL;
3758 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3759 if (ret != PMINFO_R_OK)
3761 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3762 if (ret != PMINFO_R_OK) {
3763 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3766 printf("app effect image type: %s\n", effectimg_type);
3767 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3772 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3775 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3776 * @brief This API gets the submode_mainid of the application
3778 * @par This API is for package-manager client application
3779 * @par Sync (or) Async : Synchronous API
3781 * @param[in] handle pointer to the application info handle.
3782 * @param[out] submode_mainid pointer to hold package name
3783 * @return 0 if success, error code(<0) if fail
3784 * @retval PMINFO_R_OK success
3785 * @retval PMINFO_R_EINVAL invalid argument
3786 * @retval PMINFO_R_ERROR internal error
3787 * @pre pkgmgrinfo_appinfo_get_appinfo()
3788 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3789 * @see pkgmgrinfo_appinfo_get_appid()
3790 * @see pkgmgrinfo_appinfo_is_multiple()
3792 static int get_app_submode_mainid(const char *appid)
3795 char *submode_mainid = NULL;
3796 pkgmgrinfo_appinfo_h handle = NULL;
3797 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3798 if (ret != PMINFO_R_OK)
3800 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3801 if (ret != PMINFO_R_OK) {
3802 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3805 printf("submode_mainid: %s\n", submode_mainid);
3806 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3811 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3814 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3815 * @brief This API gets the datacontrol info
3817 * @par This API is for package-manager client application
3818 * @par Sync (or) Async : Synchronous API
3820 * @param[in] providerid pointer to the providerid of dataconltrol.
3821 * @param[in] type pointer to the type of dataconltrol.
3822 * @param[out] appid pointer to hold appid, need to free after using
3823 * @param[out] access pointer to hold access, need to free after using
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_info(const char *providerid, const char *type, char **appid, char **access);
3831 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3834 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3835 * @brief This API gets the appid of datacontrol
3837 * @par This API is for package-manager client application
3838 * @par Sync (or) Async : Synchronous API
3840 * @param[in] providerid pointer to the providerid of dataconltrol.
3841 * @param[out] appid pointer to hold appid, need to free after using
3842 * @return 0 if success, error code(<0) if fail
3843 * @retval PMINFO_R_OK success
3844 * @retval PMINFO_R_EINVAL invalid argument
3845 * @retval PMINFO_R_ERROR internal error
3848 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3849 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3852 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3853 * @brief This API gets the information about trusted datacontrol
3855 * @par This API is for package-manager client application
3856 * @par Sync (or) Async : Synchronous API
3858 * @param[in] providerid pointer to the providerid of datacontrol.
3859 * @param[out] appid pointer to hold appid, need to free after using
3860 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3861 * @return 0 if success, error code(<0) if fail
3862 * @retval PMINFO_R_OK success
3863 * @retval PMINFO_R_EINVAL invalid argument
3864 * @retval PMINFO_R_ERROR internal error
3867 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3868 const char *type, char **appid, bool *is_trusted);
3869 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3870 const char *type, uid_t uid, char **appid, bool *is_trusted);
3873 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3874 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3875 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3877 * @par This API is for package-manager client application
3878 * @par Sync (or) Async : Synchronous API
3880 * @param[in] providerid pointer to the providerid of datacontrol.
3881 * @param[in] type pointer to the type of dataconltrol.
3882 * @param[in] privilege_func callback function for list
3883 * @param[in] user_data user data to be passed to callback function
3884 * @return 0 if success, error code(<0) if fail
3885 * @retval PMINFO_R_OK success
3886 * @retval PMINFO_R_EINVAL invalid argument
3887 * @retval PMINFO_R_ERROR internal error
3889 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3890 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3891 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3892 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3895 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3896 * @brief This API gets the alias_appid of the application
3898 * @par This API is for package-manager client application
3899 * @par Sync (or) Async : Synchronous API
3901 * @param[in] handle pointer to the application info handle.
3902 * @param[out] alias_appid pointer to hold app alias_appid
3903 * @return 0 if success, error code(<0) if fail
3904 * @retval PMINFO_R_OK success
3905 * @retval PMINFO_R_EINVAL invalid argument
3906 * @retval PMINFO_R_ERROR internal error
3907 * @pre pkgmgrinfo_appinfo_get_appinfo()
3908 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3909 * @see pkgmgrinfo_appinfo_get_appid()
3911 static int get_alias_appid(const char *appid)
3914 char *alias_appid= 0;
3915 pkgmgrinfo_appinfo_h handle = NULL;
3916 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3917 if (ret != PMINFO_R_OK)
3919 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3920 if (ret != PMINFO_R_OK) {
3921 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3924 printf("alias_appid: %s\n", alias_appid);
3925 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3930 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3933 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3934 * @brief This API gets the effective_appid of the application
3936 * @par This API is for package-manager client application
3937 * @par Sync (or) Async : Synchronous API
3939 * @param[in] handle pointer to the application info handle.
3940 * @param[out] effective_appid pointer to hold app effective_appid
3941 * @return 0 if success, error code(<0) if fail
3942 * @retval PMINFO_R_OK success
3943 * @retval PMINFO_R_EINVAL invalid argument
3944 * @retval PMINFO_R_ERROR internal error
3945 * @pre pkgmgrinfo_appinfo_get_appinfo()
3946 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3947 * @see pkgmgrinfo_appinfo_get_appid()
3949 static int get_effective_appid(const char *appid)
3952 char *effective_appid= 0;
3953 pkgmgrinfo_appinfo_h handle = NULL;
3954 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3955 if (ret != PMINFO_R_OK)
3957 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3958 if (ret != PMINFO_R_OK) {
3959 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3962 printf("effective_appid: %s\n", effective_appid);
3963 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3968 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3971 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3972 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3974 * @par This API is for package-manager client application
3975 * @par Sync (or) Async : Synchronous API
3977 * @param[in] handle pointer to the appinfo handle.
3978 * @param[out] tep_name pointer to hold tep name
3979 * @return 0 if success, error code(<0) if fail
3980 * @retval PMINFO_R_OK success
3981 * @retval PMINFO_R_EINVAL invalid argument
3982 * @retval PMINFO_R_ERROR internal error
3983 * @pre pkgmgrinfo_appinfo_get_appinfo()
3984 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3985 * @see pkgmgrinfo_appinfo_get_appid()
3987 static int get_tep_name(const char *appid)
3990 char *tep_name = NULL;
3991 pkgmgrinfo_appinfo_h handle = NULL;
3992 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3993 if (ret != PMINFO_R_OK)
3995 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3996 if (ret != PMINFO_R_OK) {
3997 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4000 printf("TEP name is: %s\n", tep_name);
4001 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4006 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4009 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4010 * @brief This API gets zip mount file name associated with the package which contain given application
4011 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4013 * @par This API is for package-manager client application
4014 * @par Sync (or) Async : Synchronous API
4016 * @param[in] handle pointer to the appinfo handle.
4017 * @param[out] zip_mount_file pointer to hold zip mount file name
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
4022 * @pre pkgmgrinfo_appinfo_get_appinfo()
4023 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4024 * @see pkgmgrinfo_appinfo_get_appid()
4026 static int get_zip_mount_file(const char *appid)
4029 char *zip_mount_file = NULL;
4030 pkgmgrinfo_appinfo_h handle = NULL;
4031 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4032 if (ret != PMINFO_R_OK)
4034 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4035 if (ret != PMINFO_R_OK) {
4036 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4039 printf("Mount file name is: %s\n", zip_mount_file);
4040 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4045 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4048 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4049 * @brief This API gets the root path of application
4051 * @par Sync (or) Async : Synchronous API
4053 * @param[in] handle pointer to appinfo handle
4054 * @param[out] path pointer to hold root path of application
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
4060 static int get_root_path(const char *appid)
4064 pkgmgrinfo_appinfo_h handle;
4065 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4066 if (ret != PMINFO_R_OK)
4069 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4070 if (ret != PMINFO_R_OK) {
4071 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4074 printf("path : %s\n", path);
4075 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4081 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4084 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4085 * @brief This API gets the application api_version from the application ID
4087 * @par This API is for package-manager client application
4088 * @par Sync (or) Async : Synchronous API
4090 * @param[in] handle pointer to appinfo handle
4091 * @param[out] api_version pointer to hold application api_version
4092 * @return 0 if success, error code(<0) if fail
4093 * @retval PMINFO_R_OK success
4094 * @retval PMINFO_R_EINVAL invalid argument
4095 * @retval PMINFO_R_ERROR internal error
4096 * @pre pkgmgrinfo_appinfo_get_appinfo()
4097 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4098 * @see pkgmgrinfo_appinfo_get_appid()
4100 static int get_app_api_version(const char *appid)
4103 char *api_version = NULL;
4104 pkgmgrinfo_appinfo_h handle = NULL;
4105 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4106 if (ret != PMINFO_R_OK)
4108 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4109 if (ret != PMINFO_R_OK) {
4110 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4113 printf("app api_version: %s\n", api_version);
4114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4119 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4122 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4123 * @brief This API gets the installed_time of the application
4125 * @par This API is for package-manager client application
4126 * @par Sync (or) Async : Synchronous API
4128 * @param[in] handle pointer to the application info handle.
4129 * @param[out] installed_time pointer to hold installed_time
4130 * @return 0 if success, error code(<0) if fail
4131 * @retval PMINFO_R_OK success
4132 * @retval PMINFO_R_EINVAL invalid argument
4133 * @retval PMINFO_R_ERROR internal error
4134 * @pre pkgmgrinfo_appinfo_get_appinfo()
4135 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4136 * @see pkgmgrinfo_appinfo_get_appid()
4137 * @see pkgmgrinfo_appinfo_is_multiple()
4139 static int get_app_installed_time(const char *appid)
4142 int installed_time = 0;
4143 pkgmgrinfo_appinfo_h handle = NULL;
4144 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4145 if (ret != PMINFO_R_OK)
4147 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4148 if (ret != PMINFO_R_OK) {
4149 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4152 printf("installed_time: %d\n", installed_time);
4153 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4158 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4161 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4162 * @brief This API gets the support_mode of the application
4164 * @par This API is for package-manager client application
4165 * @par Sync (or) Async : Synchronous API
4167 * @param[in] handle pointer to the application info handle.
4168 * @param[out] support_mode pointer to hold app support_mode
4169 * @return 0 if success, error code(<0) if fail
4170 * @retval PMINFO_R_OK success
4171 * @retval PMINFO_R_EINVAL invalid argument
4172 * @retval PMINFO_R_ERROR internal error
4173 * @pre pkgmgrinfo_appinfo_get_appinfo()
4174 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4175 * @see pkgmgrinfo_appinfo_get_appid()
4177 static int get_app_support_mode(const char *appid)
4180 int support_mode = 0;
4181 pkgmgrinfo_appinfo_h handle = NULL;
4182 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4183 if (ret != PMINFO_R_OK)
4185 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4186 if (ret != PMINFO_R_OK) {
4187 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4190 printf("support_mode: %s\n", support_mode);
4191 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4196 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4200 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4201 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4202 * @brief This API gets the list of category for a particular application
4204 * @par This API is for package-manager client application
4205 * @par Sync (or) Async : Synchronous API
4206 * @param[in] handle pointer to the application info handle.
4207 * @param[in] category_func callback function for list
4208 * @param[in] user_data user data to be passed to callback function
4209 * @return 0 if success, error code(<0) if fail
4210 * @retval PMINFO_R_OK success
4211 * @retval PMINFO_R_EINVAL invalid argument
4212 * @retval PMINFO_R_ERROR internal error
4213 * @pre pkgmgrinfo_appinfo_get_appinfo()
4214 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4216 int category_func(const char *name, void *user_data)
4218 if (strcmp(name, (char *)user_data) == 0)
4224 static int list_category(const char *appid, char *category)
4227 pkgmgrinfo_appinfo_h handle;
4228 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4229 if (ret != PMINFO_R_OK)
4231 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4232 if (ret != PMINFO_R_OK) {
4233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4236 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4241 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4242 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4245 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4246 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4247 * @brief This API gets the list of metadata for a particular application
4249 * @par This API is for package-manager client application
4250 * @par Sync (or) Async : Synchronous API
4251 * @param[in] handle pointer to the application info handle.
4252 * @param[in] metadata_func callback function for list
4253 * @param[in] user_data user data to be passed to callback function
4254 * @return 0 if success, error code(<0) if fail
4255 * @retval PMINFO_R_OK success
4256 * @retval PMINFO_R_EINVAL invalid argument
4257 * @retval PMINFO_R_ERROR internal error
4258 * @pre pkgmgrinfo_appinfo_get_appinfo()
4259 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4261 int metadata_func(const char *key, const char *value, void *user_data)
4263 if (strcmp(key, (char *)user_data) == 0) {
4264 printf("Value is %s\n", value);
4271 static int list_metadata(const char *appid, char *key)
4274 pkgmgrinfo_appinfo_h handle;
4275 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4276 if (ret != PMINFO_R_OK)
4278 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4279 if (ret != PMINFO_R_OK) {
4280 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4283 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4288 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4289 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4292 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4293 * const char *operation,
4294 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4296 * @brief This API gets the list of privileges for a particular
4297 * appllication's app_control
4299 * @par This API is for package-manager client application
4300 * @par Sync (or) Async : Synchronous API
4301 * @param[in] appid application id
4302 * @param[in] operation operation of appcontrol
4303 * @param[in] privilege_func callback function for list
4304 * @param[in] user_data user data to be passed to callback function
4305 * @return 0 if success, error code(<0) if fail
4306 * @retval PMINFO_R_OK success
4307 * @retval PMINFO_R_EINVAL invalid argument
4308 * @retval PMINFO_R_ERROR internal error
4310 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4311 const char *operation,
4312 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4313 void *user_data, uid_t uid);
4314 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4315 const char *operation,
4316 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4320 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4321 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4322 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4323 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4324 * @brief This API gets the list of app-control for a particular application
4326 * @par This API is for package-manager client application
4327 * @par Sync (or) Async : Synchronous API
4328 * @param[in] handle pointer to the application info handle.
4329 * @param[in] appcontrol_func callback function for list
4330 * @param[in] user_data user data to be passed to callback function
4331 * @param[in] uid the addressee user id of the instruction
4332 * @return 0 if success, error code(<0) if fail
4333 * @retval PMINFO_R_OK success
4334 * @retval PMINFO_R_EINVAL invalid argument
4335 * @retval PMINFO_R_ERROR internal error
4336 * @pre pkgmgrinfo_appinfo_get_appinfo()
4337 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4339 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4344 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4345 for (i = 0; i < oc; i++) {
4346 if (strcmp(operation[i], (char *)user_data) == 0)
4353 static int check_operation(const char *appid, char *operation)
4356 pkgmgrinfo_appinfo_h handle;
4357 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4358 if (ret != PMINFO_R_OK)
4360 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4361 if (ret != PMINFO_R_OK) {
4362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4365 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4370 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4371 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4376 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4377 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4380 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4381 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4382 * @brief This API gets the list of splashscreen for a particular application
4384 * @par This API is for package-manager client application
4385 * @par Sync (or) Async : Synchronous API
4386 * @param[in] handle pointer to the application info handle.
4387 * @param[in] splash_screen_func callback function for list
4388 * @param[in] user_data user data to be passed to callback function
4389 * @return 0 if success, error code(<0) if fail
4390 * @retval PMINFO_R_OK success
4391 * @retval PMINFO_R_EINVAL invalid argument
4392 * @retval PMINFO_R_ERROR internal error
4393 * @pre pkgmgrinfo_appinfo_get_appinfo()
4394 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4397 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4398 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4401 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4402 * @brief This API gets the application 'nodisplay' value from the app ID
4404 * @par This API is for package-manager client application
4405 * @par Sync (or) Async : Synchronous API
4407 * @param[in] handle pointer to application info handle
4408 * @param[out] nodisplay pointer to hold package nodisplay value
4409 * @return 0 if success, error code(<0) if fail
4410 * @retval PMINFO_R_OK success
4411 * @retval PMINFO_R_EINVAL invalid argument
4412 * @retval PMINFO_R_ERROR internal error
4413 * @pre pkgmgrinfo_appinfo_get_appinfo()
4414 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4415 * @see pkgmgrinfo_appinfo_get_appid()
4416 * @see pkgmgrinfo_appinfo_is_multiple()
4418 static int get_app_nodisplay(const char *appid)
4422 pkgmgrinfo_appinfo_h handle;
4423 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4424 if (ret != PMINFO_R_OK)
4426 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4427 if (ret != PMINFO_R_OK) {
4428 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4431 printf("app nodisplay: %d\n", nodisplay);
4432 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4437 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4440 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4441 * @brief This API gets the application 'multiple' value from the app ID
4443 * @par This API is for package-manager client application
4444 * @par Sync (or) Async : Synchronous API
4446 * @param[in] handle pointer to application info handle
4447 * @param[out] multiple pointer to hold package multiple value
4448 * @return 0 if success, error code(<0) if fail
4449 * @retval PMINFO_R_OK success
4450 * @retval PMINFO_R_EINVAL invalid argument
4451 * @retval PMINFO_R_ERROR internal error
4452 * @pre pkgmgrinfo_appinfo_get_appinfo()
4453 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4454 * @see pkgmgrinfo_appinfo_get_appid()
4455 * @see pkgmgrinfo_appinfo_is_nodisplay()
4457 static int get_app_multiple(const char *appid)
4461 pkgmgrinfo_appinfo_h handle;
4462 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4463 if (ret != PMINFO_R_OK)
4465 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4466 if (ret != PMINFO_R_OK) {
4467 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4470 printf("app multiple: %d\n", multiple);
4471 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4476 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4479 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4480 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4481 * application launching effect. If fales, indicator will be hidden during application launching effect
4483 * @par This API is for package-manager client application
4484 * @par Sync (or) Async : Synchronous API
4486 * @param[in] handle pointer to application info handle
4487 * @param[out] indicator_disp contains indicator display status for application launching effect
4488 * @return 0 if success, error code(<0) if fail
4489 * @retval PMINFO_R_OK success
4490 * @retval PMINFO_R_EINVAL invalid argument
4491 * @retval PMINFO_R_ERROR internal error
4492 * @pre pkgmgrinfo_appinfo_get_appinfo()
4493 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4494 * @see pkgmgrinfo_appinfo_get_appid()
4495 * @see pkgmgrinfo_appinfo_is_nodisplay()
4497 static int get_app_indicator_display(const char *appid)
4500 bool indicator_disp;
4501 pkgmgrinfo_appinfo_h handle;
4502 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4503 if (ret != PMINFO_R_OK)
4505 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4506 if (ret != PMINFO_R_OK){
4507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4510 printf("app indicator disp : %d\n", indicator_disp);
4511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4516 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4519 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4520 * @brief This API gets the application 'taskmanage' value from the app ID
4522 * @par This API is for package-manager client application
4523 * @par Sync (or) Async : Synchronous API
4525 * @param[in] handle pointer to application info handle
4526 * @param[out] taskmanage pointer to hold package taskmanage value
4527 * @return 0 if success, error code(<0) if fail
4528 * @retval PMINFO_R_OK success
4529 * @retval PMINFO_R_EINVAL invalid argument
4530 * @retval PMINFO_R_ERROR internal error
4531 * @pre pkgmgrinfo_appinfo_get_appinfo()
4532 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4533 * @see pkgmgrinfo_appinfo_get_appid()
4534 * @see pkgmgrinfo_appinfo_is_multiple()
4536 static int get_app_taskmanage(const char *appid)
4540 pkgmgrinfo_appinfo_h handle;
4541 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4542 if (ret != PMINFO_R_OK)
4544 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4545 if (ret != PMINFO_R_OK) {
4546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4549 printf("app taskmanage: %d\n", taskmanage);
4550 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4555 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4558 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4559 * @brief This API gets the application 'taskmanage' value from the app ID
4561 * @par This API is for package-manager client application
4562 * @par Sync (or) Async : Synchronous API
4564 * @param[in] handle pointer to application info handle
4565 * @param[out] enabled pointer to hold package enabled value
4566 * @return 0 if success, error code(<0) if fail
4567 * @retval PMINFO_R_OK success
4568 * @retval PMINFO_R_EINVAL invalid argument
4569 * @retval PMINFO_R_ERROR internal error
4570 * @pre pkgmgrinfo_appinfo_get_appinfo()
4571 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4572 * @see pkgmgrinfo_appinfo_get_appid()
4573 * @see pkgmgrinfo_appinfo_is_multiple()
4575 static int get_app_enabled(const char *appid)
4579 pkgmgrinfo_appinfo_h handle;
4580 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4581 if (ret != PMINFO_R_OK)
4583 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4584 if (ret != PMINFO_R_OK) {
4585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4588 printf("app enabled: %d\n", enabled);
4589 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4594 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4597 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4598 * @brief This API gets the application 'onboot' value from the app ID
4600 * @par This API is for package-manager client application
4601 * @par Sync (or) Async : Synchronous API
4603 * @param[in] handle pointer to application info handle
4604 * @param[out] onboot pointer to hold package onboot value
4605 * @return 0 if success, error code(<0) if fail
4606 * @retval PMINFO_R_OK success
4607 * @retval PMINFO_R_EINVAL invalid argument
4608 * @retval PMINFO_R_ERROR internal error
4609 * @pre pkgmgrinfo_appinfo_get_appinfo()
4610 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4611 * @see pkgmgrinfo_appinfo_get_appid()
4612 * @see pkgmgrinfo_appinfo_is_multiple()
4614 static int get_app_onboot(const char *appid)
4618 pkgmgrinfo_appinfo_h handle;
4619 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4620 if (ret != PMINFO_R_OK)
4622 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4623 if (ret != PMINFO_R_OK) {
4624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4627 printf("app onboot: %d\n", onboot);
4628 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4633 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4636 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4637 * @brief This API gets the application 'autorestart' value from the app ID
4639 * @par This API is for package-manager client application
4640 * @par Sync (or) Async : Synchronous API
4642 * @param[in] handle pointer to application info handle
4643 * @param[out] autorestart pointer to hold package autorestart value
4644 * @return 0 if success, error code(<0) if fail
4645 * @retval PMINFO_R_OK success
4646 * @retval PMINFO_R_EINVAL invalid argument
4647 * @retval PMINFO_R_ERROR internal error
4648 * @pre pkgmgrinfo_appinfo_get_appinfo()
4649 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4650 * @see pkgmgrinfo_appinfo_get_appid()
4651 * @see pkgmgrinfo_appinfo_is_multiple()
4653 static int get_app_autorestart(const char *appid)
4657 pkgmgrinfo_appinfo_h handle;
4658 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4659 if (ret != PMINFO_R_OK)
4661 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4662 if (ret != PMINFO_R_OK) {
4663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4666 printf("app autorestart: %d\n", autorestart);
4667 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4672 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4675 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4676 * @brief This API gets the value for given application is main app or not from handle
4678 * @par This API is for package-manager client application
4679 * @par Sync (or) Async : Synchronous API
4681 * @param[in] handle pointer to application info handle
4682 * @param[out] mainapp pointer to hold package mainapp is or not
4683 * @return 0 if success, error code(<0) if fail
4684 * @retval PMINFO_R_OK success
4685 * @retval PMINFO_R_EINVAL invalid argument
4686 * @retval PMINFO_R_ERROR internal error
4687 * @pre pkgmgrinfo_appinfo_get_appinfo()
4688 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4689 * @see pkgmgrinfo_appinfo_get_appid()
4690 * @see pkgmgrinfo_appinfo_is_multiple()
4692 static int get_app_mainapp(const char *appid)
4696 pkgmgrinfo_appinfo_h handle;
4697 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4698 if (ret != PMINFO_R_OK)
4700 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4701 if (ret != PMINFO_R_OK) {
4702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4705 printf("mainapp: %d\n", mainapp);
4706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4711 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4715 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4716 * @brief This API gets the value for given application is preload or not from handle
4718 * @par This API is for package-manager client application
4719 * @par Sync (or) Async : Synchronous API
4721 * @param[in] handle pointer to application info handle
4722 * @param[out] preload pointer to hold preload is or not
4723 * @return 0 if success, error code(<0) if fail
4724 * @retval PMINFO_R_OK success
4725 * @retval PMINFO_R_EINVAL invalid argument
4726 * @retval PMINFO_R_ERROR internal error
4727 * @pre pkgmgrinfo_appinfo_get_appinfo()
4728 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4729 * @see pkgmgrinfo_appinfo_get_appid()
4730 * @see pkgmgrinfo_appinfo_is_multiple()
4732 static int get_app_preload(const char *appid)
4736 pkgmgrinfo_appinfo_h handle = NULL;
4737 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4738 if (ret != PMINFO_R_OK)
4740 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4741 if (ret != PMINFO_R_OK) {
4742 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4745 printf("preload: %d\n", preload);
4746 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4751 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4754 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4755 * @brief This API gets the value for given application is submode or not from handle
4757 * @par This API is for package-manager client application
4758 * @par Sync (or) Async : Synchronous API
4760 * @param[in] handle pointer to application info handle
4761 * @param[out] submode pointer to hold submode is or not
4762 * @return 0 if success, error code(<0) if fail
4763 * @retval PMINFO_R_OK success
4764 * @retval PMINFO_R_EINVAL invalid argument
4765 * @retval PMINFO_R_ERROR internal error
4766 * @pre pkgmgrinfo_appinfo_get_appinfo()
4767 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4768 * @see pkgmgrinfo_appinfo_get_appid()
4769 * @see pkgmgrinfo_appinfo_is_multiple()
4771 static int get_app_submode(const char *appid)
4775 pkgmgrinfo_appinfo_h handle = NULL;
4776 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4777 if (ret != PMINFO_R_OK)
4779 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4780 if (ret != PMINFO_R_OK) {
4781 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4784 printf("submode: %d\n", submode);
4785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4790 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4793 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4794 * @brief This API gets the value for given application is process_pool or not from handle
4796 * @par This API is for package-manager client application
4797 * @par Sync (or) Async : Synchronous API
4799 * @param[in] handle pointer to application info handle
4800 * @param[out] process_pool pointer to hold process_pool is or not
4801 * @return 0 if success, error code(<0) if fail
4802 * @retval PMINFO_R_OK success
4803 * @retval PMINFO_R_EINVAL invalid argument
4804 * @retval PMINFO_R_ERROR internal error
4805 * @pre pkgmgrinfo_appinfo_get_appinfo()
4806 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4807 * @see pkgmgrinfo_appinfo_get_appid()
4809 static int get_app_process_pool(const char *appid)
4812 bool process_pool = 0;
4813 pkgmgrinfo_appinfo_h handle = NULL;
4814 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4815 if (ret != PMINFO_R_OK)
4817 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4818 if (ret != PMINFO_R_OK) {
4819 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4822 printf("process_pool: %d\n", process_pool);
4823 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4828 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4831 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4832 * @brief This API gets the installed storage location of the application
4834 * @par This API is for package-manager client application
4835 * @par Sync (or) Async : Synchronous API
4837 * @param[in] handle pointer to the application info handle.
4838 * @param[out] app_type pointer to hold installed storage location
4839 * @return 0 if success, error code(<0) if fail
4840 * @retval PMINFO_R_OK success
4841 * @retval PMINFO_R_EINVAL invalid argument
4842 * @retval PMINFO_R_ERROR internal error
4843 * @pre pkgmgrinfo_appinfo_get_appinfo()
4844 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4845 * @see pkgmgrinfo_appinfo_get_appid()
4847 static int get_app_installed_location(const char *appid)
4850 pkgmgrinfo_installed_storage storage;
4851 pkgmgrinfo_appinfo_h handle = NULL;
4852 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4853 if (ret != PMINFO_R_OK)
4855 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4856 if (ret != PMINFO_R_OK) {
4857 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4860 printf("Installed storage location : %d\n", storage);
4861 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4866 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4870 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4871 * @brief This API checks if the application has the given category
4873 * @par This API is for package-manager client application
4874 * @par Sync (or) Async : Synchronous API
4876 * @param[in] handle pointer to the application info handle
4877 * @param[in] category category
4878 * @param[out] exist value Gets whether the application has the given category
4879 * @return 0 if success, error code(<0) if fail
4880 * @retval PMINFO_R_OK success
4881 * @retval PMINFO_R_EINVAL invalid argument
4882 * @retval PMINFO_R_ERROR internal error
4884 static int is_category_exist(const char *appid, const char *category)
4887 pkgmgrinfo_appinfo_h handle;
4890 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4891 if (ret != PMINFO_R_OK)
4894 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4895 if (ret != PMINFO_R_OK) {
4896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4900 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4905 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4908 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4909 * @brief This API gets the application 'ui_gadget' value from the app ID
4911 * @par This API is for package-manager client application
4912 * @par Sync (or) Async : Synchronous API
4914 * @param[in] handle pointer to application info handle
4915 * @param[out] ui_gadget pointer to hold package ui_gadget value
4916 * @return 0 if success, error code(<0) if fail
4917 * @retval PMINFO_R_OK success
4918 * @retval PMINFO_R_EINVAL invalid argument
4919 * @pre pkgmgrinfo_appinfo_get_appinfo()
4920 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4922 static int get_app_ui_gadget(const char *appid)
4926 pkgmgrinfo_appinfo_h handle = NULL;
4927 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4928 if (ret != PMINFO_R_OK)
4930 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4931 if (ret != PMINFO_R_OK) {
4932 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4935 printf("app ui_gadget: %d\n", ui_gadget);
4936 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4941 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4944 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4945 * @brief This API gets the application 'support_disable' value from the app ID
4947 * @par This API is for package-manager client application
4948 * @par Sync (or) Async : Synchronous API
4950 * @param[in] handle pointer to application info handle
4951 * @param[out] support_disable pointer to hold package support_disable value
4952 * @return 0 if success, error code(<0) if fail
4953 * @retval PMINFO_R_OK success
4954 * @retval PMINFO_R_EINVAL invalid argument
4955 * @pre pkgmgrinfo_appinfo_get_appinfo()
4956 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4958 static int get_app_support_disable(const char *appid)
4961 bool support_disable;
4962 pkgmgrinfo_appinfo_h handle = NULL;
4963 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4964 if (ret != PMINFO_R_OK)
4966 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4967 if (ret != PMINFO_R_OK) {
4968 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4971 printf("app support_disable: %d\n", support_disable);
4972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4977 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4980 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4981 * @brief This API gets the application 'removable' value from the app ID
4983 * @par This API is for package-manager client application
4984 * @par Sync (or) Async : Synchronous API
4986 * @param[in] handle pointer to application info handle
4987 * @param[out] removable pointer to hold package removable value
4988 * @return 0 if success, error code(<0) if fail
4989 * @retval PMINFO_R_OK success
4990 * @retval PMINFO_R_EINVAL invalid argument
4991 * @retval PMINFO_R_ERROR internal error
4992 * @pre pkgmgrinfo_appinfo_get_appinfo()
4993 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4994 * @see pkgmgrinfo_appinfo_get_appid()
4996 static int get_app_removable(const char *appid)
5000 pkgmgrinfo_appinfo_h handle = NULL;
5001 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5002 if (ret != PMINFO_R_OK)
5004 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5005 if (ret != PMINFO_R_OK) {
5006 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5009 printf("app removable: %d\n", removable);
5010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5015 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5018 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5019 * @brief This API gets the application 'system' value from the app ID
5021 * @par This API is for package-manager client application
5022 * @par Sync (or) Async : Synchronous API
5024 * @param[in] handle pointer to application info handle
5025 * @param[out] system pointer to hold package system value
5026 * @return 0 if success, error code(<0) if fail
5027 * @retval PMINFO_R_OK success
5028 * @retval PMINFO_R_EINVAL invalid argument
5029 * @retval PMINFO_R_ERROR internal error
5030 * @pre pkgmgrinfo_appinfo_get_appinfo()
5031 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5032 * @see pkgmgrinfo_appinfo_get_appid()
5034 static int get_app_system(const char *appid)
5037 bool system = false;
5038 pkgmgrinfo_appinfo_h handle = NULL;
5039 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5040 if (ret != PMINFO_R_OK)
5042 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5043 if (ret != PMINFO_R_OK) {
5044 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5047 printf("app system: %d\n", system);
5048 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5053 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5057 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5058 * @brief This API gets the application 'is_disable' value from the app ID
5060 * @par This API is for package-manager client application
5061 * @par Sync (or) Async : Synchronous API
5063 * @param[in] handle pointer to application info handle
5064 * @param[out] disabled pointer to hold application is_disabled value
5065 * @return 0 if success, error code(<0) if fail
5066 * @retval PMINFO_R_OK success
5067 * @retval PMINFO_R_EINVAL invalid argument
5068 * @pre pkgmgrinfo_appinfo_get_appinfo()
5069 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5071 static int get_app_is_disable(const char *appid)
5075 pkgmgrinfo_appinfo_h handle = NULL;
5076 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5077 if (ret != PMINFO_R_OK)
5079 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5080 if (ret != PMINFO_R_OK) {
5081 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5084 printf("app is_disable: %d\n", is_disable);
5085 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5090 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5093 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5094 * @brief This API gets whethere the given application is global application or user application
5096 * @par This API is for package-manager client application
5097 * @par Sync (or) Async : Synchronous API
5099 * @param[in] handle pointer to application info handle
5100 * @param[in] global pointer to hold application global value
5101 * @return 0 if success, error code(<0) if fail
5102 * @retval PMINFO_R_OK success
5103 * @retval PMINFO_R_EINVAL invalid argument
5104 * @retval PMINFO_R_ERROR internal error
5105 * @pre pkgmgrinfo_appinfo_get_appinfo()
5106 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5107 * @see pkgmgrinfo_appinfo_get_appid()
5108 static int get_app_is_global(const char *appid)
5112 pkgmgrinfo_appinfo_h handle = NULL;
5113 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5114 if (ret != PMINFO_R_OK)
5116 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5117 if (ret != PMINFO_R_OK) {
5118 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5121 printf("app is_global: %d\n", global);
5122 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5127 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5130 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5131 * @brief This API gets the application 'splash_screen_display' value from the app ID
5133 * @par This API is for package-manager client application
5134 * @par Sync (or) Async : Synchronous API
5136 * @param[in] handle pointer to application info handle
5137 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5138 * @return 0 if success, error code(<0) if fail
5139 * @retval PMINFO_R_OK success
5140 * @retval PMINFO_R_EINVAL invalid argument
5141 * @retval PMINFO_R_ERROR internal error
5143 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5146 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5147 * @brief This API gets the application 'setup_appid' value from the app ID
5149 * @par This API is for package-manager client application
5150 * @par Sync (or) Async : Synchronous API
5152 * @param[in] handle pointer to application info handle
5153 * @param[out] setup_appid pointer to hold package setup_appid value
5154 * @return 0 if success, error code(<0) if fail
5155 * @retval PMINFO_R_OK success
5156 * @retval PMINFO_R_EINVAL invalid argument
5157 * @retval PMINFO_R_ERROR internal error
5159 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5162 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5163 * @brief This API gets the application 'support_ambient' value from the app ID
5165 * @par This API is for package-manager client application
5166 * @par Sync (or) Async : Synchronous API
5168 * @param[in] handle pointer to application info handle
5169 * @param[out] support_ambient pointer to hold package support_ambient value
5170 * @return 0 if success, error code(<0) if fail
5171 * @retval PMINFO_R_OK success
5172 * @retval PMINFO_R_EINVAL invalid argument
5173 * @retval PMINFO_R_ERROR internal error
5175 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5178 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5179 * @brief This API destroys the application information handle freeing up all the resources
5181 * @par This API is for package-manager client application
5182 * @par Sync (or) Async : Synchronous API
5184 * @param[in] handle pointer to the application info handle.
5185 * @return 0 if success, error code(<0) if fail
5186 * @retval PMINFO_R_OK success
5187 * @retval PMINFO_R_EINVAL invalid argument
5188 * @retval PMINFO_R_ERROR internal error
5189 * @pre pkgmgrinfo_appinfo_get_appinfo()
5191 * @see pkgmgrinfo_appinfo_get_pkgid()
5192 * @see pkgmgrinfo_appinfo_is_multiple()
5194 static int get_app_type(const char *appid)
5198 pkgmgrinfo_appinfo_h handle;
5199 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5200 if (ret != PMINFO_R_OK)
5202 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5203 if (ret != PMINFO_R_OK) {
5204 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5207 printf("apptype: %s\n", type);
5208 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5213 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5216 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5217 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5218 The query will search the entire application information collected from the manifest file of all the installed packages
5220 * @par This API is for package-manager client application
5221 * @par Sync (or) Async : Synchronous API
5223 * @param[out] handle pointer to the application info filter handle.
5224 * @return 0 if success, error code(<0) if fail
5225 * @retval PMINFO_R_OK success
5226 * @retval PMINFO_R_EINVAL invalid argument
5227 * @retval PMINFO_R_ERROR internal error
5229 * @post pkgmgrinfo_appinfo_filter_destroy()
5230 * @see pkgmgrinfo_appinfo_filter_count()
5231 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5233 static int get_capp_count()
5237 pkgmgrinfo_appinfo_filter_h handle;
5238 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5239 if (ret != PMINFO_R_OK)
5241 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5242 if (ret != PMINFO_R_OK) {
5243 pkgmgrinfo_appinfo_filter_destroy(handle);
5246 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5247 if (ret != PMINFO_R_OK) {
5248 pkgmgrinfo_appinfo_filter_destroy(handle);
5251 printf("No of capp: %d\n", count);
5252 pkgmgrinfo_appinfo_filter_destroy(handle);
5257 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5260 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5261 * @brief This API destroys the application information filter handle freeing up all the resources
5263 * @par This API is for package-manager client application
5264 * @par Sync (or) Async : Synchronous API
5266 * @param[in] handle pointer to the application info filter handle.
5267 * @return 0 if success, error code(<0) if fail
5268 * @retval PMINFO_R_OK success
5269 * @retval PMINFO_R_EINVAL invalid argument
5270 * @retval PMINFO_R_ERROR internal error
5271 * @pre pkgmgrinfo_appinfo_filter_create()
5273 * @see pkgmgrinfo_appinfo_filter_count()
5274 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5276 static int get_capp_count()
5280 pkgmgrinfo_appinfo_filter_h handle;
5281 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5282 if (ret != PMINFO_R_OK)
5284 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5285 if (ret != PMINFO_R_OK) {
5286 pkgmgrinfo_appinfo_filter_destroy(handle);
5289 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5290 if (ret != PMINFO_R_OK) {
5291 pkgmgrinfo_appinfo_filter_destroy(handle);
5294 printf("No of capp: %d\n", count);
5295 pkgmgrinfo_appinfo_filter_destroy(handle);
5300 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5303 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5304 * @brief This API adds a boolean filter property to the filter handle
5306 * @par This API is for package-manager client application
5307 * @par Sync (or) Async : Synchronous API
5309 * @param[in] handle pointer to the application info filter handle.
5310 * @param[in] property boolean property name.
5311 * @param[in] value value corresponding to the property.
5312 * @return 0 if success, error code(<0) if fail
5313 * @retval PMINFO_R_OK success
5314 * @retval PMINFO_R_EINVAL invalid argument
5315 * @retval PMINFO_R_ERROR internal error
5316 * @pre pkgmgrinfo_appinfo_filter_create()
5317 * @post pkgmgrinfo_appinfo_filter_destroy()
5318 * @see pkgmgrinfo_appinfo_filter_count()
5319 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5321 static int get_taskmanageable_app_count()
5325 pkgmgrinfo_appinfo_filter_h handle;
5326 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5327 if (ret != PMINFO_R_OK)
5329 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5330 if (ret != PMINFO_R_OK) {
5331 pkgmgrinfo_appinfo_filter_destroy(handle);
5334 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5335 if (ret != PMINFO_R_OK) {
5336 pkgmgrinfo_appinfo_filter_destroy(handle);
5339 printf("No of taskmanageable apps: %d\n", count);
5340 pkgmgrinfo_appinfo_filter_destroy(handle);
5345 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5346 const char *property, const bool value);
5349 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5350 * @brief This API adds an integer filter property to the filter handle
5352 * @par This API is for package-manager client application
5353 * @par Sync (or) Async : Synchronous API
5355 * @param[in] handle pointer to the application info filter handle.
5356 * @param[in] property integer property name.
5357 * @param[in] value value corresponding to the property.
5358 * @return 0 if success, error code(<0) if fail
5359 * @retval PMINFO_R_OK success
5360 * @retval PMINFO_R_EINVAL invalid argument
5361 * @retval PMINFO_R_ERROR internal error
5362 * @pre pkgmgrinfo_appinfo_filter_create()
5363 * @post pkgmgrinfo_appinfo_filter_destroy()
5364 * @see pkgmgrinfo_appinfo_filter_count()
5365 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5367 static int get_taskmanageable_app_count()
5371 pkgmgrinfo_appinfo_filter_h handle;
5372 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5373 if (ret != PMINFO_R_OK)
5375 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5376 if (ret != PMINFO_R_OK) {
5377 pkgmgrinfo_appinfo_filter_destroy(handle);
5380 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5381 if (ret != PMINFO_R_OK) {
5382 pkgmgrinfo_appinfo_filter_destroy(handle);
5385 printf("No of apps: %d\n", count);
5386 pkgmgrinfo_appinfo_filter_destroy(handle);
5391 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5392 const char *property, const int value);
5395 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5396 * @brief This API adds a string filter property to the filter handle
5398 * @par This API is for package-manager client application
5399 * @par Sync (or) Async : Synchronous API
5401 * @param[in] handle pointer to the application info filter handle.
5402 * @param[in] property string property name.
5403 * @param[in] value value corresponding to the property.
5404 * @return 0 if success, error code(<0) if fail
5405 * @retval PMINFO_R_OK success
5406 * @retval PMINFO_R_EINVAL invalid argument
5407 * @retval PMINFO_R_ERROR internal error
5408 * @pre pkgmgrinfo_appinfo_filter_create()
5409 * @post pkgmgrinfo_appinfo_filter_destroy()
5410 * @see pkgmgrinfo_appinfo_filter_count()
5411 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5413 static int get_capp_count()
5417 pkgmgrinfo_appinfo_filter_h handle;
5418 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5419 if (ret != PMINFO_R_OK)
5421 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5422 if (ret != PMINFO_R_OK) {
5423 pkgmgrinfo_appinfo_filter_destroy(handle);
5426 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5427 if (ret != PMINFO_R_OK) {
5428 pkgmgrinfo_appinfo_filter_destroy(handle);
5431 printf("No of capp: %d\n", count);
5432 pkgmgrinfo_appinfo_filter_destroy(handle);
5437 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5438 const char *property, const char *value);
5441 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5442 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5444 * @par This API is for package-manager client application
5445 * @par Sync (or) Async : Synchronous API
5447 * @param[in] handle pointer to the application info filter handle.
5448 * @param[in] app_cb callback function.
5449 * @param[in] user_data user data to be passed to the callback function
5450 * @return 0 if success, error code(<0) if fail
5451 * @retval PMINFO_R_OK success
5452 * @retval PMINFO_R_EINVAL invalid argument
5453 * @retval PMINFO_R_ERROR internal error
5454 * @pre pkgmgrinfo_appinfo_filter_create()
5455 * @post pkgmgrinfo_appinfo_filter_destroy()
5456 * @see pkgmgrinfo_appinfo_filter_count()
5458 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5461 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5462 printf("appid : %s\n", appid);
5466 static int get_capp_list()
5469 pkgmgrinfo_appinfo_filter_h handle;
5470 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5471 if (ret != PMINFO_R_OK)
5473 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5474 if (ret != PMINFO_R_OK) {
5475 pkgmgrinfo_appinfo_filter_destroy(handle);
5478 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5479 if (ret != PMINFO_R_OK) {
5480 pkgmgrinfo_appinfo_filter_destroy(handle);
5483 pkgmgrinfo_appinfo_filter_destroy(handle);
5488 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5489 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5490 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5491 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5494 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5495 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5496 * @brief This API counts the application that satisfy the filter conditions
5498 * @par This API is for package-manager client application
5499 * @par Sync (or) Async : Synchronous API
5501 * @param[in] handle pointer to the application info filter handle.
5502 * @param[in] count pointer to store count value
5503 * @param[in] uid the addressee user id of the instruction
5504 * @return 0 if success, error code(<0) if fail
5505 * @retval PMINFO_R_OK success
5506 * @retval PMINFO_R_EINVAL invalid argument
5507 * @retval PMINFO_R_ERROR internal error
5508 * @pre pkgmgrinfo_appinfo_filter_create()
5509 * @post pkgmgrinfo_appinfo_filter_destroy()
5510 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5512 static int get_capp_count()
5516 pkgmgrinfo_appinfo_filter_h handle;
5517 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5518 if (ret != PMINFO_R_OK)
5520 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5521 if (ret != PMINFO_R_OK) {
5522 pkgmgrinfo_appinfo_filter_destroy(handle);
5525 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5526 if (ret != PMINFO_R_OK) {
5527 pkgmgrinfo_appinfo_filter_destroy(handle);
5530 printf("No of capp: %d\n", count);
5531 pkgmgrinfo_appinfo_filter_destroy(handle);
5536 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5537 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5539 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5540 * @brief This API creates the application's metadata information filter handle from db.
5542 * @par This API is for package-manager client application
5543 * @par Sync (or) Async : Synchronous API
5545 * @param[out] handle pointer to the application metadata info filter handle.
5546 * @return 0 if success, error code(<0) if fail
5547 * @retval PMINFO_R_OK success
5548 * @retval PMINFO_R_EINVAL invalid argument
5549 * @retval PMINFO_R_ERROR internal error
5551 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5552 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5554 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5557 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5558 printf("appid : %s\n", appid);
5562 static int get_app_list(const char *mkey, const char *mvalue)
5565 pkgmgrinfo_appinfo_metadata_filter_h handle;
5566 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5567 if (ret != PMINFO_R_OK)
5569 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5570 if (ret != PMINFO_R_OK) {
5571 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5574 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5575 if (ret != PMINFO_R_OK) {
5576 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5579 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5584 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5587 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5588 * @brief This API destroys the application's metadata information filter handle.
5590 * @par This API is for package-manager client application
5591 * @par Sync (or) Async : Synchronous API
5593 * @param[in] handle pointer to the application metadata info filter handle.
5594 * @return 0 if success, error code(<0) if fail
5595 * @retval PMINFO_R_OK success
5596 * @retval PMINFO_R_EINVAL invalid argument
5597 * @retval PMINFO_R_ERROR internal error
5598 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5600 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5602 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5605 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5606 printf("appid : %s\n", appid);
5610 static int get_app_list(const char *mkey, const char *mvalue)
5613 pkgmgrinfo_appinfo_metadata_filter_h handle;
5614 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5615 if (ret != PMINFO_R_OK)
5617 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5618 if (ret != PMINFO_R_OK) {
5619 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5622 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5623 if (ret != PMINFO_R_OK) {
5624 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5627 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5632 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5635 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5636 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5637 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5639 * @par This API is for package-manager client application
5640 * @par Sync (or) Async : Synchronous API
5642 * @param[in] handle pointer to the application metadata info filter handle.
5643 * @param[in] key pointer to metadata key
5644 * @param[in] value pointer to metadata value
5645 * @return 0 if success, error code(<0) if fail
5646 * @retval PMINFO_R_OK success
5647 * @retval PMINFO_R_EINVAL invalid argument
5648 * @retval PMINFO_R_ERROR internal error
5649 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5650 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5651 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5653 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5656 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5657 printf("appid : %s\n", appid);
5661 static int get_app_list(const char *mkey, const char *mvalue)
5664 pkgmgrinfo_appinfo_metadata_filter_h handle;
5665 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5666 if (ret != PMINFO_R_OK)
5668 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5669 if (ret != PMINFO_R_OK) {
5670 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5673 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5674 if (ret != PMINFO_R_OK) {
5675 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5678 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5683 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5684 const char *key, const char *value);
5687 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5688 * @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)
5689 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5690 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5691 * negative value, no more callbacks will be called and API will return.
5693 * @par This API is for package-manager client application
5694 * @par Sync (or) Async : Synchronous API
5696 * @param[in] handle pointer to the application metadata info filter handle.
5697 * @param[in] app_cb function pointer to callback
5698 * @param[in] user_data pointer to user data
5699 * @param[in] uid the addressee user id of the instruction
5700 * @return 0 if success, error code(<0) if fail
5701 * @retval PMINFO_R_OK success
5702 * @retval PMINFO_R_EINVAL invalid argument
5703 * @retval PMINFO_R_ERROR internal error
5704 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5705 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5707 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5710 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5711 printf("appid : %s\n", appid);
5715 static int get_app_list(const char *mkey, const char *mvalue)
5718 pkgmgrinfo_appinfo_metadata_filter_h handle;
5719 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5720 if (ret != PMINFO_R_OK)
5722 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5723 if (ret != PMINFO_R_OK) {
5724 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5727 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5728 if (ret != PMINFO_R_OK) {
5729 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5732 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5737 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5738 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5739 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5740 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5742 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5743 * @brief This API creates the package cert information handle to get data from db.
5745 * @par This API is for package-manager client application
5746 * @par Sync (or) Async : Synchronous API
5748 * @param[out] handle pointer to the package cert handle.
5749 * @return 0 if success, error code(<0) if fail
5750 * @retval PMINFO_R_OK success
5751 * @retval PMINFO_R_EINVAL invalid argument
5752 * @retval PMINFO_R_ERROR internal error
5754 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5755 * @see pkgmgrinfo_pkginfo_get_cert_value()
5756 * @see pkgmgrinfo_pkginfo_load_certinfo()
5758 static int get_cert_info(const char *pkgid)
5761 pkgmgrinfo_certinfo_h handle;
5762 char *auth_cert = NULL;
5763 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5764 if (ret != PMINFO_R_OK)
5766 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5767 if (ret != PMINFO_R_OK) {
5768 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5771 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5772 if (ret != PMINFO_R_OK) {
5773 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5776 printf("Author root certificate: %s\n", auth_root);
5777 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5782 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5785 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5786 * @brief This API loads the package cert information handle with data from db.
5788 * @par This API is for package-manager client application
5789 * @par Sync (or) Async : Synchronous API
5791 * @param[in] pkgid pointer to the package ID.
5792 * @param[in] handle pointer to the package cert handle.
5793 * @return 0 if success, error code(<0) if fail
5794 * @retval PMINFO_R_OK success
5795 * @retval PMINFO_R_EINVAL invalid argument
5796 * @retval PMINFO_R_ERROR internal error
5797 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5798 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5799 * @see pkgmgrinfo_pkginfo_get_cert_value()
5801 static int get_cert_info(const char *pkgid)
5804 pkgmgrinfo_certinfo_h handle;
5805 char *auth_cert = NULL;
5806 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5807 if (ret != PMINFO_R_OK)
5809 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5810 if (ret != PMINFO_R_OK) {
5811 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5814 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5815 if (ret != PMINFO_R_OK) {
5816 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5819 printf("Author root certificate: %s\n", auth_root);
5820 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5825 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5828 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5829 * @brief This API gets the package cert information from the handle
5831 * @par This API is for package-manager client application
5832 * @par Sync (or) Async : Synchronous API
5834 * @param[in] handle pointer to the package cert handle.
5835 * @param[in] cert_type certificate type
5836 * @param[out] cert_value pointer to hold certificate value
5837 * @return 0 if success, error code(<0) if fail
5838 * @retval PMINFO_R_OK success
5839 * @retval PMINFO_R_EINVAL invalid argument
5840 * @retval PMINFO_R_ERROR internal error
5841 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5842 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5843 * @see pkgmgrinfo_pkginfo_load_certinfo()
5845 static int get_cert_info(const char *pkgid)
5848 pkgmgrinfo_certinfo_h handle;
5849 char *auth_cert = NULL;
5850 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5851 if (ret != PMINFO_R_OK)
5853 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5854 if (ret != PMINFO_R_OK) {
5855 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5858 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5859 if (ret != PMINFO_R_OK) {
5860 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5863 printf("Author root certificate: %s\n", auth_root);
5864 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5869 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5872 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5873 * @brief This API destroys the package cert information handle freeing up all the resources
5875 * @par This API is for package-manager client application
5876 * @par Sync (or) Async : Synchronous API
5878 * @param[in] handle pointer to the package cert handle.
5879 * @return 0 if success, error code(<0) if fail
5880 * @retval PMINFO_R_OK success
5881 * @retval PMINFO_R_EINVAL invalid argument
5882 * @retval PMINFO_R_ERROR internal error
5883 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5885 * @see pkgmgrinfo_pkginfo_load_certinfo()
5887 static int get_cert_info(const char *pkgid)
5890 pkgmgrinfo_certinfo_h handle;
5891 char *auth_cert = NULL;
5892 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5893 if (ret != PMINFO_R_OK)
5895 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5896 if (ret != PMINFO_R_OK) {
5897 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5900 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5901 if (ret != PMINFO_R_OK) {
5902 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5905 printf("Author root certificate: %s\n", auth_root);
5906 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5911 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5914 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5915 * @brief This API deletes the package cert information from DB
5917 * @par This API is for package-manager client application
5918 * @par Sync (or) Async : Synchronous API
5920 * @param[in] pkgid pointer to the package ID.
5921 * @return 0 if success, error code(<0) if fail
5922 * @retval PMINFO_R_OK success
5923 * @retval PMINFO_R_EINVAL invalid argument
5924 * @retval PMINFO_R_ERROR internal error
5928 static int delete_cert_info(const char *pkgid)
5931 ret = pkgmgrinfo_delete_certinfo(pkgid);
5932 if (ret != PMINFO_R_OK)
5938 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5939 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5942 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5943 * @brief This API creates the package cert information handle to set data in db.
5945 * @par This API is for package-manager client application
5946 * @par Sync (or) Async : Synchronous API
5948 * @param[out] handle pointer to the package cert handle.
5949 * @return 0 if success, error code(<0) if fail
5950 * @retval PMINFO_R_OK success
5951 * @retval PMINFO_R_EINVAL invalid argument
5952 * @retval PMINFO_R_ERROR internal error
5954 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5955 * @see pkgmgrinfo_set_cert_value()
5956 * @see pkgmgrinfo_save_certinfo()
5958 static int set_cert_in_db(const char *pkgid)
5961 pkgmgrinfo_instcertinfo_h handle;
5962 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5963 if (ret != PMINFO_R_OK)
5965 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5966 if (ret != PMINFO_R_OK) {
5967 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5970 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5971 if (ret != PMINFO_R_OK) {
5972 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5975 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5980 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5983 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5984 * @brief This API sets the package cert information in the handle.
5986 * @par This API is for package-manager client application
5987 * @par Sync (or) Async : Synchronous API
5989 * @param[in] handle pointer to the package cert handle.
5990 * @param[in] cert_type certificate type.
5991 * @param[in] cert_value certificate value.
5992 * @return 0 if success, error code(<0) if fail
5993 * @retval PMINFO_R_OK success
5994 * @retval PMINFO_R_EINVAL invalid argument
5995 * @retval PMINFO_R_ERROR internal error
5996 * @pre pkgmgrinfo_create_certinfo_set_handle()
5997 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5998 * @see pkgmgrinfo_save_certinfo()
6000 static int set_cert_in_db(const char *pkgid)
6003 pkgmgrinfo_instcertinfo_h handle;
6004 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6005 if (ret != PMINFO_R_OK)
6007 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6008 if (ret != PMINFO_R_OK) {
6009 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6012 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6013 if (ret != PMINFO_R_OK) {
6014 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6017 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6022 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6025 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6026 * @brief This API saves the package cert information in the DB.
6028 * @par This API is for package-manager client application
6029 * @par Sync (or) Async : Synchronous API
6031 * @param[in] pkgid pointer to the package ID.
6032 * @param[in] handle pointer to the package cert handle.
6033 * @return 0 if success, error code(<0) if fail
6034 * @retval PMINFO_R_OK success
6035 * @retval PMINFO_R_EINVAL invalid argument
6036 * @retval PMINFO_R_ERROR internal error
6037 * @pre pkgmgrinfo_create_certinfo_set_handle()
6038 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6039 * @see pkgmgrinfo_save_certinfo()
6041 static int set_cert_in_db(const char *pkgid)
6044 pkgmgrinfo_instcertinfo_h handle;
6045 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6046 if (ret != PMINFO_R_OK)
6048 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6049 if (ret != PMINFO_R_OK) {
6050 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6053 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6054 if (ret != PMINFO_R_OK) {
6055 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6058 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6063 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6066 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6067 * @brief This API destroys the package cert information handle freeing up all the resources.
6069 * @par This API is for package-manager client application
6070 * @par Sync (or) Async : Synchronous API
6072 * @param[in] handle pointer to the package cert handle.
6073 * @return 0 if success, error code(<0) if fail
6074 * @retval PMINFO_R_OK success
6075 * @retval PMINFO_R_EINVAL invalid argument
6076 * @retval PMINFO_R_ERROR internal error
6077 * @pre pkgmgrinfo_create_certinfo_set_handle()
6079 * @see pkgmgrinfo_save_certinfo()
6081 static int set_cert_in_db(const char *pkgid)
6084 pkgmgrinfo_instcertinfo_h handle;
6085 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6086 if (ret != PMINFO_R_OK)
6088 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6089 if (ret != PMINFO_R_OK) {
6090 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6093 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6094 if (ret != PMINFO_R_OK) {
6095 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6098 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6103 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6106 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6107 * @brief This API gets the datacontrol info
6109 * @par This API is for package-manager client application
6110 * @par Sync (or) Async : Synchronous API
6112 * @param[in] providerid pointer to the providerid of dataconltrol.
6113 * @param[in] type pointer to the type of dataconltrol.
6114 * @param[out] appid pointer to hold appid, need to free after using
6115 * @param[out] access pointer to hold access, need to free after using
6116 * @return 0 if success, error code(<0) if fail
6117 * @retval PMINFO_R_OK success
6118 * @retval PMINFO_R_EINVAL invalid argument
6119 * @retval PMINFO_R_ERROR internal error
6122 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6125 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6126 * @brief This API gets the application 'guest mode visibility' value from the DB
6128 * @par This API is for package-manager client application
6129 * @par Sync (or) Async : Synchronous API
6131 * @param[in] handle pointer to application info handle
6132 * @param[out] status pointer to hold app guest mode visibility value
6133 * @return 0 if success, error code(<0) if fail
6134 * @retval PMINFO_R_OK success
6135 * @retval PMINFO_R_EINVAL invalid argument
6136 * @retval PMINFO_R_ERROR internal error
6137 * @pre pkgmgrinfo_appinfo_get_appinfo()
6138 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6139 * @see pkgmgrinfo_appinfo_get_appid()
6140 * @see pkgmgrinfo_appinfo_is_multiple()
6142 static int get_app_guestmode_visibility(const char *appid)
6146 pkgmgrinfo_appinfo_h handle;
6147 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6148 if (ret != PMINFO_R_OK)
6150 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6151 if (ret != PMINFO_R_OK) {
6152 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6155 printf("app guest mode visibility: %d\n", status);
6156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6161 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6164 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6165 * @brief This API sets the package 'installed_storage' value in db
6167 * @par This API is for package-manager client application
6168 * @par Sync (or) Async : Synchronous API
6170 * @param[in] pkgid pointer to the package ID.
6171 * @param[in] location package install location
6172 * @param[in] external_pkg_path image path if pkg has installed at external storage
6173 * @return 0 if success, error code(<0) if fail
6174 * @retval PMINFO_R_OK success
6175 * @retval PMINFO_R_EINVAL invalid argument
6176 * @retval PMINFO_R_ERROR internal error
6178 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6182 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6183 if (ret != PMINFO_R_OK) {
6190 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6191 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6193 /* version compare */
6194 int pkgmgrinfo_compare_package_version(const char *current_version,
6195 const char *target_version, pkgmgrinfo_version_compare_type *res);
6202 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6203 int flag, void *user_data, uid_t uid);
6204 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6205 int flag, void *user_data);
6206 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6207 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6209 int pkgmgrinfo_appinfo_get_installed_list_full(
6210 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6213 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6214 pkgmgrinfo_archiveinfo_h *handle);
6215 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6216 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6217 const char **pkgid);
6218 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6220 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6221 const char **version);
6222 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6223 const char **api_version);
6224 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6225 const char **description);
6226 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6227 const char **label);
6228 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6229 const char **author);
6230 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6231 const unsigned char **icon, size_t *size);
6234 * @pkgmgrinfo client API end
6242 #endif /* __PKG_INFO_H__ */