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);
4373 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4374 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4379 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4380 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4383 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4384 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4385 * @brief This API gets the list of splashscreen for a particular application
4387 * @par This API is for package-manager client application
4388 * @par Sync (or) Async : Synchronous API
4389 * @param[in] handle pointer to the application info handle.
4390 * @param[in] splash_screen_func callback function for list
4391 * @param[in] user_data user data to be passed to callback function
4392 * @return 0 if success, error code(<0) if fail
4393 * @retval PMINFO_R_OK success
4394 * @retval PMINFO_R_EINVAL invalid argument
4395 * @retval PMINFO_R_ERROR internal error
4396 * @pre pkgmgrinfo_appinfo_get_appinfo()
4397 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4400 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4401 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4404 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4405 * @brief This API gets the application 'nodisplay' value from the app ID
4407 * @par This API is for package-manager client application
4408 * @par Sync (or) Async : Synchronous API
4410 * @param[in] handle pointer to application info handle
4411 * @param[out] nodisplay pointer to hold package nodisplay value
4412 * @return 0 if success, error code(<0) if fail
4413 * @retval PMINFO_R_OK success
4414 * @retval PMINFO_R_EINVAL invalid argument
4415 * @retval PMINFO_R_ERROR internal error
4416 * @pre pkgmgrinfo_appinfo_get_appinfo()
4417 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4418 * @see pkgmgrinfo_appinfo_get_appid()
4419 * @see pkgmgrinfo_appinfo_is_multiple()
4421 static int get_app_nodisplay(const char *appid)
4425 pkgmgrinfo_appinfo_h handle;
4426 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4427 if (ret != PMINFO_R_OK)
4429 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4430 if (ret != PMINFO_R_OK) {
4431 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4434 printf("app nodisplay: %d\n", nodisplay);
4435 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4440 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4443 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4444 * @brief This API gets the application 'multiple' value from the app ID
4446 * @par This API is for package-manager client application
4447 * @par Sync (or) Async : Synchronous API
4449 * @param[in] handle pointer to application info handle
4450 * @param[out] multiple pointer to hold package multiple value
4451 * @return 0 if success, error code(<0) if fail
4452 * @retval PMINFO_R_OK success
4453 * @retval PMINFO_R_EINVAL invalid argument
4454 * @retval PMINFO_R_ERROR internal error
4455 * @pre pkgmgrinfo_appinfo_get_appinfo()
4456 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4457 * @see pkgmgrinfo_appinfo_get_appid()
4458 * @see pkgmgrinfo_appinfo_is_nodisplay()
4460 static int get_app_multiple(const char *appid)
4464 pkgmgrinfo_appinfo_h handle;
4465 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4466 if (ret != PMINFO_R_OK)
4468 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4469 if (ret != PMINFO_R_OK) {
4470 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4473 printf("app multiple: %d\n", multiple);
4474 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4479 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4482 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4483 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4484 * application launching effect. If fales, indicator will be hidden during application launching effect
4486 * @par This API is for package-manager client application
4487 * @par Sync (or) Async : Synchronous API
4489 * @param[in] handle pointer to application info handle
4490 * @param[out] indicator_disp contains indicator display status for application launching effect
4491 * @return 0 if success, error code(<0) if fail
4492 * @retval PMINFO_R_OK success
4493 * @retval PMINFO_R_EINVAL invalid argument
4494 * @retval PMINFO_R_ERROR internal error
4495 * @pre pkgmgrinfo_appinfo_get_appinfo()
4496 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4497 * @see pkgmgrinfo_appinfo_get_appid()
4498 * @see pkgmgrinfo_appinfo_is_nodisplay()
4500 static int get_app_indicator_display(const char *appid)
4503 bool indicator_disp;
4504 pkgmgrinfo_appinfo_h handle;
4505 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4506 if (ret != PMINFO_R_OK)
4508 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4509 if (ret != PMINFO_R_OK){
4510 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4513 printf("app indicator disp : %d\n", indicator_disp);
4514 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4519 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4522 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4523 * @brief This API gets the application 'taskmanage' value from the app ID
4525 * @par This API is for package-manager client application
4526 * @par Sync (or) Async : Synchronous API
4528 * @param[in] handle pointer to application info handle
4529 * @param[out] taskmanage pointer to hold package taskmanage value
4530 * @return 0 if success, error code(<0) if fail
4531 * @retval PMINFO_R_OK success
4532 * @retval PMINFO_R_EINVAL invalid argument
4533 * @retval PMINFO_R_ERROR internal error
4534 * @pre pkgmgrinfo_appinfo_get_appinfo()
4535 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4536 * @see pkgmgrinfo_appinfo_get_appid()
4537 * @see pkgmgrinfo_appinfo_is_multiple()
4539 static int get_app_taskmanage(const char *appid)
4543 pkgmgrinfo_appinfo_h handle;
4544 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4545 if (ret != PMINFO_R_OK)
4547 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4548 if (ret != PMINFO_R_OK) {
4549 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4552 printf("app taskmanage: %d\n", taskmanage);
4553 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4558 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4561 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4562 * @brief This API gets the application 'taskmanage' value from the app ID
4564 * @par This API is for package-manager client application
4565 * @par Sync (or) Async : Synchronous API
4567 * @param[in] handle pointer to application info handle
4568 * @param[out] enabled pointer to hold package enabled value
4569 * @return 0 if success, error code(<0) if fail
4570 * @retval PMINFO_R_OK success
4571 * @retval PMINFO_R_EINVAL invalid argument
4572 * @retval PMINFO_R_ERROR internal error
4573 * @pre pkgmgrinfo_appinfo_get_appinfo()
4574 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4575 * @see pkgmgrinfo_appinfo_get_appid()
4576 * @see pkgmgrinfo_appinfo_is_multiple()
4578 static int get_app_enabled(const char *appid)
4582 pkgmgrinfo_appinfo_h handle;
4583 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4584 if (ret != PMINFO_R_OK)
4586 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4587 if (ret != PMINFO_R_OK) {
4588 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4591 printf("app enabled: %d\n", enabled);
4592 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4597 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4600 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4601 * @brief This API gets the application 'onboot' value from the app ID
4603 * @par This API is for package-manager client application
4604 * @par Sync (or) Async : Synchronous API
4606 * @param[in] handle pointer to application info handle
4607 * @param[out] onboot pointer to hold package onboot value
4608 * @return 0 if success, error code(<0) if fail
4609 * @retval PMINFO_R_OK success
4610 * @retval PMINFO_R_EINVAL invalid argument
4611 * @retval PMINFO_R_ERROR internal error
4612 * @pre pkgmgrinfo_appinfo_get_appinfo()
4613 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4614 * @see pkgmgrinfo_appinfo_get_appid()
4615 * @see pkgmgrinfo_appinfo_is_multiple()
4617 static int get_app_onboot(const char *appid)
4621 pkgmgrinfo_appinfo_h handle;
4622 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4623 if (ret != PMINFO_R_OK)
4625 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4626 if (ret != PMINFO_R_OK) {
4627 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4630 printf("app onboot: %d\n", onboot);
4631 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4636 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4639 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4640 * @brief This API gets the application 'autorestart' value from the app ID
4642 * @par This API is for package-manager client application
4643 * @par Sync (or) Async : Synchronous API
4645 * @param[in] handle pointer to application info handle
4646 * @param[out] autorestart pointer to hold package autorestart value
4647 * @return 0 if success, error code(<0) if fail
4648 * @retval PMINFO_R_OK success
4649 * @retval PMINFO_R_EINVAL invalid argument
4650 * @retval PMINFO_R_ERROR internal error
4651 * @pre pkgmgrinfo_appinfo_get_appinfo()
4652 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4653 * @see pkgmgrinfo_appinfo_get_appid()
4654 * @see pkgmgrinfo_appinfo_is_multiple()
4656 static int get_app_autorestart(const char *appid)
4660 pkgmgrinfo_appinfo_h handle;
4661 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4662 if (ret != PMINFO_R_OK)
4664 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4665 if (ret != PMINFO_R_OK) {
4666 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4669 printf("app autorestart: %d\n", autorestart);
4670 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4675 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4678 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4679 * @brief This API gets the value for given application is main app or not from handle
4681 * @par This API is for package-manager client application
4682 * @par Sync (or) Async : Synchronous API
4684 * @param[in] handle pointer to application info handle
4685 * @param[out] mainapp pointer to hold package mainapp is or not
4686 * @return 0 if success, error code(<0) if fail
4687 * @retval PMINFO_R_OK success
4688 * @retval PMINFO_R_EINVAL invalid argument
4689 * @retval PMINFO_R_ERROR internal error
4690 * @pre pkgmgrinfo_appinfo_get_appinfo()
4691 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4692 * @see pkgmgrinfo_appinfo_get_appid()
4693 * @see pkgmgrinfo_appinfo_is_multiple()
4695 static int get_app_mainapp(const char *appid)
4699 pkgmgrinfo_appinfo_h handle;
4700 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4701 if (ret != PMINFO_R_OK)
4703 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4704 if (ret != PMINFO_R_OK) {
4705 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4708 printf("mainapp: %d\n", mainapp);
4709 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4714 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4718 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4719 * @brief This API gets the value for given application is preload or not from handle
4721 * @par This API is for package-manager client application
4722 * @par Sync (or) Async : Synchronous API
4724 * @param[in] handle pointer to application info handle
4725 * @param[out] preload pointer to hold preload is or not
4726 * @return 0 if success, error code(<0) if fail
4727 * @retval PMINFO_R_OK success
4728 * @retval PMINFO_R_EINVAL invalid argument
4729 * @retval PMINFO_R_ERROR internal error
4730 * @pre pkgmgrinfo_appinfo_get_appinfo()
4731 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4732 * @see pkgmgrinfo_appinfo_get_appid()
4733 * @see pkgmgrinfo_appinfo_is_multiple()
4735 static int get_app_preload(const char *appid)
4739 pkgmgrinfo_appinfo_h handle = NULL;
4740 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4741 if (ret != PMINFO_R_OK)
4743 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4744 if (ret != PMINFO_R_OK) {
4745 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4748 printf("preload: %d\n", preload);
4749 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4754 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4757 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4758 * @brief This API gets the value for given application is submode or not from handle
4760 * @par This API is for package-manager client application
4761 * @par Sync (or) Async : Synchronous API
4763 * @param[in] handle pointer to application info handle
4764 * @param[out] submode pointer to hold submode is or not
4765 * @return 0 if success, error code(<0) if fail
4766 * @retval PMINFO_R_OK success
4767 * @retval PMINFO_R_EINVAL invalid argument
4768 * @retval PMINFO_R_ERROR internal error
4769 * @pre pkgmgrinfo_appinfo_get_appinfo()
4770 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4771 * @see pkgmgrinfo_appinfo_get_appid()
4772 * @see pkgmgrinfo_appinfo_is_multiple()
4774 static int get_app_submode(const char *appid)
4778 pkgmgrinfo_appinfo_h handle = NULL;
4779 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4780 if (ret != PMINFO_R_OK)
4782 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4783 if (ret != PMINFO_R_OK) {
4784 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4787 printf("submode: %d\n", submode);
4788 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4793 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4796 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4797 * @brief This API gets the value for given application is process_pool or not from handle
4799 * @par This API is for package-manager client application
4800 * @par Sync (or) Async : Synchronous API
4802 * @param[in] handle pointer to application info handle
4803 * @param[out] process_pool pointer to hold process_pool is or not
4804 * @return 0 if success, error code(<0) if fail
4805 * @retval PMINFO_R_OK success
4806 * @retval PMINFO_R_EINVAL invalid argument
4807 * @retval PMINFO_R_ERROR internal error
4808 * @pre pkgmgrinfo_appinfo_get_appinfo()
4809 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4810 * @see pkgmgrinfo_appinfo_get_appid()
4812 static int get_app_process_pool(const char *appid)
4815 bool process_pool = 0;
4816 pkgmgrinfo_appinfo_h handle = NULL;
4817 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4818 if (ret != PMINFO_R_OK)
4820 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4821 if (ret != PMINFO_R_OK) {
4822 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4825 printf("process_pool: %d\n", process_pool);
4826 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4831 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4834 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4835 * @brief This API gets the installed storage location of the application
4837 * @par This API is for package-manager client application
4838 * @par Sync (or) Async : Synchronous API
4840 * @param[in] handle pointer to the application info handle.
4841 * @param[out] app_type pointer to hold installed storage location
4842 * @return 0 if success, error code(<0) if fail
4843 * @retval PMINFO_R_OK success
4844 * @retval PMINFO_R_EINVAL invalid argument
4845 * @retval PMINFO_R_ERROR internal error
4846 * @pre pkgmgrinfo_appinfo_get_appinfo()
4847 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4848 * @see pkgmgrinfo_appinfo_get_appid()
4850 static int get_app_installed_location(const char *appid)
4853 pkgmgrinfo_installed_storage storage;
4854 pkgmgrinfo_appinfo_h handle = NULL;
4855 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4856 if (ret != PMINFO_R_OK)
4858 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4859 if (ret != PMINFO_R_OK) {
4860 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4863 printf("Installed storage location : %d\n", storage);
4864 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4869 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4873 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4874 * @brief This API checks if the application has the given category
4876 * @par This API is for package-manager client application
4877 * @par Sync (or) Async : Synchronous API
4879 * @param[in] handle pointer to the application info handle
4880 * @param[in] category category
4881 * @param[out] exist value Gets whether the application has the given category
4882 * @return 0 if success, error code(<0) if fail
4883 * @retval PMINFO_R_OK success
4884 * @retval PMINFO_R_EINVAL invalid argument
4885 * @retval PMINFO_R_ERROR internal error
4887 static int is_category_exist(const char *appid, const char *category)
4890 pkgmgrinfo_appinfo_h handle;
4893 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4894 if (ret != PMINFO_R_OK)
4897 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4898 if (ret != PMINFO_R_OK) {
4899 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4903 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4908 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4911 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4912 * @brief This API gets the application 'ui_gadget' value from the app ID
4914 * @par This API is for package-manager client application
4915 * @par Sync (or) Async : Synchronous API
4917 * @param[in] handle pointer to application info handle
4918 * @param[out] ui_gadget pointer to hold package ui_gadget value
4919 * @return 0 if success, error code(<0) if fail
4920 * @retval PMINFO_R_OK success
4921 * @retval PMINFO_R_EINVAL invalid argument
4922 * @pre pkgmgrinfo_appinfo_get_appinfo()
4923 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4925 static int get_app_ui_gadget(const char *appid)
4929 pkgmgrinfo_appinfo_h handle = NULL;
4930 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4931 if (ret != PMINFO_R_OK)
4933 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4934 if (ret != PMINFO_R_OK) {
4935 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4938 printf("app ui_gadget: %d\n", ui_gadget);
4939 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4944 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4947 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4948 * @brief This API gets the application 'support_disable' value from the app ID
4950 * @par This API is for package-manager client application
4951 * @par Sync (or) Async : Synchronous API
4953 * @param[in] handle pointer to application info handle
4954 * @param[out] support_disable pointer to hold package support_disable value
4955 * @return 0 if success, error code(<0) if fail
4956 * @retval PMINFO_R_OK success
4957 * @retval PMINFO_R_EINVAL invalid argument
4958 * @pre pkgmgrinfo_appinfo_get_appinfo()
4959 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4961 static int get_app_support_disable(const char *appid)
4964 bool support_disable;
4965 pkgmgrinfo_appinfo_h handle = NULL;
4966 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4967 if (ret != PMINFO_R_OK)
4969 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4970 if (ret != PMINFO_R_OK) {
4971 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4974 printf("app support_disable: %d\n", support_disable);
4975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4980 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4983 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4984 * @brief This API gets the application 'removable' value from the app ID
4986 * @par This API is for package-manager client application
4987 * @par Sync (or) Async : Synchronous API
4989 * @param[in] handle pointer to application info handle
4990 * @param[out] removable pointer to hold package removable value
4991 * @return 0 if success, error code(<0) if fail
4992 * @retval PMINFO_R_OK success
4993 * @retval PMINFO_R_EINVAL invalid argument
4994 * @retval PMINFO_R_ERROR internal error
4995 * @pre pkgmgrinfo_appinfo_get_appinfo()
4996 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4997 * @see pkgmgrinfo_appinfo_get_appid()
4999 static int get_app_removable(const char *appid)
5003 pkgmgrinfo_appinfo_h handle = NULL;
5004 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5005 if (ret != PMINFO_R_OK)
5007 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5008 if (ret != PMINFO_R_OK) {
5009 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5012 printf("app removable: %d\n", removable);
5013 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5018 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5021 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5022 * @brief This API gets the application 'system' value from the app ID
5024 * @par This API is for package-manager client application
5025 * @par Sync (or) Async : Synchronous API
5027 * @param[in] handle pointer to application info handle
5028 * @param[out] system pointer to hold package system value
5029 * @return 0 if success, error code(<0) if fail
5030 * @retval PMINFO_R_OK success
5031 * @retval PMINFO_R_EINVAL invalid argument
5032 * @retval PMINFO_R_ERROR internal error
5033 * @pre pkgmgrinfo_appinfo_get_appinfo()
5034 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5035 * @see pkgmgrinfo_appinfo_get_appid()
5037 static int get_app_system(const char *appid)
5040 bool system = false;
5041 pkgmgrinfo_appinfo_h handle = NULL;
5042 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5043 if (ret != PMINFO_R_OK)
5045 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5046 if (ret != PMINFO_R_OK) {
5047 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5050 printf("app system: %d\n", system);
5051 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5056 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5060 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5061 * @brief This API gets the application 'is_disable' value from the app ID
5063 * @par This API is for package-manager client application
5064 * @par Sync (or) Async : Synchronous API
5066 * @param[in] handle pointer to application info handle
5067 * @param[out] disabled pointer to hold application is_disabled value
5068 * @return 0 if success, error code(<0) if fail
5069 * @retval PMINFO_R_OK success
5070 * @retval PMINFO_R_EINVAL invalid argument
5071 * @pre pkgmgrinfo_appinfo_get_appinfo()
5072 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5074 static int get_app_is_disable(const char *appid)
5078 pkgmgrinfo_appinfo_h handle = NULL;
5079 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5080 if (ret != PMINFO_R_OK)
5082 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5083 if (ret != PMINFO_R_OK) {
5084 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5087 printf("app is_disable: %d\n", is_disable);
5088 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5093 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5096 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5097 * @brief This API gets whethere the given application is global application or user application
5099 * @par This API is for package-manager client application
5100 * @par Sync (or) Async : Synchronous API
5102 * @param[in] handle pointer to application info handle
5103 * @param[in] global pointer to hold application global value
5104 * @return 0 if success, error code(<0) if fail
5105 * @retval PMINFO_R_OK success
5106 * @retval PMINFO_R_EINVAL invalid argument
5107 * @retval PMINFO_R_ERROR internal error
5108 * @pre pkgmgrinfo_appinfo_get_appinfo()
5109 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5110 * @see pkgmgrinfo_appinfo_get_appid()
5111 static int get_app_is_global(const char *appid)
5115 pkgmgrinfo_appinfo_h handle = NULL;
5116 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5117 if (ret != PMINFO_R_OK)
5119 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5120 if (ret != PMINFO_R_OK) {
5121 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5124 printf("app is_global: %d\n", global);
5125 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5130 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5133 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5134 * @brief This API gets the application 'splash_screen_display' value from the app ID
5136 * @par This API is for package-manager client application
5137 * @par Sync (or) Async : Synchronous API
5139 * @param[in] handle pointer to application info handle
5140 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5141 * @return 0 if success, error code(<0) if fail
5142 * @retval PMINFO_R_OK success
5143 * @retval PMINFO_R_EINVAL invalid argument
5144 * @retval PMINFO_R_ERROR internal error
5146 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5149 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5150 * @brief This API gets the application 'setup_appid' value from the app ID
5152 * @par This API is for package-manager client application
5153 * @par Sync (or) Async : Synchronous API
5155 * @param[in] handle pointer to application info handle
5156 * @param[out] setup_appid pointer to hold package setup_appid value
5157 * @return 0 if success, error code(<0) if fail
5158 * @retval PMINFO_R_OK success
5159 * @retval PMINFO_R_EINVAL invalid argument
5160 * @retval PMINFO_R_ERROR internal error
5162 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5165 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5166 * @brief This API gets the application 'support_ambient' value from the app ID
5168 * @par This API is for package-manager client application
5169 * @par Sync (or) Async : Synchronous API
5171 * @param[in] handle pointer to application info handle
5172 * @param[out] support_ambient pointer to hold package support_ambient value
5173 * @return 0 if success, error code(<0) if fail
5174 * @retval PMINFO_R_OK success
5175 * @retval PMINFO_R_EINVAL invalid argument
5176 * @retval PMINFO_R_ERROR internal error
5178 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5181 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5182 * @brief This API destroys the application information handle freeing up all the resources
5184 * @par This API is for package-manager client application
5185 * @par Sync (or) Async : Synchronous API
5187 * @param[in] handle pointer to the application info handle.
5188 * @return 0 if success, error code(<0) if fail
5189 * @retval PMINFO_R_OK success
5190 * @retval PMINFO_R_EINVAL invalid argument
5191 * @retval PMINFO_R_ERROR internal error
5192 * @pre pkgmgrinfo_appinfo_get_appinfo()
5194 * @see pkgmgrinfo_appinfo_get_pkgid()
5195 * @see pkgmgrinfo_appinfo_is_multiple()
5197 static int get_app_type(const char *appid)
5201 pkgmgrinfo_appinfo_h handle;
5202 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5203 if (ret != PMINFO_R_OK)
5205 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5206 if (ret != PMINFO_R_OK) {
5207 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5210 printf("apptype: %s\n", type);
5211 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5216 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5219 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5220 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5221 The query will search the entire application information collected from the manifest file of all the installed packages
5223 * @par This API is for package-manager client application
5224 * @par Sync (or) Async : Synchronous API
5226 * @param[out] handle pointer to the application info filter handle.
5227 * @return 0 if success, error code(<0) if fail
5228 * @retval PMINFO_R_OK success
5229 * @retval PMINFO_R_EINVAL invalid argument
5230 * @retval PMINFO_R_ERROR internal error
5232 * @post pkgmgrinfo_appinfo_filter_destroy()
5233 * @see pkgmgrinfo_appinfo_filter_count()
5234 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5236 static int get_capp_count()
5240 pkgmgrinfo_appinfo_filter_h handle;
5241 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5242 if (ret != PMINFO_R_OK)
5244 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5245 if (ret != PMINFO_R_OK) {
5246 pkgmgrinfo_appinfo_filter_destroy(handle);
5249 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5250 if (ret != PMINFO_R_OK) {
5251 pkgmgrinfo_appinfo_filter_destroy(handle);
5254 printf("No of capp: %d\n", count);
5255 pkgmgrinfo_appinfo_filter_destroy(handle);
5260 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5263 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5264 * @brief This API destroys the application information filter handle freeing up all the resources
5266 * @par This API is for package-manager client application
5267 * @par Sync (or) Async : Synchronous API
5269 * @param[in] handle pointer to the application info filter handle.
5270 * @return 0 if success, error code(<0) if fail
5271 * @retval PMINFO_R_OK success
5272 * @retval PMINFO_R_EINVAL invalid argument
5273 * @retval PMINFO_R_ERROR internal error
5274 * @pre pkgmgrinfo_appinfo_filter_create()
5276 * @see pkgmgrinfo_appinfo_filter_count()
5277 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5279 static int get_capp_count()
5283 pkgmgrinfo_appinfo_filter_h handle;
5284 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5285 if (ret != PMINFO_R_OK)
5287 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5288 if (ret != PMINFO_R_OK) {
5289 pkgmgrinfo_appinfo_filter_destroy(handle);
5292 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5293 if (ret != PMINFO_R_OK) {
5294 pkgmgrinfo_appinfo_filter_destroy(handle);
5297 printf("No of capp: %d\n", count);
5298 pkgmgrinfo_appinfo_filter_destroy(handle);
5303 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5306 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5307 * @brief This API adds a boolean filter property to the filter handle
5309 * @par This API is for package-manager client application
5310 * @par Sync (or) Async : Synchronous API
5312 * @param[in] handle pointer to the application info filter handle.
5313 * @param[in] property boolean property name.
5314 * @param[in] value value corresponding to the property.
5315 * @return 0 if success, error code(<0) if fail
5316 * @retval PMINFO_R_OK success
5317 * @retval PMINFO_R_EINVAL invalid argument
5318 * @retval PMINFO_R_ERROR internal error
5319 * @pre pkgmgrinfo_appinfo_filter_create()
5320 * @post pkgmgrinfo_appinfo_filter_destroy()
5321 * @see pkgmgrinfo_appinfo_filter_count()
5322 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5324 static int get_taskmanageable_app_count()
5328 pkgmgrinfo_appinfo_filter_h handle;
5329 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5330 if (ret != PMINFO_R_OK)
5332 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5333 if (ret != PMINFO_R_OK) {
5334 pkgmgrinfo_appinfo_filter_destroy(handle);
5337 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5338 if (ret != PMINFO_R_OK) {
5339 pkgmgrinfo_appinfo_filter_destroy(handle);
5342 printf("No of taskmanageable apps: %d\n", count);
5343 pkgmgrinfo_appinfo_filter_destroy(handle);
5348 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5349 const char *property, const bool value);
5352 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5353 * @brief This API adds an integer filter property to the filter handle
5355 * @par This API is for package-manager client application
5356 * @par Sync (or) Async : Synchronous API
5358 * @param[in] handle pointer to the application info filter handle.
5359 * @param[in] property integer property name.
5360 * @param[in] value value corresponding to the property.
5361 * @return 0 if success, error code(<0) if fail
5362 * @retval PMINFO_R_OK success
5363 * @retval PMINFO_R_EINVAL invalid argument
5364 * @retval PMINFO_R_ERROR internal error
5365 * @pre pkgmgrinfo_appinfo_filter_create()
5366 * @post pkgmgrinfo_appinfo_filter_destroy()
5367 * @see pkgmgrinfo_appinfo_filter_count()
5368 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5370 static int get_taskmanageable_app_count()
5374 pkgmgrinfo_appinfo_filter_h handle;
5375 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5376 if (ret != PMINFO_R_OK)
5378 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5379 if (ret != PMINFO_R_OK) {
5380 pkgmgrinfo_appinfo_filter_destroy(handle);
5383 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5384 if (ret != PMINFO_R_OK) {
5385 pkgmgrinfo_appinfo_filter_destroy(handle);
5388 printf("No of apps: %d\n", count);
5389 pkgmgrinfo_appinfo_filter_destroy(handle);
5394 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5395 const char *property, const int value);
5398 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5399 * @brief This API adds a string filter property to the filter handle
5401 * @par This API is for package-manager client application
5402 * @par Sync (or) Async : Synchronous API
5404 * @param[in] handle pointer to the application info filter handle.
5405 * @param[in] property string property name.
5406 * @param[in] value value corresponding to the property.
5407 * @return 0 if success, error code(<0) if fail
5408 * @retval PMINFO_R_OK success
5409 * @retval PMINFO_R_EINVAL invalid argument
5410 * @retval PMINFO_R_ERROR internal error
5411 * @pre pkgmgrinfo_appinfo_filter_create()
5412 * @post pkgmgrinfo_appinfo_filter_destroy()
5413 * @see pkgmgrinfo_appinfo_filter_count()
5414 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5416 static int get_capp_count()
5420 pkgmgrinfo_appinfo_filter_h handle;
5421 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5422 if (ret != PMINFO_R_OK)
5424 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5425 if (ret != PMINFO_R_OK) {
5426 pkgmgrinfo_appinfo_filter_destroy(handle);
5429 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5430 if (ret != PMINFO_R_OK) {
5431 pkgmgrinfo_appinfo_filter_destroy(handle);
5434 printf("No of capp: %d\n", count);
5435 pkgmgrinfo_appinfo_filter_destroy(handle);
5440 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5441 const char *property, const char *value);
5444 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5445 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5447 * @par This API is for package-manager client application
5448 * @par Sync (or) Async : Synchronous API
5450 * @param[in] handle pointer to the application info filter handle.
5451 * @param[in] app_cb callback function.
5452 * @param[in] user_data user data to be passed to the callback function
5453 * @return 0 if success, error code(<0) if fail
5454 * @retval PMINFO_R_OK success
5455 * @retval PMINFO_R_EINVAL invalid argument
5456 * @retval PMINFO_R_ERROR internal error
5457 * @pre pkgmgrinfo_appinfo_filter_create()
5458 * @post pkgmgrinfo_appinfo_filter_destroy()
5459 * @see pkgmgrinfo_appinfo_filter_count()
5461 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5464 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5465 printf("appid : %s\n", appid);
5469 static int get_capp_list()
5472 pkgmgrinfo_appinfo_filter_h handle;
5473 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5474 if (ret != PMINFO_R_OK)
5476 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5477 if (ret != PMINFO_R_OK) {
5478 pkgmgrinfo_appinfo_filter_destroy(handle);
5481 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5482 if (ret != PMINFO_R_OK) {
5483 pkgmgrinfo_appinfo_filter_destroy(handle);
5486 pkgmgrinfo_appinfo_filter_destroy(handle);
5491 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5492 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5493 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5494 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5497 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5498 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5499 * @brief This API counts the application that satisfy the filter conditions
5501 * @par This API is for package-manager client application
5502 * @par Sync (or) Async : Synchronous API
5504 * @param[in] handle pointer to the application info filter handle.
5505 * @param[in] count pointer to store count value
5506 * @param[in] uid the addressee user id of the instruction
5507 * @return 0 if success, error code(<0) if fail
5508 * @retval PMINFO_R_OK success
5509 * @retval PMINFO_R_EINVAL invalid argument
5510 * @retval PMINFO_R_ERROR internal error
5511 * @pre pkgmgrinfo_appinfo_filter_create()
5512 * @post pkgmgrinfo_appinfo_filter_destroy()
5513 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5515 static int get_capp_count()
5519 pkgmgrinfo_appinfo_filter_h handle;
5520 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5521 if (ret != PMINFO_R_OK)
5523 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5524 if (ret != PMINFO_R_OK) {
5525 pkgmgrinfo_appinfo_filter_destroy(handle);
5528 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5529 if (ret != PMINFO_R_OK) {
5530 pkgmgrinfo_appinfo_filter_destroy(handle);
5533 printf("No of capp: %d\n", count);
5534 pkgmgrinfo_appinfo_filter_destroy(handle);
5539 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5540 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5542 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5543 * @brief This API creates the application's metadata information filter handle from db.
5545 * @par This API is for package-manager client application
5546 * @par Sync (or) Async : Synchronous API
5548 * @param[out] handle pointer to the application metadata info filter handle.
5549 * @return 0 if success, error code(<0) if fail
5550 * @retval PMINFO_R_OK success
5551 * @retval PMINFO_R_EINVAL invalid argument
5552 * @retval PMINFO_R_ERROR internal error
5554 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5555 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5557 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5560 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5561 printf("appid : %s\n", appid);
5565 static int get_app_list(const char *mkey, const char *mvalue)
5568 pkgmgrinfo_appinfo_metadata_filter_h handle;
5569 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5570 if (ret != PMINFO_R_OK)
5572 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5573 if (ret != PMINFO_R_OK) {
5574 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5577 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5578 if (ret != PMINFO_R_OK) {
5579 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5582 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5587 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5590 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5591 * @brief This API destroys the application's metadata information filter handle.
5593 * @par This API is for package-manager client application
5594 * @par Sync (or) Async : Synchronous API
5596 * @param[in] handle pointer to the application metadata info filter handle.
5597 * @return 0 if success, error code(<0) if fail
5598 * @retval PMINFO_R_OK success
5599 * @retval PMINFO_R_EINVAL invalid argument
5600 * @retval PMINFO_R_ERROR internal error
5601 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5603 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5605 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5608 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5609 printf("appid : %s\n", appid);
5613 static int get_app_list(const char *mkey, const char *mvalue)
5616 pkgmgrinfo_appinfo_metadata_filter_h handle;
5617 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5618 if (ret != PMINFO_R_OK)
5620 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5621 if (ret != PMINFO_R_OK) {
5622 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5625 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5626 if (ret != PMINFO_R_OK) {
5627 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5630 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5635 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5638 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5639 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5640 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5642 * @par This API is for package-manager client application
5643 * @par Sync (or) Async : Synchronous API
5645 * @param[in] handle pointer to the application metadata info filter handle.
5646 * @param[in] key pointer to metadata key
5647 * @param[in] value pointer to metadata value
5648 * @return 0 if success, error code(<0) if fail
5649 * @retval PMINFO_R_OK success
5650 * @retval PMINFO_R_EINVAL invalid argument
5651 * @retval PMINFO_R_ERROR internal error
5652 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5653 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5654 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5656 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5659 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5660 printf("appid : %s\n", appid);
5664 static int get_app_list(const char *mkey, const char *mvalue)
5667 pkgmgrinfo_appinfo_metadata_filter_h handle;
5668 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5669 if (ret != PMINFO_R_OK)
5671 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5672 if (ret != PMINFO_R_OK) {
5673 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5676 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5677 if (ret != PMINFO_R_OK) {
5678 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5681 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5686 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5687 const char *key, const char *value);
5690 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5691 * @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)
5692 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5693 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5694 * negative value, no more callbacks will be called and API will return.
5696 * @par This API is for package-manager client application
5697 * @par Sync (or) Async : Synchronous API
5699 * @param[in] handle pointer to the application metadata info filter handle.
5700 * @param[in] app_cb function pointer to callback
5701 * @param[in] user_data pointer to user data
5702 * @param[in] uid the addressee user id of the instruction
5703 * @return 0 if success, error code(<0) if fail
5704 * @retval PMINFO_R_OK success
5705 * @retval PMINFO_R_EINVAL invalid argument
5706 * @retval PMINFO_R_ERROR internal error
5707 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5708 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5710 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5713 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5714 printf("appid : %s\n", appid);
5718 static int get_app_list(const char *mkey, const char *mvalue)
5721 pkgmgrinfo_appinfo_metadata_filter_h handle;
5722 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5723 if (ret != PMINFO_R_OK)
5725 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5726 if (ret != PMINFO_R_OK) {
5727 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5730 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5731 if (ret != PMINFO_R_OK) {
5732 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5735 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5740 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5741 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5742 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5743 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5745 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5746 * @brief This API creates the package cert information handle to get data from db.
5748 * @par This API is for package-manager client application
5749 * @par Sync (or) Async : Synchronous API
5751 * @param[out] handle pointer to the package cert handle.
5752 * @return 0 if success, error code(<0) if fail
5753 * @retval PMINFO_R_OK success
5754 * @retval PMINFO_R_EINVAL invalid argument
5755 * @retval PMINFO_R_ERROR internal error
5757 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5758 * @see pkgmgrinfo_pkginfo_get_cert_value()
5759 * @see pkgmgrinfo_pkginfo_load_certinfo()
5761 static int get_cert_info(const char *pkgid)
5764 pkgmgrinfo_certinfo_h handle;
5765 char *auth_cert = NULL;
5766 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5767 if (ret != PMINFO_R_OK)
5769 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5770 if (ret != PMINFO_R_OK) {
5771 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5774 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5775 if (ret != PMINFO_R_OK) {
5776 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5779 printf("Author root certificate: %s\n", auth_root);
5780 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5785 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5788 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5789 * @brief This API loads the package cert information handle with data from db.
5791 * @par This API is for package-manager client application
5792 * @par Sync (or) Async : Synchronous API
5794 * @param[in] pkgid pointer to the package ID.
5795 * @param[in] handle pointer to the package cert handle.
5796 * @return 0 if success, error code(<0) if fail
5797 * @retval PMINFO_R_OK success
5798 * @retval PMINFO_R_EINVAL invalid argument
5799 * @retval PMINFO_R_ERROR internal error
5800 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5801 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5802 * @see pkgmgrinfo_pkginfo_get_cert_value()
5804 static int get_cert_info(const char *pkgid)
5807 pkgmgrinfo_certinfo_h handle;
5808 char *auth_cert = NULL;
5809 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5810 if (ret != PMINFO_R_OK)
5812 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5813 if (ret != PMINFO_R_OK) {
5814 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5817 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5818 if (ret != PMINFO_R_OK) {
5819 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5822 printf("Author root certificate: %s\n", auth_root);
5823 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5828 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5831 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5832 * @brief This API gets the package cert information from the handle
5834 * @par This API is for package-manager client application
5835 * @par Sync (or) Async : Synchronous API
5837 * @param[in] handle pointer to the package cert handle.
5838 * @param[in] cert_type certificate type
5839 * @param[out] cert_value pointer to hold certificate value
5840 * @return 0 if success, error code(<0) if fail
5841 * @retval PMINFO_R_OK success
5842 * @retval PMINFO_R_EINVAL invalid argument
5843 * @retval PMINFO_R_ERROR internal error
5844 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5845 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5846 * @see pkgmgrinfo_pkginfo_load_certinfo()
5848 static int get_cert_info(const char *pkgid)
5851 pkgmgrinfo_certinfo_h handle;
5852 char *auth_cert = NULL;
5853 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5854 if (ret != PMINFO_R_OK)
5856 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5857 if (ret != PMINFO_R_OK) {
5858 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5861 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5862 if (ret != PMINFO_R_OK) {
5863 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5866 printf("Author root certificate: %s\n", auth_root);
5867 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5872 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5875 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5876 * @brief This API destroys the package cert information handle freeing up all the resources
5878 * @par This API is for package-manager client application
5879 * @par Sync (or) Async : Synchronous API
5881 * @param[in] handle pointer to the package cert handle.
5882 * @return 0 if success, error code(<0) if fail
5883 * @retval PMINFO_R_OK success
5884 * @retval PMINFO_R_EINVAL invalid argument
5885 * @retval PMINFO_R_ERROR internal error
5886 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5888 * @see pkgmgrinfo_pkginfo_load_certinfo()
5890 static int get_cert_info(const char *pkgid)
5893 pkgmgrinfo_certinfo_h handle;
5894 char *auth_cert = NULL;
5895 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5896 if (ret != PMINFO_R_OK)
5898 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5899 if (ret != PMINFO_R_OK) {
5900 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5903 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5904 if (ret != PMINFO_R_OK) {
5905 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5908 printf("Author root certificate: %s\n", auth_root);
5909 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5914 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5917 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5918 * @brief This API deletes the package cert information from DB
5920 * @par This API is for package-manager client application
5921 * @par Sync (or) Async : Synchronous API
5923 * @param[in] pkgid pointer to the package ID.
5924 * @return 0 if success, error code(<0) if fail
5925 * @retval PMINFO_R_OK success
5926 * @retval PMINFO_R_EINVAL invalid argument
5927 * @retval PMINFO_R_ERROR internal error
5931 static int delete_cert_info(const char *pkgid)
5934 ret = pkgmgrinfo_delete_certinfo(pkgid);
5935 if (ret != PMINFO_R_OK)
5941 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5942 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5945 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5946 * @brief This API creates the package cert information handle to set data in db.
5948 * @par This API is for package-manager client application
5949 * @par Sync (or) Async : Synchronous API
5951 * @param[out] handle pointer to the package cert handle.
5952 * @return 0 if success, error code(<0) if fail
5953 * @retval PMINFO_R_OK success
5954 * @retval PMINFO_R_EINVAL invalid argument
5955 * @retval PMINFO_R_ERROR internal error
5957 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5958 * @see pkgmgrinfo_set_cert_value()
5959 * @see pkgmgrinfo_save_certinfo()
5961 static int set_cert_in_db(const char *pkgid)
5964 pkgmgrinfo_instcertinfo_h handle;
5965 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5966 if (ret != PMINFO_R_OK)
5968 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5969 if (ret != PMINFO_R_OK) {
5970 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5973 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5974 if (ret != PMINFO_R_OK) {
5975 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5978 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5983 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5986 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5987 * @brief This API sets the package cert information in the handle.
5989 * @par This API is for package-manager client application
5990 * @par Sync (or) Async : Synchronous API
5992 * @param[in] handle pointer to the package cert handle.
5993 * @param[in] cert_type certificate type.
5994 * @param[in] cert_value certificate value.
5995 * @return 0 if success, error code(<0) if fail
5996 * @retval PMINFO_R_OK success
5997 * @retval PMINFO_R_EINVAL invalid argument
5998 * @retval PMINFO_R_ERROR internal error
5999 * @pre pkgmgrinfo_create_certinfo_set_handle()
6000 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6001 * @see pkgmgrinfo_save_certinfo()
6003 static int set_cert_in_db(const char *pkgid)
6006 pkgmgrinfo_instcertinfo_h handle;
6007 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6008 if (ret != PMINFO_R_OK)
6010 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6011 if (ret != PMINFO_R_OK) {
6012 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6015 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6016 if (ret != PMINFO_R_OK) {
6017 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6020 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6025 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6028 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6029 * @brief This API saves the package cert information in the DB.
6031 * @par This API is for package-manager client application
6032 * @par Sync (or) Async : Synchronous API
6034 * @param[in] pkgid pointer to the package ID.
6035 * @param[in] handle pointer to the package cert handle.
6036 * @return 0 if success, error code(<0) if fail
6037 * @retval PMINFO_R_OK success
6038 * @retval PMINFO_R_EINVAL invalid argument
6039 * @retval PMINFO_R_ERROR internal error
6040 * @pre pkgmgrinfo_create_certinfo_set_handle()
6041 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6042 * @see pkgmgrinfo_save_certinfo()
6044 static int set_cert_in_db(const char *pkgid)
6047 pkgmgrinfo_instcertinfo_h handle;
6048 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6049 if (ret != PMINFO_R_OK)
6051 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6052 if (ret != PMINFO_R_OK) {
6053 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6056 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6057 if (ret != PMINFO_R_OK) {
6058 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6061 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6066 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6069 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6070 * @brief This API destroys the package cert information handle freeing up all the resources.
6072 * @par This API is for package-manager client application
6073 * @par Sync (or) Async : Synchronous API
6075 * @param[in] handle pointer to the package cert handle.
6076 * @return 0 if success, error code(<0) if fail
6077 * @retval PMINFO_R_OK success
6078 * @retval PMINFO_R_EINVAL invalid argument
6079 * @retval PMINFO_R_ERROR internal error
6080 * @pre pkgmgrinfo_create_certinfo_set_handle()
6082 * @see pkgmgrinfo_save_certinfo()
6084 static int set_cert_in_db(const char *pkgid)
6087 pkgmgrinfo_instcertinfo_h handle;
6088 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6089 if (ret != PMINFO_R_OK)
6091 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6092 if (ret != PMINFO_R_OK) {
6093 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6096 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6097 if (ret != PMINFO_R_OK) {
6098 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6101 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6106 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6109 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6110 * @brief This API gets the datacontrol info
6112 * @par This API is for package-manager client application
6113 * @par Sync (or) Async : Synchronous API
6115 * @param[in] providerid pointer to the providerid of dataconltrol.
6116 * @param[in] type pointer to the type of dataconltrol.
6117 * @param[out] appid pointer to hold appid, need to free after using
6118 * @param[out] access pointer to hold access, need to free after using
6119 * @return 0 if success, error code(<0) if fail
6120 * @retval PMINFO_R_OK success
6121 * @retval PMINFO_R_EINVAL invalid argument
6122 * @retval PMINFO_R_ERROR internal error
6125 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6128 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6129 * @brief This API gets the application 'guest mode visibility' value from the DB
6131 * @par This API is for package-manager client application
6132 * @par Sync (or) Async : Synchronous API
6134 * @param[in] handle pointer to application info handle
6135 * @param[out] status pointer to hold app guest mode visibility value
6136 * @return 0 if success, error code(<0) if fail
6137 * @retval PMINFO_R_OK success
6138 * @retval PMINFO_R_EINVAL invalid argument
6139 * @retval PMINFO_R_ERROR internal error
6140 * @pre pkgmgrinfo_appinfo_get_appinfo()
6141 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6142 * @see pkgmgrinfo_appinfo_get_appid()
6143 * @see pkgmgrinfo_appinfo_is_multiple()
6145 static int get_app_guestmode_visibility(const char *appid)
6149 pkgmgrinfo_appinfo_h handle;
6150 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6151 if (ret != PMINFO_R_OK)
6153 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6154 if (ret != PMINFO_R_OK) {
6155 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6158 printf("app guest mode visibility: %d\n", status);
6159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6164 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6167 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6168 * @brief This API sets the package 'installed_storage' value in db
6170 * @par This API is for package-manager client application
6171 * @par Sync (or) Async : Synchronous API
6173 * @param[in] pkgid pointer to the package ID.
6174 * @param[in] location package install location
6175 * @param[in] external_pkg_path image path if pkg has installed at external storage
6176 * @return 0 if success, error code(<0) if fail
6177 * @retval PMINFO_R_OK success
6178 * @retval PMINFO_R_EINVAL invalid argument
6179 * @retval PMINFO_R_ERROR internal error
6181 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6185 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6186 if (ret != PMINFO_R_OK) {
6193 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6194 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6196 /* version compare */
6197 int pkgmgrinfo_compare_package_version(const char *current_version,
6198 const char *target_version, pkgmgrinfo_version_compare_type *res);
6205 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6206 int flag, void *user_data, uid_t uid);
6207 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6208 int flag, void *user_data);
6209 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6210 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6212 int pkgmgrinfo_appinfo_get_installed_list_full(
6213 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6216 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6217 pkgmgrinfo_archiveinfo_h *handle);
6218 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6219 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6220 const char **pkgid);
6221 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6223 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6224 const char **version);
6225 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6226 const char **api_version);
6227 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6228 const char **description);
6229 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6230 const char **label);
6231 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6232 const char **author);
6233 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6234 const unsigned char **icon, size_t *size);
6237 * @pkgmgrinfo client API end
6245 #endif /* __PKG_INFO_H__ */