4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
117 /** Integer property for filtering based on package info*/
118 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_PRIVILEGE "PMINFO_APPINFO_PROP_PRIVILEGE"
149 /** Integer property for filtering app support mode */
150 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
175 /** will be updated*/
176 /** string property for filtering based on pkg info*/
177 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
179 /* For multiuser support */
180 const char *getIconPath(uid_t uid, bool readonly);
181 char *getUserPkgParserDBPath(void);
182 char *getUserPkgParserDBPathUID(uid_t uid);
183 char *getUserPkgCertDBPath(void);
184 const char *getUserManifestPath(uid_t uid, bool readonly);
187 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
188 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
189 * @brief This API gets list of installed packages
191 * @par This API is for package-manager client application
192 * @par Sync (or) Async : Synchronous API
193 * @param[in] pkg_list_cb iteration function for list
194 * @param[in] user_data user data to be passed to callback function
195 * @param[in] uid the addressee user id of the instruction
196 * @return 0 if success, error code(<0) if fail
197 * @retval PMINFO_R_OK success
198 * @retval PMINFO_R_EINVAL invalid argument
199 * @retval PMINFO_R_ERROR internal error
203 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
207 pkgid1 = (char *)user_data;
208 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
209 if (strcmp(pkgid1, pkgid2) == 0) {
216 static int list_pkgs()
219 char *name = "helloworld";
220 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
221 if (ret != PMINFO_R_OK) {
228 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
229 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
232 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
233 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
234 * @brief This API gets list of disabled packages
236 * @par This API is for package-manager client application
237 * @par Sync (or) Async : Synchronous API
238 * @param[in] pkg_list_cb iteration function for list
239 * @param[in] user_data user data to be passed to callback function
240 * @param[in] uid the addressee user id of the instruction
241 * @return 0 if success, error code(<0) if fail
242 * @retval PMINFO_R_OK success
243 * @retval PMINFO_R_EINVAL invalid argument
244 * @retval PMINFO_R_ERROR internal error
248 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
249 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
252 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
253 * @brief This API creates the package information handle from db which is not disabled
255 * @par This API is for package-manager client application
256 * @par Sync (or) Async : Synchronous API
258 * @param[in] pkgid pointer to package ID
259 * @param[in] uid the addressee user id of the instruction
260 * @param[out] handle pointer to the package info handle.
261 * @return 0 if success, error code(<0) if fail
262 * @retval PMINFO_R_OK success
263 * @retval PMINFO_R_EINVAL invalid argument
264 * @retval PMINFO_R_ERROR internal error
266 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
267 * @see pkgmgrinfo_pkginfo_get_pkgid()
268 * @see pkgmgrinfo_pkginfo_is_removable()
270 static int get_pkg_type(const char *pkgid)
274 pkgmgrinfo_pkginfo_h handle;
275 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
276 if (ret != PMINFO_R_OK)
278 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
279 if (ret != PMINFO_R_OK) {
280 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
283 printf("pkgtype: %s\n", type);
284 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
289 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
290 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
293 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
294 * @brief This API creates the disabled package information handle from db
296 * @par This API is for package-manager client application
297 * @par Sync (or) Async : Synchronous API
299 * @param[in] pkgid pointer to package ID
300 * @param[in] uid the addressee user id of the instruction
301 * @param[out] handle pointer to the package info handle.
302 * @return 0 if success, error code(<0) if fail
303 * @retval PMINFO_R_OK success
304 * @retval PMINFO_R_EINVAL invalid argument
305 * @retval PMINFO_R_ERROR internal error
307 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
308 * @see pkgmgrinfo_pkginfo_get_pkginfo()
310 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
311 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
314 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
315 * @brief This API creates the package information handle from db regardless of its disable or storage status
317 * @par This API is for package-manager client application
318 * @par Sync (or) Async : Synchronous API
320 * @param[in] pkgid pointer to package ID
321 * @param[in] uid the addressee user id of the instruction
322 * @param[out] handle pointer to the package info handle.
323 * @return 0 if success, error code(<0) if fail
324 * @retval PMINFO_R_OK success
325 * @retval PMINFO_R_EINVAL invalid argument
326 * @retval PMINFO_R_ERROR internal error
328 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
329 * @see pkgmgrinfo_pkginfo_get_pkgid()
330 * @see pkgmgrinfo_pkginfo_is_removable()
332 static int get_pkg_type(const char *pkgid)
336 pkgmgrinfo_pkginfo_h handle;
337 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
338 if (ret != PMINFO_R_OK)
340 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
341 if (ret != PMINFO_R_OK) {
342 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
345 printf("pkgtype: %s\n", type);
346 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
351 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
352 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
355 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
356 * @brief This API gets the package name from the package ID
358 * @par This API is for package-manager client application
359 * @par Sync (or) Async : Synchronous API
361 * @param[in] handle pointer to package info handle
362 * @param[out] pkg_name pointer to hold package name
363 * @return 0 if success, error code(<0) if fail
364 * @retval PMINFO_R_OK success
365 * @retval PMINFO_R_EINVAL invalid argument
366 * @retval PMINFO_R_ERROR internal error
367 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
368 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
369 * @see pkgmgrinfo_pkginfo_get_type()
370 * @see pkgmgrinfo_pkginfo_is_removable()
372 static int get_pkg_name(const char *pkgid)
375 char *pkgname = NULL;
376 pkgmgrinfo_pkginfo_h handle;
377 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
378 if (ret != PMINFO_R_OK)
380 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
381 if (ret != PMINFO_R_OK) {
382 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
385 printf("pkgname: %s\n", pkgname);
386 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
391 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
394 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
395 * @brief This API gets the package id from the package ID
397 * @par This API is for package-manager client application
398 * @par Sync (or) Async : Synchronous API
400 * @param[in] handle pointer to package info handle
401 * @param[out] pkgid pointer to hold package id
402 * @return 0 if success, error code(<0) if fail
403 * @retval PMINFO_R_OK success
404 * @retval PMINFO_R_EINVAL invalid argument
405 * @retval PMINFO_R_ERROR internal error
406 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
407 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
408 * @see pkgmgrinfo_pkginfo_get_type()
409 * @see pkgmgrinfo_pkginfo_is_removable()
411 static int get_pkgid(const char *pkgid)
415 pkgmgrinfo_pkginfo_h handle;
416 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
417 if (ret != PMINFO_R_OK)
419 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
420 if (ret != PMINFO_R_OK) {
421 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
424 printf("pkg id: %s\n", pkg_id);
425 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
430 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
433 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
434 * @brief This API gets the package type from the package ID
436 * @par This API is for package-manager client application
437 * @par Sync (or) Async : Synchronous API
439 * @param[in] handle pointer to package info handle
440 * @param[out] type pointer to hold package type
441 * @return 0 if success, error code(<0) if fail
442 * @retval PMINFO_R_OK success
443 * @retval PMINFO_R_EINVAL invalid argument
444 * @retval PMINFO_R_ERROR internal error
445 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
446 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
447 * @see pkgmgrinfo_pkginfo_get_pkgid()
448 * @see pkgmgrinfo_pkginfo_is_removable()
450 static int get_pkg_type(const char *pkgid)
454 pkgmgrinfo_pkginfo_h handle;
455 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
456 if (ret != PMINFO_R_OK)
458 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
459 if (ret != PMINFO_R_OK) {
460 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
463 printf("pkgtype: %s\n", type);
464 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
469 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
472 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
473 * @brief This API gets the package version from the package ID
475 * @par This API is for package-manager client application
476 * @par Sync (or) Async : Synchronous API
478 * @param[in] handle pointer to package info handle
479 * @param[out] version pointer to hold package version
480 * @return 0 if success, error code(<0) if fail
481 * @retval PMINFO_R_OK success
482 * @retval PMINFO_R_EINVAL invalid argument
483 * @retval PMINFO_R_ERROR internal error
484 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
485 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
486 * @see pkgmgrinfo_pkginfo_get_pkgid()
487 * @see pkgmgrinfo_pkginfo_is_removable()
489 static int get_pkg_version(const char *pkgid)
492 char *version = NULL;
493 pkgmgrinfo_pkginfo_h handle;
494 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
495 if (ret != PMINFO_R_OK)
497 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
498 if (ret != PMINFO_R_OK) {
499 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
502 printf("pkg version: %s\n", version);
503 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
508 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
511 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
512 * @brief This API gets the package api_version from the package ID
514 * @par This API is for package-manager client application
515 * @par Sync (or) Async : Synchronous API
517 * @param[in] handle pointer to package info handle
518 * @param[out] api_version pointer to hold package api_version
519 * @return 0 if success, error code(<0) if fail
520 * @retval PMINFO_R_OK success
521 * @retval PMINFO_R_EINVAL invalid argument
522 * @retval PMINFO_R_ERROR internal error
523 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
524 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
525 * @see pkgmgrinfo_pkginfo_get_pkgid()
526 * @see pkgmgrinfo_pkginfo_is_removable()
528 static int get_pkg_api_version(const char *pkgid)
531 char *api_version = NULL;
532 pkgmgrinfo_pkginfo_h handle = NULL;
533 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
534 if (ret != PMINFO_R_OK)
536 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
537 if (ret != PMINFO_R_OK) {
538 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
541 printf("pkg api_version: %s\n", api_version);
542 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
547 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
550 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
551 * @brief This API gets tep(tizen expansion package) file name associated with the package
553 * @par This API is for package-manager client application
554 * @par Sync (or) Async : Synchronous API
556 * @param[in] handle pointer to the pkginfo handle.
557 * @param[out] tep_name pointer to hold tep name
558 * @return 0 if success, error code(<0) if fail
559 * @retval PMINFO_R_OK success
560 * @retval PMINFO_R_EINVAL invalid argument
561 * @retval PMINFO_R_ERROR internal error
562 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
563 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
564 * @see pkgmgrinfo_pkginfo_get_pkgid()
566 static int get_tep_name(const char *pkgid)
569 char *tep_name = NULL;
570 pkgmgrinfo_pkginfo_h handle = NULL;
571 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
572 if (ret != PMINFO_R_OK)
574 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
575 if (ret != PMINFO_R_OK) {
576 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
579 printf("TEP name is: %s\n", tep_name);
580 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
585 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
588 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
589 * @brief This API gets package mount point path associated with the package
590 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
592 * @par This API is for package-manager client application
593 * @par Sync (or) Async : Synchronous API
595 * @param[in] handle pointer to the pkginfo handle.
596 * @param[out] zip_mount_file pointer to hold zip mount file
597 * @return 0 if success, error code(<0) if fail
598 * @retval PMINFO_R_OK success
599 * @retval PMINFO_R_EINVAL invalid argument
600 * @retval PMINFO_R_ERROR internal error
601 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
602 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
603 * @see pkgmgrinfo_pkginfo_get_pkgid()
605 static int get_zip_mount_file(const char *pkgid)
608 char *zip_mount_file = NULL;
609 pkgmgrinfo_pkginfo_h handle = NULL;
610 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
611 if (ret != PMINFO_R_OK)
613 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
614 if (ret != PMINFO_R_OK) {
615 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
618 if (zip_mount_file != NULL)
619 printf("Zip mount path is: %s\n", zip_mount_file);
620 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
625 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
628 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
629 * @brief This API gets package external image path associated with the package
630 * if package is installed in external storage.
631 * Otherwise, the return value will be PMINFO_R_ENOENT.
633 * @par This API is for package-manager client application
634 * @par Sync (or) Async : Synchronous API
636 * @param[in] handle pointer to the pkginfo handle.
637 * @param[out] ext_image_path pointer to hold external image path
638 * @return 0 if success, error code(<0) if fail
639 * @retval PMINFO_R_OK success
640 * @retval PMINFO_R_EINVAL invalid argument
641 * @retval PMINFO_R_ERROR internal error
642 * @revall PMINFO_R_ENOENT no valid data
643 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
644 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
645 * @see pkgmgrinfo_pkginfo_get_pkgid()
647 static int get_external_image_path(const char *pkgid)
650 char *ext_image_path = NULL;
651 pkgmgrinfo_pkginfo_h handle = NULL;
652 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
653 if (ret != PMINFO_R_OK)
655 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
656 if (ret != PMINFO_R_OK) {
657 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
660 printf("external image path is: %s\n", ext_image_path);
661 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
666 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
669 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
670 * @brief This API gets the package install location from the package ID
672 * @par This API is for package-manager client application
673 * @par Sync (or) Async : Synchronous API
675 * @param[in] handle pointer to package info handle
676 * @param[out] location pointer to hold package install location
677 * @return 0 if success, error code(<0) if fail
678 * @retval PMINFO_R_OK success
679 * @retval PMINFO_R_EINVAL invalid argument
680 * @retval PMINFO_R_ERROR internal error
681 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
682 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
683 * @see pkgmgrinfo_pkginfo_get_pkgid()
684 * @see pkgmgrinfo_pkginfo_is_removable()
686 static int get_pkg_install_location(const char *pkgid)
689 pkgmgrinfo_install_location location;
690 pkgmgrinfo_pkginfo_h handle;
691 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
692 if (ret != PMINFO_R_OK)
694 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
695 if (ret != PMINFO_R_OK) {
696 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
699 printf("pkg install location: %d\n", location);
700 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
705 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
708 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
709 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
710 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
711 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
713 * @par This API is for package-manager client application
714 * @par Sync (or) Async : Synchronous API
716 * @param[in] handle pointer to package info handle
717 * @param[out] size pointer to hold package size
718 * @return 0 if success, error code(<0) if fail
719 * @retval PMINFO_R_OK success
720 * @retval PMINFO_R_EINVAL invalid argument
721 * @retval PMINFO_R_ERROR internal error
722 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
723 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
724 * @see pkgmgrinfo_pkginfo_get_pkgid()
725 * @see pkgmgrinfo_pkginfo_is_removable()
727 static int get_pkg_size(const char *pkgid)
731 pkgmgrinfo_pkginfo_h handle;
732 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
733 if (ret != PMINFO_R_OK)
735 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
736 if (ret != PMINFO_R_OK) {
737 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
740 printf("pkgsize: %d\n", size);
741 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
746 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
749 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
750 * @brief This API gets the package icon from the package ID
752 * @par This API is for package-manager client application
753 * @par Sync (or) Async : Synchronous API
755 * @param[in] handle pointer to package info handle
756 * @param[out] icon pointer to hold package icon
757 * @return 0 if success, error code(<0) if fail
758 * @retval PMINFO_R_OK success
759 * @retval PMINFO_R_EINVAL invalid argument
760 * @retval PMINFO_R_ERROR internal error
761 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
762 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
763 * @see pkgmgrinfo_pkginfo_get_pkgid()
764 * @see pkgmgrinfo_pkginfo_is_removable()
766 static int get_pkg_icon(const char *pkgid)
770 pkgmgrinfo_pkginfo_h handle;
771 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
772 if (ret != PMINFO_R_OK)
774 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
775 if (ret != PMINFO_R_OK) {
776 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
779 printf("pkg icon: %s\n", icon);
780 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
785 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
788 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
789 * @brief This API gets the package label from the package ID
791 * @par This API is for package-manager client application
792 * @par Sync (or) Async : Synchronous API
794 * @param[in] handle pointer to package info handle
795 * @param[out] label pointer to hold package label
796 * @return 0 if success, error code(<0) if fail
797 * @retval PMINFO_R_OK success
798 * @retval PMINFO_R_EINVAL invalid argument
799 * @retval PMINFO_R_ERROR internal error
800 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
801 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
802 * @see pkgmgrinfo_pkginfo_get_pkgid()
803 * @see pkgmgrinfo_pkginfo_is_removable()
805 static int get_pkg_label(const char *pkgid)
809 pkgmgrinfo_pkginfo_h handle;
810 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
811 if (ret != PMINFO_R_OK)
813 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
814 if (ret != PMINFO_R_OK) {
815 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
818 printf("pkg label: %s\n", label);
819 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
824 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
827 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
828 * @brief This API gets the package description from the package ID
830 * @par This API is for package-manager client application
831 * @par Sync (or) Async : Synchronous API
833 * @param[in] handle pointer to package info handle
834 * @param[out] description pointer to hold package description
835 * @return 0 if success, error code(<0) if fail
836 * @retval PMINFO_R_OK success
837 * @retval PMINFO_R_EINVAL invalid argument
838 * @retval PMINFO_R_ERROR internal error
839 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
840 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
841 * @see pkgmgrinfo_pkginfo_get_pkgid()
842 * @see pkgmgrinfo_pkginfo_is_removable()
844 static int get_pkg_description(const char *pkgid)
847 char *description = NULL;
848 pkgmgrinfo_pkginfo_h handle;
849 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
850 if (ret != PMINFO_R_OK)
852 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
853 if (ret != PMINFO_R_OK) {
854 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
857 printf("pkg description: %s\n", description);
858 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
863 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
866 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
867 * @brief This API gets the package's author name from the package ID
869 * @par This API is for package-manager client application
870 * @par Sync (or) Async : Synchronous API
872 * @param[in] handle pointer to package info handle
873 * @param[out] author_name pointer to hold package author name
874 * @return 0 if success, error code(<0) if fail
875 * @retval PMINFO_R_OK success
876 * @retval PMINFO_R_EINVAL invalid argument
877 * @retval PMINFO_R_ERROR internal error
878 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
879 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
880 * @see pkgmgrinfo_pkginfo_get_pkgid()
881 * @see pkgmgrinfo_pkginfo_is_removable()
883 static int get_pkg_author_name(const char *pkgid)
886 char *author_name = NULL;
887 pkgmgrinfo_pkginfo_h handle;
888 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
889 if (ret != PMINFO_R_OK)
891 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
892 if (ret != PMINFO_R_OK) {
893 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
896 printf("pkg author name: %s\n", author_name);
897 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
902 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
905 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
906 * @brief This API gets the package's author email from the package ID
908 * @par This API is for package-manager client application
909 * @par Sync (or) Async : Synchronous API
911 * @param[in] handle pointer to package info handle
912 * @param[out] author_email pointer to hold package author email
913 * @return 0 if success, error code(<0) if fail
914 * @retval PMINFO_R_OK success
915 * @retval PMINFO_R_EINVAL invalid argument
916 * @retval PMINFO_R_ERROR internal error
917 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
918 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
919 * @see pkgmgrinfo_pkginfo_get_pkgid()
920 * @see pkgmgrinfo_pkginfo_is_removable()
922 static int get_pkg_author_email(const char *pkgid)
925 char *author_email = NULL;
926 pkgmgrinfo_pkginfo_h handle;
927 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
928 if (ret != PMINFO_R_OK)
930 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
931 if (ret != PMINFO_R_OK) {
932 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
935 printf("pkg author email: %s\n", author_email);
936 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
941 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
944 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
945 * @brief This API gets the package's author href from the package ID
947 * @par This API is for package-manager client application
948 * @par Sync (or) Async : Synchronous API
950 * @param[in] handle pointer to package info handle
951 * @param[out] author_href pointer to hold package author href
952 * @return 0 if success, error code(<0) if fail
953 * @retval PMINFO_R_OK success
954 * @retval PMINFO_R_EINVAL invalid argument
955 * @retval PMINFO_R_ERROR internal error
956 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
957 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
958 * @see pkgmgrinfo_pkginfo_get_pkgid()
959 * @see pkgmgrinfo_pkginfo_is_removable()
961 static int get_pkg_author_href(const char *pkgid)
964 char *author_href = NULL;
965 pkgmgrinfo_pkginfo_h handle;
966 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
967 if (ret != PMINFO_R_OK)
969 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
970 if (ret != PMINFO_R_OK) {
971 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
974 printf("pkg author href: %s\n", author_href);
975 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
980 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
983 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
984 * @brief This API gets the package installed storagae value from the package ID
986 * @par This API is for package-manager client application
987 * @par Sync (or) Async : Synchronous API
989 * @param[in] handle pointer to package info handle
990 * @param[out] storage pointer to hold package installed storage
991 * @return 0 if success, error code(<0) if fail
992 * @retval PMINFO_R_OK success
993 * @retval PMINFO_R_EINVAL invalid argument
994 * @retval PMINFO_R_ERROR internal error
995 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
996 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
997 * @see pkgmgrinfo_pkginfo_get_pkgid()
998 * @see pkgmgrinfo_pkginfo_is_removable()
1000 static int get_pkg_installed_storage(const char *pkgid)
1003 pkgmgrinfo_installed_storage storage;
1004 pkgmgrinfo_pkginfo_h handle;
1005 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1006 if (ret != PMINFO_R_OK)
1008 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1009 if (ret != PMINFO_R_OK) {
1010 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1013 printf("pkg installed storage: %d\n", storage);
1014 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1019 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1022 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1023 * @brief This API gets the installed time of package from the package ID
1025 * @par This API is for package-manager client application
1026 * @par Sync (or) Async : Synchronous API
1028 * @param[in] handle pointer to package info handle
1029 * @param[out] installed_time pointer to hold installed time of package
1030 * @return 0 if success, error code(<0) if fail
1031 * @retval PMINFO_R_OK success
1032 * @retval PMINFO_R_EINVAL invalid argument
1033 * @retval PMINFO_R_ERROR internal error
1034 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1035 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1036 * @see pkgmgrinfo_pkginfo_get_pkgid()
1037 * @see pkgmgrinfo_pkginfo_is_removable()
1039 static int get_pkg_installed_time(const char *pkgid)
1042 int installed_time = 0;
1043 pkgmgrinfo_pkginfo_h handle;
1044 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1045 if (ret != PMINFO_R_OK)
1047 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1048 if (ret != PMINFO_R_OK) {
1049 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1052 printf("installed_time: %d\n", installed_time);
1053 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1058 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1061 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1062 * @brief This API creates the update info handle
1064 * @par This API is for package-manager client application
1065 * @par Sync (or) Async : Synchronous API
1067 * @param[out] handle pointer to package update info handle
1068 * @return 0 if success, error code(<0) if fail
1069 * @retval PMINFO_R_OK success
1070 * @retval PMINFO_R_EINVAL invalid argument
1071 * @retval PMINFO_R_ERROR internal error
1072 * @post pkgmgrinfo_updateinfo_destroy()
1073 * @see pkgmgrinfo_updateinfo_set_pkgid()
1074 * @see pkgmgrinfo_updateinfo_set_version()
1075 * @see pkgmgrinfo_updateinfo_set_type()
1076 * @see pkgmgr_client_register_pkg_updateinfo()
1078 static int updateinfo_handle_create()
1082 pkgmgrinfo_updateinfo_h handle;
1083 ret = pkgmgrinfo_updateinfo_create(&handle);
1084 if (ret != PMINFO_R_OK)
1086 pkgmgrinfo_update_infodestroy(handle);
1091 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1094 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1095 * @brief This API destroy the update info handle
1097 * @par This API is for package-manager client application
1098 * @par Sync (or) Async : Synchronous API
1100 * @param[in] handle pointer to package update info handle
1101 * @return 0 if success, error code(<0) if fail
1102 * @retval PMINFO_R_OK success
1103 * @retval PMINFO_R_EINVAL invalid argument
1104 * @pre pkgmgrinfo_updateinfo_create()
1105 * @see pkgmgr_client_register_pkg_updateinfo()
1107 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1111 ret = pkgmgrinfo_updateinfo_destroy(handle);
1112 if (ret != PMINFO_R_OK)
1118 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1121 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1122 * @brief This API creates the package update information handle from db
1124 * @par This API is for package-manager client application
1125 * @par Sync (or) Async : Synchronous API
1127 * @param[in] pkgid pointer to package ID
1128 * @param[in] uid the addressee user id of the instruction
1129 * @param[out] update_handle pointer to the package update info handle.
1130 * @return 0 if success, error code(<0) if fail
1131 * @retval PMINFO_R_OK success
1132 * @retval PMINFO_R_EINVAL invalid argument
1133 * @retval PMINFO_R_ERROR internal error
1135 * @post pkgmgrinfo_updateinfo_destroy()
1136 * @see pkgmgrinfo_updateinfo_get_pkgid()
1137 * @see pkgmgrinfo_updateinfo_get_version()
1138 * @see pkgmgrinfo_updateinfo_get_update_type()
1140 static int get_pkg_update_info(const char *pkgid)
1144 pkgmgrinfo_updateinfo_h handle;
1145 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1146 if (ret != PMINFO_R_OK)
1148 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1149 if (ret != PMINFO_R_OK) {
1150 pkgmgrinfo_updateinfo_destroy(handle);
1153 printf("pkg update version: %s\n", version
1154 pkgmgrinfo_updateinfo_destroy(handle);
1159 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1160 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1163 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1164 * @brief This API sets given pkgid into handle
1166 * @par This API is for package-manager client application
1167 * @par Sync (or) Async : Synchronous API
1169 * @param[in] handle pointer to package update info handle
1170 * @param[in] pkgid package id
1171 * @return 0 if success, error code(<0) if fail
1172 * @retval PMINFO_R_OK success
1173 * @retval PMINFO_R_EINVAL invalid argument
1174 * @retval PMINFO_R_ERROR internal error
1176 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1180 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1181 if (ret != PMINFO_R_OK)
1187 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1190 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1191 * @brief This API sets given version into handle
1193 * @par This API is for package-manager client application
1194 * @par Sync (or) Async : Synchronous API
1196 * @param[in] handle pointer to package update info handle
1197 * @param[in] version update version
1198 * @return 0 if success, error code(<0) if fail
1199 * @retval PMINFO_R_OK success
1200 * @retval PMINFO_R_EINVAL invalid argument
1201 * @retval PMINFO_R_ERROR internal error
1203 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1207 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1208 if (ret != PMINFO_R_OK)
1214 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1217 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1218 * @brief This API sets given update type into handle
1220 * @par This API is for package-manager client application
1221 * @par Sync (or) Async : Synchronous API
1223 * @param[in] handle pointer to package update info handle
1224 * @param[in] type update type
1225 * @return 0 if success, error code(<0) if fail
1226 * @retval PMINFO_R_OK success
1227 * @retval PMINFO_R_EINVAL invalid argument
1228 * @retval PMINFO_R_ERROR internal error
1230 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1234 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1235 if (ret != PMINFO_R_OK)
1241 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1244 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1245 * @brief This API retrieves the pkgid from given update info
1247 * @par This API is for package-manager client application
1248 * @par Sync (or) Async : Synchronous API
1250 * @param[in] handle pointer to package update info handle
1251 * @param[out] pkgid package id
1252 * @return 0 if success, error code(<0) if fail
1253 * @retval PMINFO_R_OK success
1254 * @retval PMINFO_R_EINVAL invalid argument
1255 * @retval PMINFO_R_ERROR internal error
1257 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1262 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1263 if (ret != PMINFO_R_OK)
1269 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1272 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1273 * @brief This API retrieves the version from given update info
1275 * @par This API is for package-manager client application
1276 * @par Sync (or) Async : Synchronous API
1278 * @param[in] handle pointer to package update info handle
1279 * @param[out] version update version
1280 * @return 0 if success, error code(<0) if fail
1281 * @retval PMINFO_R_OK success
1282 * @retval PMINFO_R_EINVAL invalid argument
1283 * @retval PMINFO_R_ERROR internal error
1285 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1290 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1291 if (ret != PMINFO_R_OK)
1297 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1300 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1301 * @brief This API retrieves the update type from given update info
1303 * @par This API is for package-manager client application
1304 * @par Sync (or) Async : Synchronous API
1306 * @param[in] handle pointer to package update info handle
1307 * @param[out] type update type
1308 * @return 0 if success, error code(<0) if fail
1309 * @retval PMINFO_R_OK success
1310 * @retval PMINFO_R_EINVAL invalid argument
1311 * @retval PMINFO_R_ERROR internal error
1313 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1316 pkgmgrinfo_updateinfo_update_type *type;
1318 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1319 if (ret != PMINFO_R_OK)
1325 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1329 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1330 * @brief This API retrieve the update informations and invoke given callback for it.
1332 * @par This API is for package-manager client application
1333 * @par Sync (or) Async : Synchronous API
1335 * @param[in] callback callback to be invoked for each retrieved informations
1336 * @param[in] user_data user data to be passed to callback
1337 * @return 0 if success, error code(<0) if fail
1338 * @retval PMINFO_R_OK success
1339 * @retval PMINFO_R_EINVAL invalid argument
1340 * @retval PMINFO_R_ERROR internal error
1342 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1346 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1347 if (ret != PMINFO_R_OK)
1353 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1354 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1357 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1358 * @brief This API gets the launch mode of package from the package ID
1360 * @par This API is for package-manager client application
1361 * @par Sync (or) Async : Synchronous API
1363 * @param[in] handle pointer to package info handle
1364 * @param[out] mode pointer to hold launch mode of package
1365 * @return 0 if success, error code(<0) if fail
1366 * @retval PMINFO_R_OK success
1367 * @retval PMINFO_R_EINVAL invalid argument
1368 * @retval PMINFO_R_ERROR internal error
1369 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1371 * @see pkgmgrinfo_pkginfo_get_pkgid()
1372 * @see pkgmgrinfo_pkginfo_is_removable()
1374 static int get_pkg_launch_mode(const char *pkgid)
1377 char *launch_mode = NULL;
1378 pkgmgrinfo_pkginfo_h handle;
1379 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1380 if (ret != PMINFO_R_OK)
1382 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1383 if (ret != PMINFO_R_OK) {
1384 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1387 printf("launch mode: %s\n", mode);
1388 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1393 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1396 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1397 * @brief This API gets the store client id of package from the package ID
1399 * @par This API is for package-manager client application
1400 * @par Sync (or) Async : Synchronous API
1402 * @param[in] handle pointer to package info handle
1403 * @param[out] storeclientid pointer to hold store client id of package
1404 * @return 0 if success, error code(<0) if fail
1405 * @retval PMINFO_R_OK success
1406 * @retval PMINFO_R_EINVAL invalid argument
1407 * @retval PMINFO_R_ERROR internal error
1408 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1409 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1410 * @see pkgmgrinfo_pkginfo_get_pkgid()
1411 * @see pkgmgrinfo_pkginfo_is_removable()
1413 static int get_pkg_storeclientid(const char *pkgid)
1416 char *storeclientid = 0;
1417 pkgmgrinfo_pkginfo_h handle;
1418 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1419 if (ret != PMINFO_R_OK)
1421 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1422 if (ret != PMINFO_R_OK) {
1423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1426 printf(store client id: %s\n", storeclientid);
1427 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1432 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1435 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1436 * @brief This API gets the main app id of package from the package ID
1438 * @par This API is for package-manager client application
1439 * @par Sync (or) Async : Synchronous API
1441 * @param[in] handle pointer to package info handle
1442 * @param[out] mainappid pointer to hold main app id of package
1443 * @return 0 if success, error code(<0) if fail
1444 * @retval PMINFO_R_OK success
1445 * @retval PMINFO_R_EINVAL invalid argument
1446 * @retval PMINFO_R_ERROR internal error
1447 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1448 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1449 * @see pkgmgrinfo_pkginfo_get_pkgid()
1450 * @see pkgmgrinfo_pkginfo_is_removable()
1452 static int get_pkg_mainappid(const char *pkgid)
1455 char *mainappid = 0;
1456 pkgmgrinfo_pkginfo_h handle;
1457 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1458 if (ret != PMINFO_R_OK)
1460 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1461 if (ret != PMINFO_R_OK) {
1462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1465 printf(main app id: %s\n", mainappid);
1466 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1471 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1474 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1475 * @brief This API gets the url of package from the package ID
1477 * @par This API is for package-manager client application
1478 * @par Sync (or) Async : Synchronous API
1480 * @param[in] handle pointer to package info handle
1481 * @param[out] url pointer to hold url of package
1482 * @return 0 if success, error code(<0) if fail
1483 * @retval PMINFO_R_OK success
1484 * @retval PMINFO_R_EINVAL invalid argument
1485 * @retval PMINFO_R_ERROR internal error
1486 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1487 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1488 * @see pkgmgrinfo_pkginfo_get_pkgid()
1489 * @see pkgmgrinfo_pkginfo_is_removable()
1491 static int get_pkg_url(const char *pkgid)
1495 pkgmgrinfo_pkginfo_h handle;
1496 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1497 if (ret != PMINFO_R_OK)
1499 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1500 if (ret != PMINFO_R_OK) {
1501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1504 printf("url : %s\n", url);
1505 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1510 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1513 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1514 * @brief This API gets the root path of package
1516 * @par Sync (or) Async : Synchronous API
1518 * @param[in] handle pointer to package info handle
1519 * @param[out] path pointer to hold root path of package
1520 * @return 0 if success, error code(<0) if fail
1521 * @retval PMINFO_R_OK success
1522 * @retval PMINFO_R_EINVAL invalid argument
1523 * @retval PMINFO_R_ERROR internal error
1525 static int get_root_path(const char *pkgid)
1529 pkgmgrinfo_pkginfo_h handle;
1530 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1531 if (ret != PMINFO_R_OK)
1534 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1535 if (ret != PMINFO_R_OK) {
1536 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1539 printf("path : %s\n", path);
1540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1546 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1550 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1551 * @brief This API gets the csc path of package
1553 * @par Sync (or) Async : Synchronous API
1555 * @param[in] handle pointer to package info handle
1556 * @param[out] path pointer to hold csc path of package
1557 * @return 0 if success, error code(<0) if fail
1558 * @retval PMINFO_R_OK success
1559 * @retval PMINFO_R_EINVAL invalid argument
1560 * @retval PMINFO_R_ERROR internal error
1562 static int get_csc_path(const char *pkgid)
1566 pkgmgrinfo_pkginfo_h handle;
1567 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1568 if (ret != PMINFO_R_OK)
1571 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1572 if (ret != PMINFO_R_OK) {
1573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1576 printf("path : %s\n", path);
1577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1583 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1586 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1587 * @brief This API gets the support_mode of package
1589 * @par Sync (or) Async : Synchronous API
1591 * @param[in] handle pointer to package info handle
1592 * @param[out] support_mode pointer to hold support_mode of package
1593 * @return 0 if success, error code(<0) if fail
1594 * @retval PMINFO_R_OK success
1595 * @retval PMINFO_R_EINVAL invalid argument
1596 * @retval PMINFO_R_ERROR internal error
1598 static int get_support_mode(const char *pkgid)
1601 int support_mode = 0;
1602 pkgmgrinfo_pkginfo_h handle = NULL;
1603 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1604 if (ret != PMINFO_R_OK)
1607 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1608 if (ret != PMINFO_R_OK) {
1609 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1612 printf("support_mode : %s\n", support_mode);
1613 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1619 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1622 * @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)
1623 * @brief This API compare the cert information from given package id
1625 * @par This API is for package-manager client application
1626 * @par Sync (or) Async : Synchronous API
1628 * @param[in] lhs_package_id pointer to first package ID
1629 * @param[in] rhs_package_id pointer to second package ID
1630 * @param[out] compare_result pointer to the compare result.
1631 * @return 0 if success, error code(<0) if fail
1632 * @retval PMINFO_R_OK success
1633 * @retval PMINFO_R_EINVAL invalid argument
1634 * @retval PMINFO_R_ERROR internal error
1636 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1637 * @see pkgmgrinfo_pkginfo_get_pkgid()
1638 * @see pkgmgrinfo_pkginfo_is_removable()
1640 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1643 pkgmgrinfo_cert_compare_result_type_e result;
1645 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1646 if (ret != PMINFO_R_OK) {
1649 printf("result: %d\n", result);
1654 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);
1655 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);
1657 * @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)
1658 * @brief This API compare the cert information from given app id
1660 * @par This API is for package-manager client application
1661 * @par Sync (or) Async : Synchronous API
1663 * @param[in] lhs_app_id pointer to first app ID
1664 * @param[in] rhs_app_id pointer to second app ID
1665 * @param[out] compare_result pointer to the compare result.
1666 * @return 0 if success, error code(<0) if fail
1667 * @retval PMINFO_R_OK success
1668 * @retval PMINFO_R_EINVAL invalid argument
1669 * @retval PMINFO_R_ERROR internal error
1671 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1672 * @see pkgmgrinfo_pkginfo_get_pkgid()
1673 * @see pkgmgrinfo_pkginfo_is_removable()
1675 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1678 pkgmgrinfo_cert_compare_result_type_e result;
1680 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1681 if (ret != PMINFO_R_OK) {
1684 printf("result: %d\n", result);
1689 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);
1690 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);
1692 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1693 * @brief This API gets the package 'removable' value from the package ID
1695 * @par This API is for package-manager client application
1696 * @par Sync (or) Async : Synchronous API
1698 * @param[in] handle pointer to package info handle
1699 * @param[out] removable pointer to hold package removable value
1700 * @return 0 if success, error code(<0) if fail
1701 * @retval PMINFO_R_OK success
1702 * @retval PMINFO_R_EINVAL invalid argument
1703 * @retval PMINFO_R_ERROR internal error
1704 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1705 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1706 * @see pkgmgrinfo_pkginfo_get_pkgid()
1707 * @see pkgmgrinfo_pkginfo_is_readonly()
1709 static int get_pkg_removable(const char *pkgid)
1713 pkgmgrinfo_pkginfo_h handle;
1714 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1715 if (ret != PMINFO_R_OK)
1717 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1718 if (ret != PMINFO_R_OK) {
1719 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1722 printf("pkg removable: %d\n", removable);
1723 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1728 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1731 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1732 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1734 * @par This API is for package-manager client application
1735 * @par Sync (or) Async : Synchronous API
1737 * @param[in] handle pointer to package info handle
1738 * @param[out] movable pointer to hold package movable state
1739 * @return 0 if success, error code(<0) if fail
1740 * @retval PMINFO_R_OK success
1741 * @retval PMINFO_R_EINVAL invalid argument
1742 * @retval PMINFO_R_ERROR internal error
1743 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1744 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1745 * @see pkgmgrinfo_pkginfo_get_pkgid()
1747 static int get_pkg_movable(const char *pkgid)
1751 pkgmgrinfo_pkginfo_h handle;
1752 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1753 if (ret != PMINFO_R_OK)
1755 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1756 if (ret != PMINFO_R_OK) {
1757 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1760 printf("pkg movable: %d\n", movable);
1761 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1766 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1769 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1770 * @brief This API gets the package 'preload' value from the package ID
1772 * @par This API is for package-manager client application
1773 * @par Sync (or) Async : Synchronous API
1775 * @param[in] handle pointer to package info handle
1776 * @param[out] preload pointer to hold package preload value
1777 * @return 0 if success, error code(<0) if fail
1778 * @retval PMINFO_R_OK success
1779 * @retval PMINFO_R_EINVAL invalid argument
1780 * @retval PMINFO_R_ERROR internal error
1781 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1782 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1783 * @see pkgmgrinfo_pkginfo_get_pkgid()
1784 * @see pkgmgrinfo_pkginfo_is_readonly()
1786 static int get_pkg_preload(const char *pkgid)
1790 pkgmgrinfo_pkginfo_h handle;
1791 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1792 if (ret != PMINFO_R_OK)
1794 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1795 if (ret != PMINFO_R_OK) {
1796 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1799 printf("pkg preload: %d\n", preload);
1800 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1805 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1808 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1809 * @brief This API gets the value for given handle is system or not
1811 * @par This API is for package-manager client application
1812 * @par Sync (or) Async : Synchronous API
1814 * @param[in] handle pointer to package info handle
1815 * @param[out] system pointer to hold system is or not
1816 * @return 0 if success, error code(<0) if fail
1817 * @retval PMINFO_R_OK success
1818 * @retval PMINFO_R_EINVAL invalid argument
1819 * @retval PMINFO_R_ERROR internal error
1820 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1821 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1822 * @see pkgmgrinfo_pkginfo_get_pkgid()
1823 * @see pkgmgrinfo_pkginfo_is_readonly()
1825 static int get_pkg_system(const char *pkgid)
1828 bool system = false;
1829 pkgmgrinfo_pkginfo_h handle = NULL;
1830 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1831 if (ret != PMINFO_R_OK)
1833 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1834 if (ret != PMINFO_R_OK) {
1835 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1838 printf("pkg system: %d\n", system);
1839 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1844 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1847 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1848 * @brief This API gets the package 'readonly' value from the package ID
1850 * @par This API is for package-manager client application
1851 * @par Sync (or) Async : Synchronous API
1853 * @param[in] handle pointer to package info handle
1854 * @param[out] readonly pointer to hold package readonly value
1855 * @return 0 if success, error code(<0) if fail
1856 * @retval PMINFO_R_OK success
1857 * @retval PMINFO_R_EINVAL invalid argument
1858 * @retval PMINFO_R_ERROR internal error
1859 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1860 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1861 * @see pkgmgrinfo_pkginfo_get_pkgid()
1862 * @see pkgmgrinfo_pkginfo_is_removable()
1864 static int get_pkg_readonly(const char *pkgid)
1868 pkgmgrinfo_pkginfo_h handle;
1869 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1870 if (ret != PMINFO_R_OK)
1872 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1873 if (ret != PMINFO_R_OK) {
1874 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1877 printf("pkg readonly: %d\n", readonly);
1878 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1883 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1887 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1888 * @brief This API gets the package 'upate' value from the package ID
1890 * @par This API is for package-manager client application
1891 * @par Sync (or) Async : Synchronous API
1893 * @param[in] handle pointer to package info handle
1894 * @param[out] update pointer to hold package update value
1895 * @return 0 if success, error code(<0) if fail
1896 * @retval PMINFO_R_OK success
1897 * @retval PMINFO_R_EINVAL invalid argument
1898 * @retval PMINFO_R_ERROR internal error
1899 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1900 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1901 * @see pkgmgrinfo_pkginfo_get_pkgid()
1903 static int get_pkg_update(const char *pkgid)
1907 pkgmgrinfo_pkginfo_h handle;
1908 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1909 if (ret != PMINFO_R_OK)
1911 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1912 if (ret != PMINFO_R_OK) {
1913 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1916 printf("pkg update: %d\n", update);
1917 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1922 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1925 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1926 * @brief This API gets the package 'support_disable' value from the package ID
1928 * @par This API is for package-manager client application
1929 * @par Sync (or) Async : Synchronous API
1931 * @param[in] handle pointer to package info handle
1932 * @param[out] support_disable pointer to hold package support_disable value
1933 * @return 0 if success, error code(<0) if fail
1934 * @retval PMINFO_R_OK success
1935 * @retval PMINFO_R_EINVAL invalid argument
1936 * @retval PMINFO_R_ERROR internal error
1937 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1938 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1939 * @see pkgmgrinfo_pkginfo_get_pkgid()
1941 static int get_pkg_support_disable(const char *pkgid)
1944 bool support_disable;
1945 pkgmgrinfo_pkginfo_h handle = NULL;
1946 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1947 if (ret != PMINFO_R_OK)
1949 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1950 if (ret != PMINFO_R_OK) {
1951 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1954 printf("pkg support_disable: %d\n", support_disable);
1955 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1960 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1963 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1964 * @brief This API gets whethere the given package is global package or user package
1966 * @par This API is for package-manager client application
1967 * @par Sync (or) Async : Synchronous API
1969 * @param[in] handle pointer to package info handle
1970 * @param[in] global pointer to hold package global value
1971 * @return 0 if success, error code(<0) if fail
1972 * @retval PMINFO_R_OK success
1973 * @retval PMINFO_R_EINVAL invalid argument
1974 * @retval PMINFO_R_ERROR internal error
1975 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1976 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1977 * @see pkgmgrinfo_pkginfo_get_pkgid()
1978 static int get_pkg_support_disable(const char *pkgid)
1982 pkgmgrinfo_pkginfo_h handle = NULL;
1983 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1984 if (ret != PMINFO_R_OK)
1986 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1987 if (ret != PMINFO_R_OK) {
1988 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1991 printf("pkg is_global: %d\n", global);
1992 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1997 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2000 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2001 * @brief This API gets the package 'accessible' value from the package ID
2003 * @par This API is for package-manager client application
2004 * @par Sync (or) Async : Synchronous API
2006 * @param[in] handle pointer to package info handle
2007 * @param[out] accessible pointer to hold package accessible value
2008 * @return 0 if success, error code(<0) if fail
2009 * @retval PMINFO_R_OK success
2010 * @retval PMINFO_R_EINVAL invalid argument
2011 * @retval PMINFO_R_ERROR internal error
2012 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2013 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2014 * @see pkgmgrinfo_pkginfo_get_pkgid()
2015 * @see pkgmgrinfo_pkginfo_is_readonly()
2017 static int get_pkg_accessible(const char *pkgid)
2021 pkgmgrinfo_pkginfo_h handle;
2022 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2023 if (ret != PMINFO_R_OK)
2025 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2026 if (ret != PMINFO_R_OK) {
2027 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2030 printf("pkg accessible: %d\n", accessible);
2031 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2036 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2039 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2040 * @brief This API destroys the package information handle freeing up all the resources
2042 * @par This API is for package-manager client application
2043 * @par Sync (or) Async : Synchronous API
2045 * @param[in] handle pointer to the package info handle
2046 * @return 0 if success, error code(<0) if fail
2047 * @retval PMINFO_R_OK success
2048 * @retval PMINFO_R_EINVAL invalid argument
2049 * @retval PMINFO_R_ERROR internal error
2050 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2052 * @see pkgmgrinfo_pkginfo_get_pkgid()
2053 * @see pkgmgrinfo_pkginfo_is_removable()
2055 static int get_pkg_type(const char *pkgid)
2059 pkgmgrinfo_pkginfo_h handle;
2060 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2061 if (ret != PMINFO_R_OK)
2063 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2064 if (ret != PMINFO_R_OK) {
2065 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2068 printf("pkgtype: %s\n", type);
2069 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2074 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2077 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2078 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2079 The query will search the entire package information collected from the manifest file of all the installed packages
2081 * @par This API is for package-manager client application
2082 * @par Sync (or) Async : Synchronous API
2084 * @param[out] handle pointer to the package info filter handle.
2085 * @return 0 if success, error code(<0) if fail
2086 * @retval PMINFO_R_OK success
2087 * @retval PMINFO_R_EINVAL invalid argument
2088 * @retval PMINFO_R_ERROR internal error
2090 * @post pkgmgrinfo_pkginfo_filter_destroy()
2091 * @see pkgmgrinfo_pkginfo_filter_count()
2092 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2094 static int get_tpk_pkg_count()
2098 pkgmgrinfo_pkginfo_filter_h handle;
2099 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2100 if (ret != PMINFO_R_OK)
2102 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2103 if (ret != PMINFO_R_OK) {
2104 pkgmgrinfo_pkginfo_filter_destroy(handle);
2107 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2108 if (ret != PMINFO_R_OK) {
2109 pkgmgrinfo_pkginfo_filter_destroy(handle);
2112 printf("No of tpk pkgs: %d\n", count);
2113 pkgmgrinfo_pkginfo_filter_destroy(handle);
2118 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2121 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2122 * @brief This API destroys the package information filter handle freeing up all the resources
2124 * @par This API is for package-manager client application
2125 * @par Sync (or) Async : Synchronous API
2127 * @param[in] handle pointer to the package info filter handle.
2128 * @return 0 if success, error code(<0) if fail
2129 * @retval PMINFO_R_OK success
2130 * @retval PMINFO_R_EINVAL invalid argument
2131 * @retval PMINFO_R_ERROR internal error
2132 * @pre pkgmgrinfo_pkginfo_filter_create()
2134 * @see pkgmgrinfo_pkginfo_filter_count()
2135 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2137 static int get_tpk_pkg_count()
2141 pkgmgrinfo_pkginfo_filter_h handle;
2142 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2143 if (ret != PMINFO_R_OK)
2145 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2146 if (ret != PMINFO_R_OK) {
2147 pkgmgrinfo_pkginfo_filter_destroy(handle);
2150 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2151 if (ret != PMINFO_R_OK) {
2152 pkgmgrinfo_pkginfo_filter_destroy(handle);
2155 printf("No of tpk pkgs: %d\n", count);
2156 pkgmgrinfo_pkginfo_filter_destroy(handle);
2161 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2164 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2165 * @brief This API adds a boolean filter property to the filter handle
2167 * @par This API is for package-manager client application
2168 * @par Sync (or) Async : Synchronous API
2170 * @param[in] handle pointer to the package info filter handle.
2171 * @param[in] property boolean property name.
2172 * @param[in] value value corresponding to the property.
2173 * @return 0 if success, error code(<0) if fail
2174 * @retval PMINFO_R_OK success
2175 * @retval PMINFO_R_EINVAL invalid argument
2176 * @retval PMINFO_R_ERROR internal error
2177 * @pre pkgmgrinfo_pkginfo_filter_create()
2178 * @post pkgmgrinfo_pkginfo_filter_destroy()
2179 * @see pkgmgrinfo_pkginfo_filter_count()
2180 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2182 static int get_preload_pkg_count()
2186 pkgmgrinfo_pkginfo_filter_h handle;
2187 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2188 if (ret != PMINFO_R_OK)
2190 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2191 if (ret != PMINFO_R_OK) {
2192 pkgmgrinfo_pkginfo_filter_destroy(handle);
2195 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2196 if (ret != PMINFO_R_OK) {
2197 pkgmgrinfo_pkginfo_filter_destroy(handle);
2200 printf("No of preload pkgs: %d\n", count);
2201 pkgmgrinfo_pkginfo_filter_destroy(handle);
2206 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2207 const char *property, const bool value);
2210 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2211 * @brief This API adds an integer filter property to the filter handle
2213 * @par This API is for package-manager client application
2214 * @par Sync (or) Async : Synchronous API
2216 * @param[in] handle pointer to the package info filter handle.
2217 * @param[in] property integer property name.
2218 * @param[in] value value corresponding to the property.
2219 * @return 0 if success, error code(<0) if fail
2220 * @retval PMINFO_R_OK success
2221 * @retval PMINFO_R_EINVAL invalid argument
2222 * @retval PMINFO_R_ERROR internal error
2223 * @pre pkgmgrinfo_pkginfo_filter_create()
2224 * @post pkgmgrinfo_pkginfo_filter_destroy()
2225 * @see pkgmgrinfo_pkginfo_filter_count()
2226 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2228 static int get_pkg_count()
2232 pkgmgrinfo_pkginfo_filter_h handle;
2233 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2234 if (ret != PMINFO_R_OK)
2236 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2237 if (ret != PMINFO_R_OK) {
2238 pkgmgrinfo_pkginfo_filter_destroy(handle);
2241 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2242 if (ret != PMINFO_R_OK) {
2243 pkgmgrinfo_pkginfo_filter_destroy(handle);
2246 printf("No of preload pkgs: %d\n", count);
2247 pkgmgrinfo_pkginfo_filter_destroy(handle);
2252 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2253 const char *property, const int value);
2256 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2257 * @brief This API adds a string filter property to the filter handle
2259 * @par This API is for package-manager client application
2260 * @par Sync (or) Async : Synchronous API
2262 * @param[in] handle pointer to the package info filter handle.
2263 * @param[in] property string property name.
2264 * @param[in] value value corresponding to the property.
2265 * @return 0 if success, error code(<0) if fail
2266 * @retval PMINFO_R_OK success
2267 * @retval PMINFO_R_EINVAL invalid argument
2268 * @retval PMINFO_R_ERROR internal error
2269 * @pre pkgmgrinfo_pkginfo_filter_create()
2270 * @post pkgmgrinfo_pkginfo_filter_destroy()
2271 * @see pkgmgrinfo_pkginfo_filter_count()
2272 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2274 static int get_tpk_pkg_count()
2278 pkgmgrinfo_pkginfo_filter_h handle;
2279 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2280 if (ret != PMINFO_R_OK)
2282 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2283 if (ret != PMINFO_R_OK) {
2284 pkgmgrinfo_pkginfo_filter_destroy(handle);
2287 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2288 if (ret != PMINFO_R_OK) {
2289 pkgmgrinfo_pkginfo_filter_destroy(handle);
2292 printf("No of tpk pkgs: %d\n", count);
2293 pkgmgrinfo_pkginfo_filter_destroy(handle);
2298 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2299 const char *property, const char *value);
2302 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2303 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2305 * @par This API is for package-manager client application
2306 * @par Sync (or) Async : Synchronous API
2308 * @param[in] handle pointer to the package info filter handle.
2309 * @param[in] pkg_cb callback function.
2310 * @param[in] user_data user data to be passed to the callback function
2311 * @return 0 if success, error code(<0) if fail
2312 * @retval PMINFO_R_OK success
2313 * @retval PMINFO_R_EINVAL invalid argument
2314 * @retval PMINFO_R_ERROR internal error
2315 * @pre pkgmgrinfo_pkginfo_filter_create()
2316 * @post pkgmgrinfo_pkginfo_filter_destroy()
2317 * @see pkgmgrinfo_pkginfo_filter_count()
2319 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2322 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2323 printf("pkg id : %s\n", pkgid);
2327 static int get_tpk_pkg_list()
2330 pkgmgrinfo_pkginfo_filter_h handle;
2331 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2332 if (ret != PMINFO_R_OK)
2334 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2335 if (ret != PMINFO_R_OK) {
2336 pkgmgrinfo_pkginfo_filter_destroy(handle);
2339 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2340 if (ret != PMINFO_R_OK) {
2341 pkgmgrinfo_pkginfo_filter_destroy(handle);
2344 pkgmgrinfo_pkginfo_filter_destroy(handle);
2349 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2350 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2351 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2352 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2355 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2356 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2357 * @brief This API counts the package that satisfy the filter conditions
2359 * @par This API is for package-manager client application
2360 * @par Sync (or) Async : Synchronous API
2362 * @param[in] handle pointer to the package info filter handle.
2363 * @param[in] count pointer to store the count value.
2364 * @param[in] uid the addressee user id of the instruction
2365 * @return 0 if success, error code(<0) if fail
2366 * @retval PMINFO_R_OK success
2367 * @retval PMINFO_R_EINVAL invalid argument
2368 * @retval PMINFO_R_ERROR internal error
2369 * @pre pkgmgrinfo_pkginfo_filter_create()
2370 * @post pkgmgrinfo_pkginfo_filter_destroy()
2371 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2373 static int get_tpk_pkg_count()
2377 pkgmgrinfo_pkginfo_filter_h handle;
2378 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2379 if (ret != PMINFO_R_OK)
2381 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2382 if (ret != PMINFO_R_OK) {
2383 pkgmgrinfo_pkginfo_filter_destroy(handle);
2386 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2387 if (ret != PMINFO_R_OK) {
2388 pkgmgrinfo_pkginfo_filter_destroy(handle);
2391 printf("No of tpk pkgs: %d\n", count);
2392 pkgmgrinfo_pkginfo_filter_destroy(handle);
2397 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2398 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2401 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2402 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2403 * @brief This API gets the list of privilege for a particular package
2405 * @par This API is for package-manager client application
2406 * @par Sync (or) Async : Synchronous API
2407 * @param[in] handle pointer to the package info handle.
2408 * @param[in] privilege_func callback function for list
2409 * @param[in] user_data user data to be passed to callback function
2410 * @return 0 if success, error code(<0) if fail
2411 * @retval PMINFO_R_OK success
2412 * @retval PMINFO_R_EINVAL invalid argument
2413 * @retval PMINFO_R_ERROR internal error
2414 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2415 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2417 int privilege_func(const char *name, void *user_data)
2419 if (strcmp(name, (char *)user_data) == 0)
2425 static int list_privilege(const char *package, char *privilege)
2428 pkgmgrinfo_pkginfo_h handle;
2429 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2430 if (ret != PMINFO_R_OK)
2432 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2433 if (ret != PMINFO_R_OK) {
2434 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2437 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2442 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2443 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2446 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2447 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2448 * @brief This API gets the list of appdefined privilege for a particular package
2450 * @par This API is for package-manager client application
2451 * @par Sync (or) Async : Synchronous API
2452 * @param[in] handle pointer to the package info handle.
2453 * @param[in] privilege_func callback function for list
2454 * @param[in] user_data user data to be passed to callback function
2455 * @return 0 if success, error code(<0) if fail
2456 * @retval PMINFO_R_OK success
2457 * @retval PMINFO_R_EINVAL invalid argument
2458 * @retval PMINFO_R_ERROR internal error
2459 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2460 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2462 int privilege_func(const char *name, const char *license_path, void *user_data)
2464 printf("appdefined privilege : %s", name);
2466 printf("licensed privilege, lecense path : %s", license_path);
2470 static int list_appdefined_privilege(const char *package)
2473 pkgmgrinfo_pkginfo_h handle;
2474 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2475 if (ret != PMINFO_R_OK)
2477 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2478 if (ret != PMINFO_R_OK) {
2479 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2482 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2487 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2488 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2490 /* TODO: add doxygen comment here */
2491 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2494 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2495 * @brief This API copy the application information handle
2497 * @par This API is for package-manager client application
2498 * @par Sync (or) Async : Synchronous API
2500 * @param[in] handle pointer to the package info handle.
2501 * @param[out] handle pointer to the package info handle.
2502 * @return 0 if success, error code(<0) if fail
2503 * @retval PMINFO_R_OK success
2504 * @retval PMINFO_R_EINVAL invalid argument
2505 * @retval PMINFO_R_ERROR internal error
2507 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2509 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2513 pkgmgrinfo_pkginfo_h clone;
2515 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2516 if (ret != PMINFO_R_OK)
2520 printf("package: %s\n", clone->package);
2521 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2526 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2530 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2531 pkgmgrinfo_app_list_cb app_func, void *user_data)
2532 * @brief This API gets list of installed applications for a particular package
2534 * @par This API is for package-manager client application
2535 * @par Sync (or) Async : Synchronous API
2536 * @param[in] handle package info handle
2537 * @param[in] component application component
2538 * @param[in] app_func iteration function for list
2539 * @param[in] user_data user data to be passed to callback function
2540 * @return 0 if success, error code(<0) if fail
2541 * @retval PMINFO_R_OK success
2542 * @retval PMINFO_R_EINVAL invalid argument
2543 * @retval PMINFO_R_ERROR internal error
2544 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2545 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2547 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2550 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2551 printf("appid : %s\n", appid);
2555 static int list_apps(const char *pkgid)
2558 pkgmgrinfo_pkginfo_h handle;
2559 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2560 if (ret != PMINFO_R_OK)
2562 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2563 if (ret != PMINFO_R_OK) {
2564 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2567 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2572 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2573 pkgmgrinfo_app_list_cb app_func, void *user_data);
2574 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2575 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2578 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2579 * @brief This API gets list of installed applications from all packages with minimum informaion.
2581 * @par This API is for package-manager client application
2582 * @par Sync (or) Async : Synchronous API
2583 * @param[in] app_func iteration function for list
2584 * @param[in] user_data user data to be passed to callback function
2585 * @return 0 if success, error code(<0) if fail
2586 * @retval PMINFO_R_OK success
2587 * @retval PMINFO_R_EINVAL invalid argument
2588 * @retval PMINFO_R_ERROR internal error
2592 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2594 char *pkgid1 = NULL;
2595 char *pkgid2 = NULL;
2596 pkgid1 = (char *)user_data;
2597 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2598 if (strcmp(pkgid1, pkgid2) == 0) {
2605 static int list_apps()
2608 char *name = "helloworld";
2609 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2610 if (ret != PMINFO_R_OK) {
2617 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2618 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2621 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2622 * @brief This API gets list of installed applications from all packages.
2624 * @par This API is for package-manager client application
2625 * @par Sync (or) Async : Synchronous API
2626 * @param[in] app_func iteration function for list
2627 * @param[in] user_data user data to be passed to callback function
2628 * @return 0 if success, error code(<0) if fail
2629 * @retval PMINFO_R_OK success
2630 * @retval PMINFO_R_EINVAL invalid argument
2631 * @retval PMINFO_R_ERROR internal error
2635 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2637 char *pkgid1 = NULL;
2638 char *pkgid2 = NULL;
2639 pkgid1 = (char *)user_data;
2640 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2641 if (strcmp(pkgid1, pkgid2) == 0) {
2648 static int list_apps()
2651 char *name = "helloworld";
2652 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2653 if (ret != PMINFO_R_OK) {
2660 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2661 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2664 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2665 * @brief This API creates the disabled application information handle from db
2667 * @par This API is for package-manager client application
2668 * @par Sync (or) Async : Synchronous API
2670 * @param[in] appid pointer to appid
2671 * @param[out] handle pointer to the application info handle.
2672 * @return 0 if success, error code(<0) if fail
2673 * @retval PMINFO_R_OK success
2674 * @retval PMINFO_R_EINVAL invalid argument
2675 * @retval PMINFO_R_ERROR internal error
2677 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2678 * @see pkgmgrinfo_appinfo_get_pkgid()
2679 * @see pkgmgrinfo_appinfo_is_multiple()
2681 static int get_disabled_app_type(const char *appid)
2685 pkgmgrinfo_appinfo_h handle;
2686 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2687 if (ret != PMINFO_R_OK)
2689 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2690 if (ret != PMINFO_R_OK) {
2691 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2694 printf("apptype: %s\n", type);
2695 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2700 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2701 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2704 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2705 * @brief This API creates the application information handle from db
2707 * @par This API is for package-manager client application
2708 * @par Sync (or) Async : Synchronous API
2710 * @param[in] appid pointer to appid
2711 * @param[out] handle pointer to the application info handle.
2712 * @return 0 if success, error code(<0) if fail
2713 * @retval PMINFO_R_OK success
2714 * @retval PMINFO_R_EINVAL invalid argument
2715 * @retval PMINFO_R_ERROR internal error
2717 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2718 * @see pkgmgrinfo_appinfo_get_pkgid()
2719 * @see pkgmgrinfo_appinfo_is_multiple()
2721 static int get_app_type(const char *appid)
2725 pkgmgrinfo_appinfo_h handle;
2726 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2727 if (ret != PMINFO_R_OK)
2729 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2730 if (ret != PMINFO_R_OK) {
2731 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2734 printf("apptype: %s\n", type);
2735 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2740 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2741 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2744 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2745 * @brief This API creates the application information handle from db regardless of its disable or storage status
2747 * @par This API is for package-manager client application
2748 * @par Sync (or) Async : Synchronous API
2750 * @param[in] appid pointer to appid
2751 * @param[out] handle pointer to the application info handle.
2752 * @return 0 if success, error code(<0) if fail
2753 * @retval PMINFO_R_OK success
2754 * @retval PMINFO_R_EINVAL invalid argument
2755 * @retval PMINFO_R_ERROR internal error
2757 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2758 * @see pkgmgrinfo_appinfo_get_pkgid()
2759 * @see pkgmgrinfo_appinfo_is_multiple()
2761 static int get_app_type(const char *appid)
2765 pkgmgrinfo_appinfo_h handle;
2766 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2767 if (ret != PMINFO_R_OK)
2769 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2770 if (ret != PMINFO_R_OK) {
2771 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2774 printf("apptype: %s\n", type);
2775 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2780 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2781 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2784 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2785 * @brief This API gets the application ID
2787 * @par This API is for package-manager client application
2788 * @par Sync (or) Async : Synchronous API
2790 * @param[in] handle pointer to the application info handle.
2791 * @param[out] appid pointer to hold appid
2792 * @return 0 if success, error code(<0) if fail
2793 * @retval PMINFO_R_OK success
2794 * @retval PMINFO_R_EINVAL invalid argument
2795 * @retval PMINFO_R_ERROR internal error
2796 * @pre pkgmgrinfo_appinfo_get_appinfo()
2797 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2798 * @see pkgmgrinfo_appinfo_get_pkgid()
2799 * @see pkgmgrinfo_appinfo_is_multiple()
2801 static int get_app_id(const char *appid)
2804 char *app_id = NULL;
2805 pkgmgrinfo_appinfo_h handle;
2806 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2807 if (ret != PMINFO_R_OK)
2809 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2810 if (ret != PMINFO_R_OK) {
2811 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2814 printf("app id: %s\n", app_id);
2815 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2820 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2823 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2824 * @brief This API gets the package name of the application
2826 * @par This API is for package-manager client application
2827 * @par Sync (or) Async : Synchronous API
2829 * @param[in] handle pointer to the application info handle.
2830 * @param[out] pkg_name pointer to hold package name
2831 * @return 0 if success, error code(<0) if fail
2832 * @retval PMINFO_R_OK success
2833 * @retval PMINFO_R_EINVAL invalid argument
2834 * @retval PMINFO_R_ERROR internal error
2835 * @pre pkgmgrinfo_appinfo_get_appinfo()
2836 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2837 * @see pkgmgrinfo_appinfo_get_appid()
2838 * @see pkgmgrinfo_appinfo_is_multiple()
2840 static int get_app_pkgname(const char *appid)
2843 char *pkgname = NULL;
2844 pkgmgrinfo_appinfo_h handle;
2845 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2846 if (ret != PMINFO_R_OK)
2848 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2849 if (ret != PMINFO_R_OK) {
2850 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2853 printf("pkg name: %s\n", pkgname);
2854 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2859 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2862 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2863 * @brief This API gets the package id of the application
2865 * @par This API is for package-manager client application
2866 * @par Sync (or) Async : Synchronous API
2868 * @param[in] handle pointer to the application info handle.
2869 * @param[out] pkgid pointer to hold package id
2870 * @return 0 if success, error code(<0) if fail
2871 * @retval PMINFO_R_OK success
2872 * @retval PMINFO_R_EINVAL invalid argument
2873 * @retval PMINFO_R_ERROR internal error
2874 * @pre pkgmgrinfo_appinfo_get_appinfo()
2875 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2876 * @see pkgmgrinfo_appinfo_get_appid()
2877 * @see pkgmgrinfo_appinfo_is_multiple()
2879 static int get_app_pkgid(const char *appid)
2883 pkgmgrinfo_appinfo_h handle;
2884 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2885 if (ret != PMINFO_R_OK)
2887 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2888 if (ret != PMINFO_R_OK) {
2889 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2892 printf("pkg id: %s\n", pkgid);
2893 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2898 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2901 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2902 * @brief This API gets the package type of the application
2904 * @par This API is for package-manager client application
2905 * @par Sync (or) Async : Synchronous API
2907 * @param[in] handle pointer to the application info handle.
2908 * @param[out] pkgtype pointer to hold package type
2909 * @return 0 if success, error code(<0) if fail
2910 * @retval PMINFO_R_OK success
2911 * @retval PMINFO_R_EINVAL invalid argument
2912 * @retval PMINFO_R_ERROR internal error
2913 * @pre pkgmgrinfo_appinfo_get_appinfo()
2914 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2915 * @see pkgmgrinfo_appinfo_get_appid()
2916 * @see pkgmgrinfo_appinfo_is_multiple()
2918 static int get_app_pkgtype(const char *appid)
2921 char *pkgtype = NULL;
2922 pkgmgrinfo_appinfo_h handle = NULL;
2923 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2924 if (ret != PMINFO_R_OK)
2926 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2927 if (ret != PMINFO_R_OK) {
2928 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2931 printf("pkgtype: %s\n", pkgtype);
2932 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2937 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2940 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2941 * @brief This API gets the executable name of the application
2943 * @par This API is for package-manager client application
2944 * @par Sync (or) Async : Synchronous API
2946 * @param[in] handle pointer to the application info handle.
2947 * @param[out] exec pointer to hold app exec name
2948 * @return 0 if success, error code(<0) if fail
2949 * @retval PMINFO_R_OK success
2950 * @retval PMINFO_R_EINVAL invalid argument
2951 * @retval PMINFO_R_ERROR internal error
2952 * @pre pkgmgrinfo_appinfo_get_appinfo()
2953 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2954 * @see pkgmgrinfo_appinfo_get_appid()
2955 * @see pkgmgrinfo_appinfo_is_multiple()
2957 static int get_app_exec(const char *appid)
2961 pkgmgrinfo_appinfo_h handle;
2962 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2963 if (ret != PMINFO_R_OK)
2965 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2966 if (ret != PMINFO_R_OK) {
2967 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2970 printf("exec name: %s\n", exec);
2971 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2976 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2979 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2980 * @brief This API gets the icon name of the application
2982 * @par This API is for package-manager client application
2983 * @par Sync (or) Async : Synchronous API
2985 * @param[in] handle pointer to the application info handle.
2986 * @param[out] icon pointer to hold app icon name
2987 * @return 0 if success, error code(<0) if fail
2988 * @retval PMINFO_R_OK success
2989 * @retval PMINFO_R_EINVAL invalid argument
2990 * @retval PMINFO_R_ERROR internal error
2991 * @pre pkgmgrinfo_appinfo_get_appinfo()
2992 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2993 * @see pkgmgrinfo_appinfo_get_appid()
2994 * @see pkgmgrinfo_appinfo_is_multiple()
2996 static int get_app_icon(const char *appid)
3000 pkgmgrinfo_appinfo_h handle;
3001 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3002 if (ret != PMINFO_R_OK)
3004 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3005 if (ret != PMINFO_R_OK) {
3006 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3009 printf("icon name: %s\n", icon);
3010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3015 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3018 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3019 * @brief This API gets the label of the application
3021 * @par This API is for package-manager client application
3022 * @par Sync (or) Async : Synchronous API
3024 * @param[in] handle pointer to the application info handle.
3025 * @param[out] label pointer to hold app label
3026 * @return 0 if success, error code(<0) if fail
3027 * @retval PMINFO_R_OK success
3028 * @retval PMINFO_R_EINVAL invalid argument
3029 * @retval PMINFO_R_ERROR internal error
3030 * @pre pkgmgrinfo_appinfo_get_appinfo()
3031 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3032 * @see pkgmgrinfo_appinfo_get_appid()
3033 * @see pkgmgrinfo_appinfo_is_multiple()
3035 static int get_app_label(const char *appid)
3039 pkgmgrinfo_appinfo_h handle;
3040 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3041 if (ret != PMINFO_R_OK)
3043 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3044 if (ret != PMINFO_R_OK) {
3045 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3048 printf("label : %s\n", label);
3049 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3054 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3057 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3058 * @brief This API gets exactly matched label by given appid and locale
3060 * @par This API is for package-manager client application
3061 * @par Sync (or) Async : Synchronous API
3063 * @param[in] appid pointer to appid
3064 * @param[in] locale pointer to locale
3065 * @param[out] label pointer to hold app label
3066 * @return 0 if success, error code(<0) if fail
3067 * @retval PMINFO_R_OK success
3068 * @retval PMINFO_R_EINVAL invalid argument
3069 * @retval PMINFO_R_ERROR internal error
3071 static int get_localed_label(const char *appid, const char *locale)
3076 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3077 if (ret != PMINFO_R_OK)
3080 printf("localed label: %s\n", label);
3088 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3089 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3092 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3093 * @brief This API gets metadata value by given metadata key
3095 * @par This API is for package-manager client application
3096 * @par Sync (or) Async : Synchronous API
3098 * @param[in] handle pointer to the application info handle
3099 * @param[in] metadata_key metadata key
3100 * @param[out] metadata_value pointer to hold metadata value
3101 * @return 0 if success, error code(<0) if fail
3102 * @retval PMINFO_R_OK success
3103 * @retval PMINFO_R_EINVAL invalid argument
3105 static int get_metadata_value(const char *appid, const char *metadata_key)
3108 pkgmgrinfo_appinfo_h handle = NULL;
3109 char *metadata_value = NULL;
3111 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3112 if (ret != PMINFO_R_OK)
3115 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3116 if (ret != PMINFO_R_OK) {
3117 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3121 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3126 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3129 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3130 * @brief This API gets the component of the application
3132 * @par This API is for package-manager client application
3133 * @par Sync (or) Async : Synchronous API
3135 * @param[in] handle pointer to the application info handle.
3136 * @param[out] component pointer to hold app component
3137 * @return 0 if success, error code(<0) if fail
3138 * @retval PMINFO_R_OK success
3139 * @retval PMINFO_R_EINVAL invalid argument
3140 * @retval PMINFO_R_ERROR internal error
3141 * @pre pkgmgrinfo_appinfo_get_appinfo()
3142 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3143 * @see pkgmgrinfo_appinfo_get_appid()
3144 * @see pkgmgrinfo_appinfo_is_multiple()
3146 static int get_app_component(const char *appid)
3149 pkgmgrinfo_app_component component;
3150 pkgmgrinfo_appinfo_h handle;
3151 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3152 if (ret != PMINFO_R_OK)
3154 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3155 if (ret != PMINFO_R_OK) {
3156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3159 printf("component : %s\n", component);
3160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3165 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3168 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3169 * @brief This API gets the apptype of the application
3171 * @par This API is for package-manager client application
3172 * @par Sync (or) Async : Synchronous API
3174 * @param[in] handle pointer to the application info handle.
3175 * @param[out] app_type pointer to hold apptype
3176 * @return 0 if success, error code(<0) if fail
3177 * @retval PMINFO_R_OK success
3178 * @retval PMINFO_R_EINVAL invalid argument
3179 * @retval PMINFO_R_ERROR internal error
3180 * @pre pkgmgrinfo_appinfo_get_appinfo()
3181 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3182 * @see pkgmgrinfo_appinfo_get_appid()
3183 * @see pkgmgrinfo_appinfo_is_multiple()
3185 static int get_app_type(const char *appid)
3188 char *apptype = NULL;
3189 pkgmgrinfo_appinfo_h handle;
3190 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3191 if (ret != PMINFO_R_OK)
3193 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3194 if (ret != PMINFO_R_OK) {
3195 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3198 printf("apptype : %s\n", apptype);
3199 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3204 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3207 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3208 int *operation_count, char ***operation)
3209 * @brief This API gets the list of operation of the application
3211 * @par This API is for package-manager client application
3212 * @par Sync (or) Async : Synchronous API
3214 * @param[in] handle pointer to the appcontrol handle.
3215 * @param[out] operation_count pointer to hold number of operations
3216 * @param[out] operation pointer to hold list of operations
3217 * @return 0 if success, error code(<0) if fail
3218 * @retval PMINFO_R_OK success
3219 * @retval PMINFO_R_EINVAL invalid argument
3220 * @retval PMINFO_R_ERROR internal error
3221 * @pre pkgmgrinfo_appinfo_get_appinfo()
3222 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3223 * @see pkgmgrinfo_appinfo_get_uri()
3224 * @see pkgmgrinfo_appinfo_get_mime()
3226 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3231 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3232 for (i = 0; i < oc; i++) {
3233 if (strcmp(operation[i], (char *)user_data) == 0)
3240 static int check_operation(const char *appid, char *operation)
3243 pkgmgrinfo_appinfo_h handle;
3244 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3245 if (ret != PMINFO_R_OK)
3247 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3248 if (ret != PMINFO_R_OK) {
3249 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3252 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3257 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3258 int *operation_count, char ***operation);
3261 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3262 int *uri_count, char ***uri)
3263 * @brief This API gets the list of uri of the application
3265 * @par This API is for package-manager client application
3266 * @par Sync (or) Async : Synchronous API
3268 * @param[in] handle pointer to the appcontrol handle.
3269 * @param[out] uri_count pointer to hold number of uris
3270 * @param[out] uri pointer to hold list of uris
3271 * @return 0 if success, error code(<0) if fail
3272 * @retval PMINFO_R_OK success
3273 * @retval PMINFO_R_EINVAL invalid argument
3274 * @retval PMINFO_R_ERROR internal error
3275 * @pre pkgmgrinfo_appinfo_get_appinfo()
3276 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3277 * @see pkgmgrinfo_appinfo_get_operation()
3278 * @see pkgmgrinfo_appinfo_get_mime()
3280 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3285 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
3286 for (i = 0; i < uc; i++) {
3287 if (strcmp(uri[i], (char *)user_data) == 0)
3294 static int check_uri(const char *appid, char *uri)
3297 pkgmgrinfo_appinfo_h handle;
3298 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3299 if (ret != PMINFO_R_OK)
3301 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
3302 if (ret != PMINFO_R_OK) {
3303 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3306 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3311 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3312 int *uri_count, char ***uri);
3315 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3316 int *mime_count, char ***mime)
3317 * @brief This API gets the list of mime of the application
3319 * @par This API is for package-manager client application
3320 * @par Sync (or) Async : Synchronous API
3322 * @param[in] handle pointer to the appcontrol handle.
3323 * @param[out] mime_count pointer to hold number of mimes
3324 * @param[out] mime pointer to hold list of mimes
3325 * @return 0 if success, error code(<0) if fail
3326 * @retval PMINFO_R_OK success
3327 * @retval PMINFO_R_EINVAL invalid argument
3328 * @retval PMINFO_R_ERROR internal error
3329 * @pre pkgmgrinfo_appinfo_get_appinfo()
3330 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3331 * @see pkgmgrinfo_appinfo_get_uri()
3332 * @see pkgmgrinfo_appinfo_get_operation()
3334 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3339 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
3340 for (i = 0; i < mc; i++) {
3341 if (strcmp(mime[i], (char *)user_data) == 0)
3348 static int check_mime(const char *appid, char *mime)
3351 pkgmgrinfo_appinfo_h handle;
3352 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3353 if (ret != PMINFO_R_OK)
3355 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3356 if (ret != PMINFO_R_OK) {
3357 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3360 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3365 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3366 int *mime_count, char ***mime);
3369 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3370 int *subapp_count, char ***subapp)
3371 * @brief This API gets the list of subapp of the application
3373 * @par This API is for package-manager client application
3374 * @par Sync (or) Async : Synchronous API
3376 * @param[in] handle pointer to the appcontrol handle.
3377 * @param[out] subapp_count pointer to hold number of subapp
3378 * @param[out] subapp pointer to hold list of subapp
3379 * @return 0 if success, error code(<0) if fail
3380 * @retval PMINFO_R_OK success
3381 * @retval PMINFO_R_EINVAL invalid argument
3382 * @retval PMINFO_R_ERROR internal error
3383 * @pre pkgmgrinfo_appinfo_get_appinfo()
3384 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3385 * @see pkgmgrinfo_appinfo_get_uri()
3386 * @see pkgmgrinfo_appinfo_get_operation()
3388 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3392 char **subapp = NULL;
3393 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3394 for (i = 0; i < sc; i++) {
3395 if (strcmp(subapp[i], (char *)user_data) == 0)
3402 static int check_subapp(const char *appid, char *subapp)
3405 pkgmgrinfo_appinfo_h handle = NULL;
3406 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3407 if (ret != PMINFO_R_OK)
3409 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3410 if (ret != PMINFO_R_OK) {
3411 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3419 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3420 int *subapp_count, char ***subapp);
3423 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3424 * @brief This API gets the notification icon of the application
3426 * @par This API is for package-manager client application
3427 * @par Sync (or) Async : Synchronous API
3429 * @param[in] handle pointer to the application info handle.
3430 * @param[out] path pointer to hold notification icon
3431 * @return 0 if success, error code(<0) if fail
3432 * @retval PMINFO_R_OK success
3433 * @retval PMINFO_R_EINVAL invalid argument
3434 * @retval PMINFO_R_ERROR internal error
3435 * @pre pkgmgrinfo_appinfo_get_appinfo()
3436 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3437 * @see pkgmgrinfo_appinfo_get_appid()
3438 * @see pkgmgrinfo_appinfo_is_multiple()
3440 static int get_app_notification_icon(const char *appid)
3443 char *notification_icon = NULL;
3444 pkgmgrinfo_appinfo_h handle;
3445 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3446 if (ret != PMINFO_R_OK)
3448 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3449 if (ret != PMINFO_R_OK) {
3450 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3453 printf("notification icon : %s\n", notification_icon);
3454 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3459 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3462 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3463 * @brief This API gets the type of recent image on app-tray
3465 * @par This API is for package-manager client application
3466 * @par Sync (or) Async : Synchronous API
3468 * @param[in] handle pointer to the application info handle.
3469 * @param[out] type pointer to hold image type
3470 * @return 0 if success, error code(<0) if fail
3471 * @retval PMINFO_R_OK success
3472 * @retval PMINFO_R_EINVAL invalid argument
3473 * @retval PMINFO_R_ERROR internal error
3474 * @pre pkgmgrinfo_appinfo_get_appinfo()
3475 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3476 * @see pkgmgrinfo_appinfo_get_appid()
3477 * @see pkgmgrinfo_appinfo_is_multiple()
3479 static int get_app_recent_image_type(const char *appid)
3482 pkgmgrinfo_app_recentimage type;
3483 pkgmgrinfo_appinfo_h handle;
3484 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3485 if (ret != PMINFO_R_OK)
3487 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3488 if (ret != PMINFO_R_OK) {
3489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3492 printf("recent image type: %d\n", type);
3493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3498 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3502 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3503 * @brief This API gets the preview image of application
3505 * @par Sync (or) Async : Synchronous API
3507 * @param[in] handle pointer to the application info handle.
3508 * @param[out] preview_img pointer to hold preview image path
3509 * @return 0 if success, error code(<0) if fail
3510 * @retval PMINFO_R_OK success
3511 * @retval PMINFO_R_EINVAL invalid argument
3512 * @retval PMINFO_R_ERROR internal error
3513 * @pre pkgmgrinfo_appinfo_get_appinfo()
3514 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3515 * @see pkgmgrinfo_appinfo_get_appid()
3517 static int get_app_previewimage(const char *appid)
3520 char *preview = NULL;
3521 pkgmgrinfo_appinfo_h handle = NULL;
3522 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3523 if (ret != PMINFO_R_OK)
3525 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3526 if (ret != PMINFO_R_OK) {
3527 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3530 printf("preview image path : %s\n", preview);
3531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3536 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3540 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3541 * @brief This API gets the package permission type of the application
3543 * @par This API is for package-manager client application
3544 * @par Sync (or) Async : Synchronous API
3546 * @param[in] handle pointer to the application info handle.
3547 * @param[out] permission pointer to hold package permission
3548 * @return 0 if success, error code(<0) if fail
3549 * @retval PMINFO_R_OK success
3550 * @retval PMINFO_R_EINVAL invalid argument
3551 * @retval PMINFO_R_ERROR internal error
3552 * @pre pkgmgrinfo_appinfo_get_appinfo()
3553 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3554 * @see pkgmgrinfo_appinfo_get_appid()
3556 static int get_app_permission(const char *appid)
3559 pkgmgrinfo_permission_type permission = 0;
3560 pkgmgrinfo_appinfo_h handle;
3562 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3563 if (ret != PMINFO_R_OK)
3565 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3566 if (ret != PMINFO_R_OK) {
3567 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3570 printf("permission type: %d\n", permission);
3571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3576 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3579 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3580 * @brief This API gets the component_type
3582 * @par This API is for package-manager client application
3583 * @par Sync (or) Async : Synchronous API
3585 * @param[in] handle pointer to the application info handle.
3586 * @param[out] component_type pointer to hold component_type
3587 * @return 0 if success, error code(<0) if fail
3588 * @retval PMINFO_R_OK success
3589 * @retval PMINFO_R_EINVAL invalid argument
3590 * @retval PMINFO_R_ERROR internal error
3591 * @pre pkgmgrinfo_appinfo_get_appinfo()
3592 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3593 * @see pkgmgrinfo_appinfo_get_pkgid()
3594 * @see pkgmgrinfo_appinfo_is_multiple()
3596 static int get_component_type(const char *appid)
3599 char *component_type = NULL;
3600 pkgmgrinfo_appinfo_h handle;
3601 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3602 if (ret != PMINFO_R_OK)
3604 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3605 if (ret != PMINFO_R_OK) {
3606 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3609 printf("component_type: %s\n", component_type);
3610 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3615 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3618 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3619 * @brief This API gets the application 'hwacceleration' value from the app ID
3621 * @par This API is for package-manager client application
3622 * @par Sync (or) Async : Synchronous API
3624 * @param[in] handle pointer to application info handle
3625 * @param[out] hwacceleration pointer to hold package hwacceleration value
3626 * @return 0 if success, error code(<0) if fail
3627 * @retval PMINFO_R_OK success
3628 * @retval PMINFO_R_EINVAL invalid argument
3629 * @retval PMINFO_R_ERROR internal error
3630 * @pre pkgmgrinfo_appinfo_get_appinfo()
3631 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3632 * @see pkgmgrinfo_appinfo_get_appid()
3633 * @see pkgmgrinfo_appinfo_is_multiple()
3635 static int get_app_hwacceleration(const char *appid)
3638 pkgmgrinfo_app_hwacceleration hwacceleration;
3639 pkgmgrinfo_appinfo_h handle;
3640 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3641 if (ret != PMINFO_R_OK)
3643 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3644 if (ret != PMINFO_R_OK) {
3645 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3648 printf("app hwacceleration: %d\n", hwacceleration);
3649 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3654 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3657 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3658 * @brief This API gets the application 'screenreader' value from the app ID
3660 * @par This API is for package-manager client application
3661 * @par Sync (or) Async : Synchronous API
3663 * @param[in] handle pointer to application info handle
3664 * @param[out] screenreader pointer to hold package accessibility value
3665 * @return 0 if success, error code(<0) if fail
3666 * @retval PMINFO_R_OK success
3667 * @retval PMINFO_R_EINVAL invalid argument
3668 * @retval PMINFO_R_ERROR internal error
3669 * @pre pkgmgrinfo_appinfo_get_appinfo()
3670 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3671 * @see pkgmgrinfo_appinfo_get_appid()
3672 * @see pkgmgrinfo_appinfo_is_multiple()
3674 static int get_app_screenreader(const char *appid)
3677 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3678 pkgmgrinfo_appinfo_h handle = NULL;
3679 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3680 if (ret != PMINFO_R_OK)
3682 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3683 if (ret != PMINFO_R_OK) {
3684 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3687 printf("app screenreader: %d\n", screenreader);
3688 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3693 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3696 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3697 * @brief This API gets the application's landscape & portrait effect images
3699 * @par This API is for package-manager client application
3700 * @par Sync (or) Async : Synchronous API
3702 * @param[in] handle pointer to application info handle
3703 * @param[out] portrait_img contains portrait mode effect image
3704 * @param[out] landscape_img contains landscape mode effect image
3705 * @return 0 if success, error code(<0) if fail
3706 * @retval PMINFO_R_OK success
3707 * @retval PMINFO_R_EINVAL invalid argument
3708 * @retval PMINFO_R_ERROR internal error
3709 * @pre pkgmgrinfo_appinfo_get_appinfo()
3710 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3711 * @see pkgmgrinfo_appinfo_get_appid()
3712 * @see pkgmgrinfo_appinfo_is_nodisplay()
3714 static int get_app_effectimages(const char *appid)
3717 char *portraitimg = NULL;
3718 char *landscapeimg = NULL;
3719 pkgmgrinfo_appinfo_h handle;
3720 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3721 if (ret != PMINFO_R_OK)
3723 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3724 if (ret != PMINFO_R_OK) {
3725 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3728 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3729 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3734 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3737 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3738 * @brief This API gets the application's effect image type
3740 * @par This API is for package-manager client application
3741 * @par Sync (or) Async : Synchronous API
3743 * @param[in] handle pointer to application info handle
3744 * @param[out] effectimg_type contains effect image type
3745 * @return 0 if success, error code(<0) if fail
3746 * @retval PMINFO_R_OK success
3747 * @retval PMINFO_R_EINVAL invalid argument
3748 * @retval PMINFO_R_ERROR internal error
3749 * @pre pkgmgrinfo_appinfo_get_appinfo()
3750 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3751 * @see pkgmgrinfo_appinfo_get_appid()
3752 * @see pkgmgrinfo_appinfo_is_nodisplay()
3754 static int get_app_effectimage_type(const char *appid)
3757 char *effectimg_type = NULL;
3758 pkgmgrinfo_appinfo_h handle = NULL;
3759 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3760 if (ret != PMINFO_R_OK)
3762 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3763 if (ret != PMINFO_R_OK) {
3764 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3767 printf("app effect image type: %s\n", effectimg_type);
3768 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3773 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3776 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3777 * @brief This API gets the submode_mainid of the application
3779 * @par This API is for package-manager client application
3780 * @par Sync (or) Async : Synchronous API
3782 * @param[in] handle pointer to the application info handle.
3783 * @param[out] submode_mainid pointer to hold package name
3784 * @return 0 if success, error code(<0) if fail
3785 * @retval PMINFO_R_OK success
3786 * @retval PMINFO_R_EINVAL invalid argument
3787 * @retval PMINFO_R_ERROR internal error
3788 * @pre pkgmgrinfo_appinfo_get_appinfo()
3789 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3790 * @see pkgmgrinfo_appinfo_get_appid()
3791 * @see pkgmgrinfo_appinfo_is_multiple()
3793 static int get_app_submode_mainid(const char *appid)
3796 char *submode_mainid = NULL;
3797 pkgmgrinfo_appinfo_h handle = NULL;
3798 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3799 if (ret != PMINFO_R_OK)
3801 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3802 if (ret != PMINFO_R_OK) {
3803 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3806 printf("submode_mainid: %s\n", submode_mainid);
3807 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3812 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3815 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3816 * @brief This API gets the datacontrol info
3818 * @par This API is for package-manager client application
3819 * @par Sync (or) Async : Synchronous API
3821 * @param[in] providerid pointer to the providerid of dataconltrol.
3822 * @param[in] type pointer to the type of dataconltrol.
3823 * @param[out] appid pointer to hold appid, need to free after using
3824 * @param[out] access pointer to hold access, need to free after using
3825 * @return 0 if success, error code(<0) if fail
3826 * @retval PMINFO_R_OK success
3827 * @retval PMINFO_R_EINVAL invalid argument
3828 * @retval PMINFO_R_ERROR internal error
3831 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3832 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3835 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3836 * @brief This API gets the appid of datacontrol
3838 * @par This API is for package-manager client application
3839 * @par Sync (or) Async : Synchronous API
3841 * @param[in] providerid pointer to the providerid of dataconltrol.
3842 * @param[out] appid pointer to hold appid, need to free after using
3843 * @return 0 if success, error code(<0) if fail
3844 * @retval PMINFO_R_OK success
3845 * @retval PMINFO_R_EINVAL invalid argument
3846 * @retval PMINFO_R_ERROR internal error
3849 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3850 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3853 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3854 * @brief This API gets the information about trusted datacontrol
3856 * @par This API is for package-manager client application
3857 * @par Sync (or) Async : Synchronous API
3859 * @param[in] providerid pointer to the providerid of datacontrol.
3860 * @param[out] appid pointer to hold appid, need to free after using
3861 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3862 * @return 0 if success, error code(<0) if fail
3863 * @retval PMINFO_R_OK success
3864 * @retval PMINFO_R_EINVAL invalid argument
3865 * @retval PMINFO_R_ERROR internal error
3868 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3869 const char *type, char **appid, bool *is_trusted);
3870 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3871 const char *type, uid_t uid, char **appid, bool *is_trusted);
3874 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3875 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3876 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3878 * @par This API is for package-manager client application
3879 * @par Sync (or) Async : Synchronous API
3881 * @param[in] providerid pointer to the providerid of datacontrol.
3882 * @param[in] type pointer to the type of dataconltrol.
3883 * @param[in] privilege_func callback function for list
3884 * @param[in] user_data user data to be passed to callback function
3885 * @return 0 if success, error code(<0) if fail
3886 * @retval PMINFO_R_OK success
3887 * @retval PMINFO_R_EINVAL invalid argument
3888 * @retval PMINFO_R_ERROR internal error
3890 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3891 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3892 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3893 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3896 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3897 * @brief This API gets the alias_appid of the application
3899 * @par This API is for package-manager client application
3900 * @par Sync (or) Async : Synchronous API
3902 * @param[in] handle pointer to the application info handle.
3903 * @param[out] alias_appid pointer to hold app alias_appid
3904 * @return 0 if success, error code(<0) if fail
3905 * @retval PMINFO_R_OK success
3906 * @retval PMINFO_R_EINVAL invalid argument
3907 * @retval PMINFO_R_ERROR internal error
3908 * @pre pkgmgrinfo_appinfo_get_appinfo()
3909 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3910 * @see pkgmgrinfo_appinfo_get_appid()
3912 static int get_alias_appid(const char *appid)
3915 char *alias_appid= 0;
3916 pkgmgrinfo_appinfo_h handle = NULL;
3917 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3918 if (ret != PMINFO_R_OK)
3920 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3921 if (ret != PMINFO_R_OK) {
3922 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3925 printf("alias_appid: %s\n", alias_appid);
3926 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3931 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3934 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3935 * @brief This API gets the effective_appid of the application
3937 * @par This API is for package-manager client application
3938 * @par Sync (or) Async : Synchronous API
3940 * @param[in] handle pointer to the application info handle.
3941 * @param[out] effective_appid pointer to hold app effective_appid
3942 * @return 0 if success, error code(<0) if fail
3943 * @retval PMINFO_R_OK success
3944 * @retval PMINFO_R_EINVAL invalid argument
3945 * @retval PMINFO_R_ERROR internal error
3946 * @pre pkgmgrinfo_appinfo_get_appinfo()
3947 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3948 * @see pkgmgrinfo_appinfo_get_appid()
3950 static int get_effective_appid(const char *appid)
3953 char *effective_appid= 0;
3954 pkgmgrinfo_appinfo_h handle = NULL;
3955 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3956 if (ret != PMINFO_R_OK)
3958 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3959 if (ret != PMINFO_R_OK) {
3960 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3963 printf("effective_appid: %s\n", effective_appid);
3964 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3969 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3972 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3973 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3975 * @par This API is for package-manager client application
3976 * @par Sync (or) Async : Synchronous API
3978 * @param[in] handle pointer to the appinfo handle.
3979 * @param[out] tep_name pointer to hold tep name
3980 * @return 0 if success, error code(<0) if fail
3981 * @retval PMINFO_R_OK success
3982 * @retval PMINFO_R_EINVAL invalid argument
3983 * @retval PMINFO_R_ERROR internal error
3984 * @pre pkgmgrinfo_appinfo_get_appinfo()
3985 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3986 * @see pkgmgrinfo_appinfo_get_appid()
3988 static int get_tep_name(const char *appid)
3991 char *tep_name = NULL;
3992 pkgmgrinfo_appinfo_h handle = NULL;
3993 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3994 if (ret != PMINFO_R_OK)
3996 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3997 if (ret != PMINFO_R_OK) {
3998 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4001 printf("TEP name is: %s\n", tep_name);
4002 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4007 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4010 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4011 * @brief This API gets zip mount file name associated with the package which contain given application
4012 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4014 * @par This API is for package-manager client application
4015 * @par Sync (or) Async : Synchronous API
4017 * @param[in] handle pointer to the appinfo handle.
4018 * @param[out] zip_mount_file pointer to hold zip mount file name
4019 * @return 0 if success, error code(<0) if fail
4020 * @retval PMINFO_R_OK success
4021 * @retval PMINFO_R_EINVAL invalid argument
4022 * @retval PMINFO_R_ERROR internal error
4023 * @pre pkgmgrinfo_appinfo_get_appinfo()
4024 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4025 * @see pkgmgrinfo_appinfo_get_appid()
4027 static int get_zip_mount_file(const char *appid)
4030 char *zip_mount_file = NULL;
4031 pkgmgrinfo_appinfo_h handle = NULL;
4032 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4033 if (ret != PMINFO_R_OK)
4035 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4036 if (ret != PMINFO_R_OK) {
4037 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4040 printf("Mount file name is: %s\n", zip_mount_file);
4041 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4046 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4049 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4050 * @brief This API gets the root path of application
4052 * @par Sync (or) Async : Synchronous API
4054 * @param[in] handle pointer to appinfo handle
4055 * @param[out] path pointer to hold root path of application
4056 * @return 0 if success, error code(<0) if fail
4057 * @retval PMINFO_R_OK success
4058 * @retval PMINFO_R_EINVAL invalid argument
4059 * @retval PMINFO_R_ERROR internal error
4061 static int get_root_path(const char *appid)
4065 pkgmgrinfo_appinfo_h handle;
4066 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4067 if (ret != PMINFO_R_OK)
4070 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4071 if (ret != PMINFO_R_OK) {
4072 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4075 printf("path : %s\n", path);
4076 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4082 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4085 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4086 * @brief This API gets the application api_version from the application ID
4088 * @par This API is for package-manager client application
4089 * @par Sync (or) Async : Synchronous API
4091 * @param[in] handle pointer to appinfo handle
4092 * @param[out] api_version pointer to hold application api_version
4093 * @return 0 if success, error code(<0) if fail
4094 * @retval PMINFO_R_OK success
4095 * @retval PMINFO_R_EINVAL invalid argument
4096 * @retval PMINFO_R_ERROR internal error
4097 * @pre pkgmgrinfo_appinfo_get_appinfo()
4098 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4099 * @see pkgmgrinfo_appinfo_get_appid()
4101 static int get_app_api_version(const char *appid)
4104 char *api_version = NULL;
4105 pkgmgrinfo_appinfo_h handle = NULL;
4106 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4107 if (ret != PMINFO_R_OK)
4109 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4110 if (ret != PMINFO_R_OK) {
4111 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4114 printf("app api_version: %s\n", api_version);
4115 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4120 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4123 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4124 * @brief This API gets the installed_time of the application
4126 * @par This API is for package-manager client application
4127 * @par Sync (or) Async : Synchronous API
4129 * @param[in] handle pointer to the application info handle.
4130 * @param[out] installed_time pointer to hold installed_time
4131 * @return 0 if success, error code(<0) if fail
4132 * @retval PMINFO_R_OK success
4133 * @retval PMINFO_R_EINVAL invalid argument
4134 * @retval PMINFO_R_ERROR internal error
4135 * @pre pkgmgrinfo_appinfo_get_appinfo()
4136 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4137 * @see pkgmgrinfo_appinfo_get_appid()
4138 * @see pkgmgrinfo_appinfo_is_multiple()
4140 static int get_app_installed_time(const char *appid)
4143 int installed_time = 0;
4144 pkgmgrinfo_appinfo_h handle = NULL;
4145 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4146 if (ret != PMINFO_R_OK)
4148 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4149 if (ret != PMINFO_R_OK) {
4150 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4153 printf("installed_time: %d\n", installed_time);
4154 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4159 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4162 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4163 * @brief This API gets the support_mode of the application
4165 * @par This API is for package-manager client application
4166 * @par Sync (or) Async : Synchronous API
4168 * @param[in] handle pointer to the application info handle.
4169 * @param[out] support_mode pointer to hold app support_mode
4170 * @return 0 if success, error code(<0) if fail
4171 * @retval PMINFO_R_OK success
4172 * @retval PMINFO_R_EINVAL invalid argument
4173 * @retval PMINFO_R_ERROR internal error
4174 * @pre pkgmgrinfo_appinfo_get_appinfo()
4175 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4176 * @see pkgmgrinfo_appinfo_get_appid()
4178 static int get_app_support_mode(const char *appid)
4181 int support_mode = 0;
4182 pkgmgrinfo_appinfo_h handle = NULL;
4183 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4184 if (ret != PMINFO_R_OK)
4186 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4187 if (ret != PMINFO_R_OK) {
4188 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4191 printf("support_mode: %s\n", support_mode);
4192 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4197 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4201 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4202 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4203 * @brief This API gets the list of category for a particular application
4205 * @par This API is for package-manager client application
4206 * @par Sync (or) Async : Synchronous API
4207 * @param[in] handle pointer to the application info handle.
4208 * @param[in] category_func callback function for list
4209 * @param[in] user_data user data to be passed to callback function
4210 * @return 0 if success, error code(<0) if fail
4211 * @retval PMINFO_R_OK success
4212 * @retval PMINFO_R_EINVAL invalid argument
4213 * @retval PMINFO_R_ERROR internal error
4214 * @pre pkgmgrinfo_appinfo_get_appinfo()
4215 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4217 int category_func(const char *name, void *user_data)
4219 if (strcmp(name, (char *)user_data) == 0)
4225 static int list_category(const char *appid, char *category)
4228 pkgmgrinfo_appinfo_h handle;
4229 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4230 if (ret != PMINFO_R_OK)
4232 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4233 if (ret != PMINFO_R_OK) {
4234 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4237 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4242 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4243 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4246 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4247 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4248 * @brief This API gets the list of metadata for a particular application
4250 * @par This API is for package-manager client application
4251 * @par Sync (or) Async : Synchronous API
4252 * @param[in] handle pointer to the application info handle.
4253 * @param[in] metadata_func callback function for list
4254 * @param[in] user_data user data to be passed to callback function
4255 * @return 0 if success, error code(<0) if fail
4256 * @retval PMINFO_R_OK success
4257 * @retval PMINFO_R_EINVAL invalid argument
4258 * @retval PMINFO_R_ERROR internal error
4259 * @pre pkgmgrinfo_appinfo_get_appinfo()
4260 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4262 int metadata_func(const char *key, const char *value, void *user_data)
4264 if (strcmp(key, (char *)user_data) == 0) {
4265 printf("Value is %s\n", value);
4272 static int list_metadata(const char *appid, char *key)
4275 pkgmgrinfo_appinfo_h handle;
4276 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4277 if (ret != PMINFO_R_OK)
4279 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4280 if (ret != PMINFO_R_OK) {
4281 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4284 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4289 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4290 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4293 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4294 * const char *operation,
4295 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4297 * @brief This API gets the list of privileges for a particular
4298 * appllication's app_control
4300 * @par This API is for package-manager client application
4301 * @par Sync (or) Async : Synchronous API
4302 * @param[in] appid application id
4303 * @param[in] operation operation of appcontrol
4304 * @param[in] privilege_func callback function for list
4305 * @param[in] user_data user data to be passed to callback function
4306 * @return 0 if success, error code(<0) if fail
4307 * @retval PMINFO_R_OK success
4308 * @retval PMINFO_R_EINVAL invalid argument
4309 * @retval PMINFO_R_ERROR internal error
4311 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4312 const char *operation,
4313 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4314 void *user_data, uid_t uid);
4315 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4316 const char *operation,
4317 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4321 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4322 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4323 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4324 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4325 * @brief This API gets the list of app-control for a particular application
4327 * @par This API is for package-manager client application
4328 * @par Sync (or) Async : Synchronous API
4329 * @param[in] handle pointer to the application info handle.
4330 * @param[in] appcontrol_func callback function for list
4331 * @param[in] user_data user data to be passed to callback function
4332 * @param[in] uid the addressee user id of the instruction
4333 * @return 0 if success, error code(<0) if fail
4334 * @retval PMINFO_R_OK success
4335 * @retval PMINFO_R_EINVAL invalid argument
4336 * @retval PMINFO_R_ERROR internal error
4337 * @pre pkgmgrinfo_appinfo_get_appinfo()
4338 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4340 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4345 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4346 for (i = 0; i < oc; i++) {
4347 if (strcmp(operation[i], (char *)user_data) == 0)
4354 static int check_operation(const char *appid, char *operation)
4357 pkgmgrinfo_appinfo_h handle;
4358 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4359 if (ret != PMINFO_R_OK)
4361 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4362 if (ret != PMINFO_R_OK) {
4363 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4366 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4371 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4372 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4374 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4375 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4380 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4381 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4384 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4385 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4386 * @brief This API gets the list of splashscreen for a particular application
4388 * @par This API is for package-manager client application
4389 * @par Sync (or) Async : Synchronous API
4390 * @param[in] handle pointer to the application info handle.
4391 * @param[in] splash_screen_func callback function for list
4392 * @param[in] user_data user data to be passed to callback function
4393 * @return 0 if success, error code(<0) if fail
4394 * @retval PMINFO_R_OK success
4395 * @retval PMINFO_R_EINVAL invalid argument
4396 * @retval PMINFO_R_ERROR internal error
4397 * @pre pkgmgrinfo_appinfo_get_appinfo()
4398 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4401 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4402 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4405 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4406 * @brief This API gets the application 'nodisplay' value from the app ID
4408 * @par This API is for package-manager client application
4409 * @par Sync (or) Async : Synchronous API
4411 * @param[in] handle pointer to application info handle
4412 * @param[out] nodisplay pointer to hold package nodisplay value
4413 * @return 0 if success, error code(<0) if fail
4414 * @retval PMINFO_R_OK success
4415 * @retval PMINFO_R_EINVAL invalid argument
4416 * @retval PMINFO_R_ERROR internal error
4417 * @pre pkgmgrinfo_appinfo_get_appinfo()
4418 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4419 * @see pkgmgrinfo_appinfo_get_appid()
4420 * @see pkgmgrinfo_appinfo_is_multiple()
4422 static int get_app_nodisplay(const char *appid)
4426 pkgmgrinfo_appinfo_h handle;
4427 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4428 if (ret != PMINFO_R_OK)
4430 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4431 if (ret != PMINFO_R_OK) {
4432 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4435 printf("app nodisplay: %d\n", nodisplay);
4436 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4441 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4444 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4445 * @brief This API gets the application 'multiple' value from the app ID
4447 * @par This API is for package-manager client application
4448 * @par Sync (or) Async : Synchronous API
4450 * @param[in] handle pointer to application info handle
4451 * @param[out] multiple pointer to hold package multiple value
4452 * @return 0 if success, error code(<0) if fail
4453 * @retval PMINFO_R_OK success
4454 * @retval PMINFO_R_EINVAL invalid argument
4455 * @retval PMINFO_R_ERROR internal error
4456 * @pre pkgmgrinfo_appinfo_get_appinfo()
4457 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4458 * @see pkgmgrinfo_appinfo_get_appid()
4459 * @see pkgmgrinfo_appinfo_is_nodisplay()
4461 static int get_app_multiple(const char *appid)
4465 pkgmgrinfo_appinfo_h handle;
4466 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4467 if (ret != PMINFO_R_OK)
4469 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4470 if (ret != PMINFO_R_OK) {
4471 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4474 printf("app multiple: %d\n", multiple);
4475 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4480 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4483 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4484 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4485 * application launching effect. If fales, indicator will be hidden during application launching effect
4487 * @par This API is for package-manager client application
4488 * @par Sync (or) Async : Synchronous API
4490 * @param[in] handle pointer to application info handle
4491 * @param[out] indicator_disp contains indicator display status for application launching effect
4492 * @return 0 if success, error code(<0) if fail
4493 * @retval PMINFO_R_OK success
4494 * @retval PMINFO_R_EINVAL invalid argument
4495 * @retval PMINFO_R_ERROR internal error
4496 * @pre pkgmgrinfo_appinfo_get_appinfo()
4497 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4498 * @see pkgmgrinfo_appinfo_get_appid()
4499 * @see pkgmgrinfo_appinfo_is_nodisplay()
4501 static int get_app_indicator_display(const char *appid)
4504 bool indicator_disp;
4505 pkgmgrinfo_appinfo_h handle;
4506 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4507 if (ret != PMINFO_R_OK)
4509 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4510 if (ret != PMINFO_R_OK){
4511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4514 printf("app indicator disp : %d\n", indicator_disp);
4515 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4520 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4523 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4524 * @brief This API gets the application 'taskmanage' value from the app ID
4526 * @par This API is for package-manager client application
4527 * @par Sync (or) Async : Synchronous API
4529 * @param[in] handle pointer to application info handle
4530 * @param[out] taskmanage pointer to hold package taskmanage value
4531 * @return 0 if success, error code(<0) if fail
4532 * @retval PMINFO_R_OK success
4533 * @retval PMINFO_R_EINVAL invalid argument
4534 * @retval PMINFO_R_ERROR internal error
4535 * @pre pkgmgrinfo_appinfo_get_appinfo()
4536 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4537 * @see pkgmgrinfo_appinfo_get_appid()
4538 * @see pkgmgrinfo_appinfo_is_multiple()
4540 static int get_app_taskmanage(const char *appid)
4544 pkgmgrinfo_appinfo_h handle;
4545 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4546 if (ret != PMINFO_R_OK)
4548 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4549 if (ret != PMINFO_R_OK) {
4550 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4553 printf("app taskmanage: %d\n", taskmanage);
4554 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4559 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4562 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4563 * @brief This API gets the application 'taskmanage' value from the app ID
4565 * @par This API is for package-manager client application
4566 * @par Sync (or) Async : Synchronous API
4568 * @param[in] handle pointer to application info handle
4569 * @param[out] enabled pointer to hold package enabled value
4570 * @return 0 if success, error code(<0) if fail
4571 * @retval PMINFO_R_OK success
4572 * @retval PMINFO_R_EINVAL invalid argument
4573 * @retval PMINFO_R_ERROR internal error
4574 * @pre pkgmgrinfo_appinfo_get_appinfo()
4575 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4576 * @see pkgmgrinfo_appinfo_get_appid()
4577 * @see pkgmgrinfo_appinfo_is_multiple()
4579 static int get_app_enabled(const char *appid)
4583 pkgmgrinfo_appinfo_h handle;
4584 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4585 if (ret != PMINFO_R_OK)
4587 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4588 if (ret != PMINFO_R_OK) {
4589 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4592 printf("app enabled: %d\n", enabled);
4593 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4598 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4601 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4602 * @brief This API gets the application 'onboot' value from the app ID
4604 * @par This API is for package-manager client application
4605 * @par Sync (or) Async : Synchronous API
4607 * @param[in] handle pointer to application info handle
4608 * @param[out] onboot pointer to hold package onboot value
4609 * @return 0 if success, error code(<0) if fail
4610 * @retval PMINFO_R_OK success
4611 * @retval PMINFO_R_EINVAL invalid argument
4612 * @retval PMINFO_R_ERROR internal error
4613 * @pre pkgmgrinfo_appinfo_get_appinfo()
4614 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4615 * @see pkgmgrinfo_appinfo_get_appid()
4616 * @see pkgmgrinfo_appinfo_is_multiple()
4618 static int get_app_onboot(const char *appid)
4622 pkgmgrinfo_appinfo_h handle;
4623 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4624 if (ret != PMINFO_R_OK)
4626 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4627 if (ret != PMINFO_R_OK) {
4628 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4631 printf("app onboot: %d\n", onboot);
4632 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4637 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4640 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4641 * @brief This API gets the application 'autorestart' value from the app ID
4643 * @par This API is for package-manager client application
4644 * @par Sync (or) Async : Synchronous API
4646 * @param[in] handle pointer to application info handle
4647 * @param[out] autorestart pointer to hold package autorestart value
4648 * @return 0 if success, error code(<0) if fail
4649 * @retval PMINFO_R_OK success
4650 * @retval PMINFO_R_EINVAL invalid argument
4651 * @retval PMINFO_R_ERROR internal error
4652 * @pre pkgmgrinfo_appinfo_get_appinfo()
4653 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4654 * @see pkgmgrinfo_appinfo_get_appid()
4655 * @see pkgmgrinfo_appinfo_is_multiple()
4657 static int get_app_autorestart(const char *appid)
4661 pkgmgrinfo_appinfo_h handle;
4662 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4663 if (ret != PMINFO_R_OK)
4665 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4666 if (ret != PMINFO_R_OK) {
4667 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4670 printf("app autorestart: %d\n", autorestart);
4671 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4676 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4679 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4680 * @brief This API gets the value for given application is main app or not from handle
4682 * @par This API is for package-manager client application
4683 * @par Sync (or) Async : Synchronous API
4685 * @param[in] handle pointer to application info handle
4686 * @param[out] mainapp pointer to hold package mainapp is or not
4687 * @return 0 if success, error code(<0) if fail
4688 * @retval PMINFO_R_OK success
4689 * @retval PMINFO_R_EINVAL invalid argument
4690 * @retval PMINFO_R_ERROR internal error
4691 * @pre pkgmgrinfo_appinfo_get_appinfo()
4692 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4693 * @see pkgmgrinfo_appinfo_get_appid()
4694 * @see pkgmgrinfo_appinfo_is_multiple()
4696 static int get_app_mainapp(const char *appid)
4700 pkgmgrinfo_appinfo_h handle;
4701 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4702 if (ret != PMINFO_R_OK)
4704 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4705 if (ret != PMINFO_R_OK) {
4706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4709 printf("mainapp: %d\n", mainapp);
4710 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4715 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4719 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4720 * @brief This API gets the value for given application is preload or not from handle
4722 * @par This API is for package-manager client application
4723 * @par Sync (or) Async : Synchronous API
4725 * @param[in] handle pointer to application info handle
4726 * @param[out] preload pointer to hold preload is or not
4727 * @return 0 if success, error code(<0) if fail
4728 * @retval PMINFO_R_OK success
4729 * @retval PMINFO_R_EINVAL invalid argument
4730 * @retval PMINFO_R_ERROR internal error
4731 * @pre pkgmgrinfo_appinfo_get_appinfo()
4732 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4733 * @see pkgmgrinfo_appinfo_get_appid()
4734 * @see pkgmgrinfo_appinfo_is_multiple()
4736 static int get_app_preload(const char *appid)
4740 pkgmgrinfo_appinfo_h handle = NULL;
4741 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4742 if (ret != PMINFO_R_OK)
4744 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4745 if (ret != PMINFO_R_OK) {
4746 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4749 printf("preload: %d\n", preload);
4750 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4755 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4758 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4759 * @brief This API gets the value for given application is submode or not from handle
4761 * @par This API is for package-manager client application
4762 * @par Sync (or) Async : Synchronous API
4764 * @param[in] handle pointer to application info handle
4765 * @param[out] submode pointer to hold submode is or not
4766 * @return 0 if success, error code(<0) if fail
4767 * @retval PMINFO_R_OK success
4768 * @retval PMINFO_R_EINVAL invalid argument
4769 * @retval PMINFO_R_ERROR internal error
4770 * @pre pkgmgrinfo_appinfo_get_appinfo()
4771 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4772 * @see pkgmgrinfo_appinfo_get_appid()
4773 * @see pkgmgrinfo_appinfo_is_multiple()
4775 static int get_app_submode(const char *appid)
4779 pkgmgrinfo_appinfo_h handle = NULL;
4780 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4781 if (ret != PMINFO_R_OK)
4783 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4784 if (ret != PMINFO_R_OK) {
4785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4788 printf("submode: %d\n", submode);
4789 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4794 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4797 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4798 * @brief This API gets the value for given application is process_pool or not from handle
4800 * @par This API is for package-manager client application
4801 * @par Sync (or) Async : Synchronous API
4803 * @param[in] handle pointer to application info handle
4804 * @param[out] process_pool pointer to hold process_pool is or not
4805 * @return 0 if success, error code(<0) if fail
4806 * @retval PMINFO_R_OK success
4807 * @retval PMINFO_R_EINVAL invalid argument
4808 * @retval PMINFO_R_ERROR internal error
4809 * @pre pkgmgrinfo_appinfo_get_appinfo()
4810 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4811 * @see pkgmgrinfo_appinfo_get_appid()
4813 static int get_app_process_pool(const char *appid)
4816 bool process_pool = 0;
4817 pkgmgrinfo_appinfo_h handle = NULL;
4818 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4819 if (ret != PMINFO_R_OK)
4821 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4822 if (ret != PMINFO_R_OK) {
4823 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4826 printf("process_pool: %d\n", process_pool);
4827 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4832 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4835 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4836 * @brief This API gets the installed storage location of the application
4838 * @par This API is for package-manager client application
4839 * @par Sync (or) Async : Synchronous API
4841 * @param[in] handle pointer to the application info handle.
4842 * @param[out] app_type pointer to hold installed storage location
4843 * @return 0 if success, error code(<0) if fail
4844 * @retval PMINFO_R_OK success
4845 * @retval PMINFO_R_EINVAL invalid argument
4846 * @retval PMINFO_R_ERROR internal error
4847 * @pre pkgmgrinfo_appinfo_get_appinfo()
4848 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4849 * @see pkgmgrinfo_appinfo_get_appid()
4851 static int get_app_installed_location(const char *appid)
4854 pkgmgrinfo_installed_storage storage;
4855 pkgmgrinfo_appinfo_h handle = NULL;
4856 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4857 if (ret != PMINFO_R_OK)
4859 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4860 if (ret != PMINFO_R_OK) {
4861 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4864 printf("Installed storage location : %d\n", storage);
4865 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4870 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4874 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4875 * @brief This API checks if the application has the given category
4877 * @par This API is for package-manager client application
4878 * @par Sync (or) Async : Synchronous API
4880 * @param[in] handle pointer to the application info handle
4881 * @param[in] category category
4882 * @param[out] exist value Gets whether the application has the given category
4883 * @return 0 if success, error code(<0) if fail
4884 * @retval PMINFO_R_OK success
4885 * @retval PMINFO_R_EINVAL invalid argument
4886 * @retval PMINFO_R_ERROR internal error
4888 static int is_category_exist(const char *appid, const char *category)
4891 pkgmgrinfo_appinfo_h handle;
4894 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4895 if (ret != PMINFO_R_OK)
4898 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4899 if (ret != PMINFO_R_OK) {
4900 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4904 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4909 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4912 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4913 * @brief This API gets the application 'ui_gadget' value from the app ID
4915 * @par This API is for package-manager client application
4916 * @par Sync (or) Async : Synchronous API
4918 * @param[in] handle pointer to application info handle
4919 * @param[out] ui_gadget pointer to hold package ui_gadget value
4920 * @return 0 if success, error code(<0) if fail
4921 * @retval PMINFO_R_OK success
4922 * @retval PMINFO_R_EINVAL invalid argument
4923 * @pre pkgmgrinfo_appinfo_get_appinfo()
4924 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4926 static int get_app_ui_gadget(const char *appid)
4930 pkgmgrinfo_appinfo_h handle = NULL;
4931 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4932 if (ret != PMINFO_R_OK)
4934 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4935 if (ret != PMINFO_R_OK) {
4936 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4939 printf("app ui_gadget: %d\n", ui_gadget);
4940 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4945 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4948 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4949 * @brief This API gets the application 'support_disable' value from the app ID
4951 * @par This API is for package-manager client application
4952 * @par Sync (or) Async : Synchronous API
4954 * @param[in] handle pointer to application info handle
4955 * @param[out] support_disable pointer to hold package support_disable value
4956 * @return 0 if success, error code(<0) if fail
4957 * @retval PMINFO_R_OK success
4958 * @retval PMINFO_R_EINVAL invalid argument
4959 * @pre pkgmgrinfo_appinfo_get_appinfo()
4960 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4962 static int get_app_support_disable(const char *appid)
4965 bool support_disable;
4966 pkgmgrinfo_appinfo_h handle = NULL;
4967 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4968 if (ret != PMINFO_R_OK)
4970 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4971 if (ret != PMINFO_R_OK) {
4972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4975 printf("app support_disable: %d\n", support_disable);
4976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4981 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4984 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4985 * @brief This API gets the application 'removable' value from the app ID
4987 * @par This API is for package-manager client application
4988 * @par Sync (or) Async : Synchronous API
4990 * @param[in] handle pointer to application info handle
4991 * @param[out] removable pointer to hold package removable value
4992 * @return 0 if success, error code(<0) if fail
4993 * @retval PMINFO_R_OK success
4994 * @retval PMINFO_R_EINVAL invalid argument
4995 * @retval PMINFO_R_ERROR internal error
4996 * @pre pkgmgrinfo_appinfo_get_appinfo()
4997 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4998 * @see pkgmgrinfo_appinfo_get_appid()
5000 static int get_app_removable(const char *appid)
5004 pkgmgrinfo_appinfo_h handle = NULL;
5005 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5006 if (ret != PMINFO_R_OK)
5008 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5009 if (ret != PMINFO_R_OK) {
5010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5013 printf("app removable: %d\n", removable);
5014 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5019 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5022 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5023 * @brief This API gets the application 'system' value from the app ID
5025 * @par This API is for package-manager client application
5026 * @par Sync (or) Async : Synchronous API
5028 * @param[in] handle pointer to application info handle
5029 * @param[out] system pointer to hold package system value
5030 * @return 0 if success, error code(<0) if fail
5031 * @retval PMINFO_R_OK success
5032 * @retval PMINFO_R_EINVAL invalid argument
5033 * @retval PMINFO_R_ERROR internal error
5034 * @pre pkgmgrinfo_appinfo_get_appinfo()
5035 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5036 * @see pkgmgrinfo_appinfo_get_appid()
5038 static int get_app_system(const char *appid)
5041 bool system = false;
5042 pkgmgrinfo_appinfo_h handle = NULL;
5043 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5044 if (ret != PMINFO_R_OK)
5046 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5047 if (ret != PMINFO_R_OK) {
5048 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5051 printf("app system: %d\n", system);
5052 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5057 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5061 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5062 * @brief This API gets the application 'is_disable' value from the app ID
5064 * @par This API is for package-manager client application
5065 * @par Sync (or) Async : Synchronous API
5067 * @param[in] handle pointer to application info handle
5068 * @param[out] disabled pointer to hold application is_disabled value
5069 * @return 0 if success, error code(<0) if fail
5070 * @retval PMINFO_R_OK success
5071 * @retval PMINFO_R_EINVAL invalid argument
5072 * @pre pkgmgrinfo_appinfo_get_appinfo()
5073 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5075 static int get_app_is_disable(const char *appid)
5079 pkgmgrinfo_appinfo_h handle = NULL;
5080 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5081 if (ret != PMINFO_R_OK)
5083 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5084 if (ret != PMINFO_R_OK) {
5085 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5088 printf("app is_disable: %d\n", is_disable);
5089 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5094 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5097 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5098 * @brief This API gets whethere the given application is global application or user application
5100 * @par This API is for package-manager client application
5101 * @par Sync (or) Async : Synchronous API
5103 * @param[in] handle pointer to application info handle
5104 * @param[in] global pointer to hold application global value
5105 * @return 0 if success, error code(<0) if fail
5106 * @retval PMINFO_R_OK success
5107 * @retval PMINFO_R_EINVAL invalid argument
5108 * @retval PMINFO_R_ERROR internal error
5109 * @pre pkgmgrinfo_appinfo_get_appinfo()
5110 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5111 * @see pkgmgrinfo_appinfo_get_appid()
5112 static int get_app_is_global(const char *appid)
5116 pkgmgrinfo_appinfo_h handle = NULL;
5117 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5118 if (ret != PMINFO_R_OK)
5120 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5121 if (ret != PMINFO_R_OK) {
5122 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5125 printf("app is_global: %d\n", global);
5126 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5131 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5134 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5135 * @brief This API gets the application 'splash_screen_display' value from the app ID
5137 * @par This API is for package-manager client application
5138 * @par Sync (or) Async : Synchronous API
5140 * @param[in] handle pointer to application info handle
5141 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5142 * @return 0 if success, error code(<0) if fail
5143 * @retval PMINFO_R_OK success
5144 * @retval PMINFO_R_EINVAL invalid argument
5145 * @retval PMINFO_R_ERROR internal error
5147 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5150 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5151 * @brief This API gets the application 'setup_appid' value from the app ID
5153 * @par This API is for package-manager client application
5154 * @par Sync (or) Async : Synchronous API
5156 * @param[in] handle pointer to application info handle
5157 * @param[out] setup_appid pointer to hold package setup_appid value
5158 * @return 0 if success, error code(<0) if fail
5159 * @retval PMINFO_R_OK success
5160 * @retval PMINFO_R_EINVAL invalid argument
5161 * @retval PMINFO_R_ERROR internal error
5163 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5166 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5167 * @brief This API gets the application 'support_ambient' value from the app ID
5169 * @par This API is for package-manager client application
5170 * @par Sync (or) Async : Synchronous API
5172 * @param[in] handle pointer to application info handle
5173 * @param[out] support_ambient pointer to hold package support_ambient value
5174 * @return 0 if success, error code(<0) if fail
5175 * @retval PMINFO_R_OK success
5176 * @retval PMINFO_R_EINVAL invalid argument
5177 * @retval PMINFO_R_ERROR internal error
5179 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5182 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5183 * @brief This API destroys the application information handle freeing up all the resources
5185 * @par This API is for package-manager client application
5186 * @par Sync (or) Async : Synchronous API
5188 * @param[in] handle pointer to the application info handle.
5189 * @return 0 if success, error code(<0) if fail
5190 * @retval PMINFO_R_OK success
5191 * @retval PMINFO_R_EINVAL invalid argument
5192 * @retval PMINFO_R_ERROR internal error
5193 * @pre pkgmgrinfo_appinfo_get_appinfo()
5195 * @see pkgmgrinfo_appinfo_get_pkgid()
5196 * @see pkgmgrinfo_appinfo_is_multiple()
5198 static int get_app_type(const char *appid)
5202 pkgmgrinfo_appinfo_h handle;
5203 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5204 if (ret != PMINFO_R_OK)
5206 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5207 if (ret != PMINFO_R_OK) {
5208 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5211 printf("apptype: %s\n", type);
5212 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5217 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5220 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5221 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5222 The query will search the entire application information collected from the manifest file of all the installed packages
5224 * @par This API is for package-manager client application
5225 * @par Sync (or) Async : Synchronous API
5227 * @param[out] handle pointer to the application info filter handle.
5228 * @return 0 if success, error code(<0) if fail
5229 * @retval PMINFO_R_OK success
5230 * @retval PMINFO_R_EINVAL invalid argument
5231 * @retval PMINFO_R_ERROR internal error
5233 * @post pkgmgrinfo_appinfo_filter_destroy()
5234 * @see pkgmgrinfo_appinfo_filter_count()
5235 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5237 static int get_capp_count()
5241 pkgmgrinfo_appinfo_filter_h handle;
5242 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5243 if (ret != PMINFO_R_OK)
5245 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5246 if (ret != PMINFO_R_OK) {
5247 pkgmgrinfo_appinfo_filter_destroy(handle);
5250 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5251 if (ret != PMINFO_R_OK) {
5252 pkgmgrinfo_appinfo_filter_destroy(handle);
5255 printf("No of capp: %d\n", count);
5256 pkgmgrinfo_appinfo_filter_destroy(handle);
5261 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5264 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5265 * @brief This API destroys the application information filter handle freeing up all the resources
5267 * @par This API is for package-manager client application
5268 * @par Sync (or) Async : Synchronous API
5270 * @param[in] handle pointer to the application info filter handle.
5271 * @return 0 if success, error code(<0) if fail
5272 * @retval PMINFO_R_OK success
5273 * @retval PMINFO_R_EINVAL invalid argument
5274 * @retval PMINFO_R_ERROR internal error
5275 * @pre pkgmgrinfo_appinfo_filter_create()
5277 * @see pkgmgrinfo_appinfo_filter_count()
5278 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5280 static int get_capp_count()
5284 pkgmgrinfo_appinfo_filter_h handle;
5285 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5286 if (ret != PMINFO_R_OK)
5288 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5289 if (ret != PMINFO_R_OK) {
5290 pkgmgrinfo_appinfo_filter_destroy(handle);
5293 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5294 if (ret != PMINFO_R_OK) {
5295 pkgmgrinfo_appinfo_filter_destroy(handle);
5298 printf("No of capp: %d\n", count);
5299 pkgmgrinfo_appinfo_filter_destroy(handle);
5304 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5307 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5308 * @brief This API adds a boolean filter property to the filter handle
5310 * @par This API is for package-manager client application
5311 * @par Sync (or) Async : Synchronous API
5313 * @param[in] handle pointer to the application info filter handle.
5314 * @param[in] property boolean property name.
5315 * @param[in] value value corresponding to the property.
5316 * @return 0 if success, error code(<0) if fail
5317 * @retval PMINFO_R_OK success
5318 * @retval PMINFO_R_EINVAL invalid argument
5319 * @retval PMINFO_R_ERROR internal error
5320 * @pre pkgmgrinfo_appinfo_filter_create()
5321 * @post pkgmgrinfo_appinfo_filter_destroy()
5322 * @see pkgmgrinfo_appinfo_filter_count()
5323 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5325 static int get_taskmanageable_app_count()
5329 pkgmgrinfo_appinfo_filter_h handle;
5330 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5331 if (ret != PMINFO_R_OK)
5333 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5334 if (ret != PMINFO_R_OK) {
5335 pkgmgrinfo_appinfo_filter_destroy(handle);
5338 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5339 if (ret != PMINFO_R_OK) {
5340 pkgmgrinfo_appinfo_filter_destroy(handle);
5343 printf("No of taskmanageable apps: %d\n", count);
5344 pkgmgrinfo_appinfo_filter_destroy(handle);
5349 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5350 const char *property, const bool value);
5353 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5354 * @brief This API adds an integer filter property to the filter handle
5356 * @par This API is for package-manager client application
5357 * @par Sync (or) Async : Synchronous API
5359 * @param[in] handle pointer to the application info filter handle.
5360 * @param[in] property integer property name.
5361 * @param[in] value value corresponding to the property.
5362 * @return 0 if success, error code(<0) if fail
5363 * @retval PMINFO_R_OK success
5364 * @retval PMINFO_R_EINVAL invalid argument
5365 * @retval PMINFO_R_ERROR internal error
5366 * @pre pkgmgrinfo_appinfo_filter_create()
5367 * @post pkgmgrinfo_appinfo_filter_destroy()
5368 * @see pkgmgrinfo_appinfo_filter_count()
5369 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5371 static int get_taskmanageable_app_count()
5375 pkgmgrinfo_appinfo_filter_h handle;
5376 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5377 if (ret != PMINFO_R_OK)
5379 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5380 if (ret != PMINFO_R_OK) {
5381 pkgmgrinfo_appinfo_filter_destroy(handle);
5384 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5385 if (ret != PMINFO_R_OK) {
5386 pkgmgrinfo_appinfo_filter_destroy(handle);
5389 printf("No of apps: %d\n", count);
5390 pkgmgrinfo_appinfo_filter_destroy(handle);
5395 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5396 const char *property, const int value);
5399 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5400 * @brief This API adds a string filter property to the filter handle
5402 * @par This API is for package-manager client application
5403 * @par Sync (or) Async : Synchronous API
5405 * @param[in] handle pointer to the application info filter handle.
5406 * @param[in] property string property name.
5407 * @param[in] value value corresponding to the property.
5408 * @return 0 if success, error code(<0) if fail
5409 * @retval PMINFO_R_OK success
5410 * @retval PMINFO_R_EINVAL invalid argument
5411 * @retval PMINFO_R_ERROR internal error
5412 * @pre pkgmgrinfo_appinfo_filter_create()
5413 * @post pkgmgrinfo_appinfo_filter_destroy()
5414 * @see pkgmgrinfo_appinfo_filter_count()
5415 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5417 static int get_capp_count()
5421 pkgmgrinfo_appinfo_filter_h handle;
5422 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5423 if (ret != PMINFO_R_OK)
5425 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5426 if (ret != PMINFO_R_OK) {
5427 pkgmgrinfo_appinfo_filter_destroy(handle);
5430 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5431 if (ret != PMINFO_R_OK) {
5432 pkgmgrinfo_appinfo_filter_destroy(handle);
5435 printf("No of capp: %d\n", count);
5436 pkgmgrinfo_appinfo_filter_destroy(handle);
5441 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5442 const char *property, const char *value);
5445 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5446 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5448 * @par This API is for package-manager client application
5449 * @par Sync (or) Async : Synchronous API
5451 * @param[in] handle pointer to the application info filter handle.
5452 * @param[in] app_cb callback function.
5453 * @param[in] user_data user data to be passed to the callback function
5454 * @return 0 if success, error code(<0) if fail
5455 * @retval PMINFO_R_OK success
5456 * @retval PMINFO_R_EINVAL invalid argument
5457 * @retval PMINFO_R_ERROR internal error
5458 * @pre pkgmgrinfo_appinfo_filter_create()
5459 * @post pkgmgrinfo_appinfo_filter_destroy()
5460 * @see pkgmgrinfo_appinfo_filter_count()
5462 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5465 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5466 printf("appid : %s\n", appid);
5470 static int get_capp_list()
5473 pkgmgrinfo_appinfo_filter_h handle;
5474 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5475 if (ret != PMINFO_R_OK)
5477 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5478 if (ret != PMINFO_R_OK) {
5479 pkgmgrinfo_appinfo_filter_destroy(handle);
5482 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5483 if (ret != PMINFO_R_OK) {
5484 pkgmgrinfo_appinfo_filter_destroy(handle);
5487 pkgmgrinfo_appinfo_filter_destroy(handle);
5492 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5493 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5494 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5495 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5498 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5499 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5500 * @brief This API counts the application that satisfy the filter conditions
5502 * @par This API is for package-manager client application
5503 * @par Sync (or) Async : Synchronous API
5505 * @param[in] handle pointer to the application info filter handle.
5506 * @param[in] count pointer to store count value
5507 * @param[in] uid the addressee user id of the instruction
5508 * @return 0 if success, error code(<0) if fail
5509 * @retval PMINFO_R_OK success
5510 * @retval PMINFO_R_EINVAL invalid argument
5511 * @retval PMINFO_R_ERROR internal error
5512 * @pre pkgmgrinfo_appinfo_filter_create()
5513 * @post pkgmgrinfo_appinfo_filter_destroy()
5514 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5516 static int get_capp_count()
5520 pkgmgrinfo_appinfo_filter_h handle;
5521 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5522 if (ret != PMINFO_R_OK)
5524 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5525 if (ret != PMINFO_R_OK) {
5526 pkgmgrinfo_appinfo_filter_destroy(handle);
5529 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5530 if (ret != PMINFO_R_OK) {
5531 pkgmgrinfo_appinfo_filter_destroy(handle);
5534 printf("No of capp: %d\n", count);
5535 pkgmgrinfo_appinfo_filter_destroy(handle);
5540 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5541 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5543 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5544 * @brief This API creates the application's metadata information filter handle from db.
5546 * @par This API is for package-manager client application
5547 * @par Sync (or) Async : Synchronous API
5549 * @param[out] handle pointer to the application metadata info filter handle.
5550 * @return 0 if success, error code(<0) if fail
5551 * @retval PMINFO_R_OK success
5552 * @retval PMINFO_R_EINVAL invalid argument
5553 * @retval PMINFO_R_ERROR internal error
5555 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5556 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5558 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5561 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5562 printf("appid : %s\n", appid);
5566 static int get_app_list(const char *mkey, const char *mvalue)
5569 pkgmgrinfo_appinfo_metadata_filter_h handle;
5570 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5571 if (ret != PMINFO_R_OK)
5573 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5574 if (ret != PMINFO_R_OK) {
5575 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5578 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5579 if (ret != PMINFO_R_OK) {
5580 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5583 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5588 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5591 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5592 * @brief This API destroys the application's metadata information filter handle.
5594 * @par This API is for package-manager client application
5595 * @par Sync (or) Async : Synchronous API
5597 * @param[in] handle pointer to the application metadata info filter handle.
5598 * @return 0 if success, error code(<0) if fail
5599 * @retval PMINFO_R_OK success
5600 * @retval PMINFO_R_EINVAL invalid argument
5601 * @retval PMINFO_R_ERROR internal error
5602 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5604 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5606 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5609 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5610 printf("appid : %s\n", appid);
5614 static int get_app_list(const char *mkey, const char *mvalue)
5617 pkgmgrinfo_appinfo_metadata_filter_h handle;
5618 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5619 if (ret != PMINFO_R_OK)
5621 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5622 if (ret != PMINFO_R_OK) {
5623 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5626 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5627 if (ret != PMINFO_R_OK) {
5628 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5631 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5636 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5639 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5640 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5641 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5643 * @par This API is for package-manager client application
5644 * @par Sync (or) Async : Synchronous API
5646 * @param[in] handle pointer to the application metadata info filter handle.
5647 * @param[in] key pointer to metadata key
5648 * @param[in] value pointer to metadata value
5649 * @return 0 if success, error code(<0) if fail
5650 * @retval PMINFO_R_OK success
5651 * @retval PMINFO_R_EINVAL invalid argument
5652 * @retval PMINFO_R_ERROR internal error
5653 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5654 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5655 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5657 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5660 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5661 printf("appid : %s\n", appid);
5665 static int get_app_list(const char *mkey, const char *mvalue)
5668 pkgmgrinfo_appinfo_metadata_filter_h handle;
5669 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5670 if (ret != PMINFO_R_OK)
5672 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5673 if (ret != PMINFO_R_OK) {
5674 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5677 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5678 if (ret != PMINFO_R_OK) {
5679 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5682 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5687 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5688 const char *key, const char *value);
5691 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5692 * @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)
5693 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5694 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5695 * negative value, no more callbacks will be called and API will return.
5697 * @par This API is for package-manager client application
5698 * @par Sync (or) Async : Synchronous API
5700 * @param[in] handle pointer to the application metadata info filter handle.
5701 * @param[in] app_cb function pointer to callback
5702 * @param[in] user_data pointer to user data
5703 * @param[in] uid the addressee user id of the instruction
5704 * @return 0 if success, error code(<0) if fail
5705 * @retval PMINFO_R_OK success
5706 * @retval PMINFO_R_EINVAL invalid argument
5707 * @retval PMINFO_R_ERROR internal error
5708 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5709 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5711 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5714 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5715 printf("appid : %s\n", appid);
5719 static int get_app_list(const char *mkey, const char *mvalue)
5722 pkgmgrinfo_appinfo_metadata_filter_h handle;
5723 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5724 if (ret != PMINFO_R_OK)
5726 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5727 if (ret != PMINFO_R_OK) {
5728 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5731 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5732 if (ret != PMINFO_R_OK) {
5733 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5736 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5741 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5742 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5743 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5744 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5746 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5747 * @brief This API creates the package cert information handle to get data from db.
5749 * @par This API is for package-manager client application
5750 * @par Sync (or) Async : Synchronous API
5752 * @param[out] handle pointer to the package cert handle.
5753 * @return 0 if success, error code(<0) if fail
5754 * @retval PMINFO_R_OK success
5755 * @retval PMINFO_R_EINVAL invalid argument
5756 * @retval PMINFO_R_ERROR internal error
5758 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5759 * @see pkgmgrinfo_pkginfo_get_cert_value()
5760 * @see pkgmgrinfo_pkginfo_load_certinfo()
5762 static int get_cert_info(const char *pkgid)
5765 pkgmgrinfo_certinfo_h handle;
5766 char *auth_cert = NULL;
5767 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5768 if (ret != PMINFO_R_OK)
5770 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5771 if (ret != PMINFO_R_OK) {
5772 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5775 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5776 if (ret != PMINFO_R_OK) {
5777 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5780 printf("Author root certificate: %s\n", auth_root);
5781 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5786 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5789 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5790 * @brief This API loads the package cert information handle with data from db.
5792 * @par This API is for package-manager client application
5793 * @par Sync (or) Async : Synchronous API
5795 * @param[in] pkgid pointer to the package ID.
5796 * @param[in] handle pointer to the package cert handle.
5797 * @return 0 if success, error code(<0) if fail
5798 * @retval PMINFO_R_OK success
5799 * @retval PMINFO_R_EINVAL invalid argument
5800 * @retval PMINFO_R_ERROR internal error
5801 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5802 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5803 * @see pkgmgrinfo_pkginfo_get_cert_value()
5805 static int get_cert_info(const char *pkgid)
5808 pkgmgrinfo_certinfo_h handle;
5809 char *auth_cert = NULL;
5810 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5811 if (ret != PMINFO_R_OK)
5813 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5814 if (ret != PMINFO_R_OK) {
5815 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5818 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5819 if (ret != PMINFO_R_OK) {
5820 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5823 printf("Author root certificate: %s\n", auth_root);
5824 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5829 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5832 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5833 * @brief This API gets the package cert information from the handle
5835 * @par This API is for package-manager client application
5836 * @par Sync (or) Async : Synchronous API
5838 * @param[in] handle pointer to the package cert handle.
5839 * @param[in] cert_type certificate type
5840 * @param[out] cert_value pointer to hold certificate value
5841 * @return 0 if success, error code(<0) if fail
5842 * @retval PMINFO_R_OK success
5843 * @retval PMINFO_R_EINVAL invalid argument
5844 * @retval PMINFO_R_ERROR internal error
5845 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5846 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5847 * @see pkgmgrinfo_pkginfo_load_certinfo()
5849 static int get_cert_info(const char *pkgid)
5852 pkgmgrinfo_certinfo_h handle;
5853 char *auth_cert = NULL;
5854 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5855 if (ret != PMINFO_R_OK)
5857 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5858 if (ret != PMINFO_R_OK) {
5859 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5862 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5863 if (ret != PMINFO_R_OK) {
5864 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5867 printf("Author root certificate: %s\n", auth_root);
5868 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5873 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5876 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5877 * @brief This API destroys the package cert information handle freeing up all the resources
5879 * @par This API is for package-manager client application
5880 * @par Sync (or) Async : Synchronous API
5882 * @param[in] handle pointer to the package cert handle.
5883 * @return 0 if success, error code(<0) if fail
5884 * @retval PMINFO_R_OK success
5885 * @retval PMINFO_R_EINVAL invalid argument
5886 * @retval PMINFO_R_ERROR internal error
5887 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5889 * @see pkgmgrinfo_pkginfo_load_certinfo()
5891 static int get_cert_info(const char *pkgid)
5894 pkgmgrinfo_certinfo_h handle;
5895 char *auth_cert = NULL;
5896 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5897 if (ret != PMINFO_R_OK)
5899 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5900 if (ret != PMINFO_R_OK) {
5901 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5904 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5905 if (ret != PMINFO_R_OK) {
5906 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5909 printf("Author root certificate: %s\n", auth_root);
5910 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5915 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5918 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5919 * @brief This API deletes the package cert information from DB
5921 * @par This API is for package-manager client application
5922 * @par Sync (or) Async : Synchronous API
5924 * @param[in] pkgid pointer to the package ID.
5925 * @return 0 if success, error code(<0) if fail
5926 * @retval PMINFO_R_OK success
5927 * @retval PMINFO_R_EINVAL invalid argument
5928 * @retval PMINFO_R_ERROR internal error
5932 static int delete_cert_info(const char *pkgid)
5935 ret = pkgmgrinfo_delete_certinfo(pkgid);
5936 if (ret != PMINFO_R_OK)
5942 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5943 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5946 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5947 * @brief This API creates the package cert information handle to set data in db.
5949 * @par This API is for package-manager client application
5950 * @par Sync (or) Async : Synchronous API
5952 * @param[out] handle pointer to the package cert handle.
5953 * @return 0 if success, error code(<0) if fail
5954 * @retval PMINFO_R_OK success
5955 * @retval PMINFO_R_EINVAL invalid argument
5956 * @retval PMINFO_R_ERROR internal error
5958 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5959 * @see pkgmgrinfo_set_cert_value()
5960 * @see pkgmgrinfo_save_certinfo()
5962 static int set_cert_in_db(const char *pkgid)
5965 pkgmgrinfo_instcertinfo_h handle;
5966 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5967 if (ret != PMINFO_R_OK)
5969 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5970 if (ret != PMINFO_R_OK) {
5971 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5974 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5975 if (ret != PMINFO_R_OK) {
5976 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5979 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5984 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5987 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5988 * @brief This API sets the package cert information in the handle.
5990 * @par This API is for package-manager client application
5991 * @par Sync (or) Async : Synchronous API
5993 * @param[in] handle pointer to the package cert handle.
5994 * @param[in] cert_type certificate type.
5995 * @param[in] cert_value certificate value.
5996 * @return 0 if success, error code(<0) if fail
5997 * @retval PMINFO_R_OK success
5998 * @retval PMINFO_R_EINVAL invalid argument
5999 * @retval PMINFO_R_ERROR internal error
6000 * @pre pkgmgrinfo_create_certinfo_set_handle()
6001 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6002 * @see pkgmgrinfo_save_certinfo()
6004 static int set_cert_in_db(const char *pkgid)
6007 pkgmgrinfo_instcertinfo_h handle;
6008 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6009 if (ret != PMINFO_R_OK)
6011 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6012 if (ret != PMINFO_R_OK) {
6013 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6016 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6017 if (ret != PMINFO_R_OK) {
6018 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6021 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6026 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6029 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6030 * @brief This API saves the package cert information in the DB.
6032 * @par This API is for package-manager client application
6033 * @par Sync (or) Async : Synchronous API
6035 * @param[in] pkgid pointer to the package ID.
6036 * @param[in] handle pointer to the package cert handle.
6037 * @return 0 if success, error code(<0) if fail
6038 * @retval PMINFO_R_OK success
6039 * @retval PMINFO_R_EINVAL invalid argument
6040 * @retval PMINFO_R_ERROR internal error
6041 * @pre pkgmgrinfo_create_certinfo_set_handle()
6042 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6043 * @see pkgmgrinfo_save_certinfo()
6045 static int set_cert_in_db(const char *pkgid)
6048 pkgmgrinfo_instcertinfo_h handle;
6049 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6050 if (ret != PMINFO_R_OK)
6052 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6053 if (ret != PMINFO_R_OK) {
6054 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6057 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6058 if (ret != PMINFO_R_OK) {
6059 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6062 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6067 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6070 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6071 * @brief This API destroys the package cert information handle freeing up all the resources.
6073 * @par This API is for package-manager client application
6074 * @par Sync (or) Async : Synchronous API
6076 * @param[in] handle pointer to the package cert handle.
6077 * @return 0 if success, error code(<0) if fail
6078 * @retval PMINFO_R_OK success
6079 * @retval PMINFO_R_EINVAL invalid argument
6080 * @retval PMINFO_R_ERROR internal error
6081 * @pre pkgmgrinfo_create_certinfo_set_handle()
6083 * @see pkgmgrinfo_save_certinfo()
6085 static int set_cert_in_db(const char *pkgid)
6088 pkgmgrinfo_instcertinfo_h handle;
6089 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6090 if (ret != PMINFO_R_OK)
6092 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6093 if (ret != PMINFO_R_OK) {
6094 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6097 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6098 if (ret != PMINFO_R_OK) {
6099 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6102 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6107 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6110 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6111 * @brief This API gets the datacontrol info
6113 * @par This API is for package-manager client application
6114 * @par Sync (or) Async : Synchronous API
6116 * @param[in] providerid pointer to the providerid of dataconltrol.
6117 * @param[in] type pointer to the type of dataconltrol.
6118 * @param[out] appid pointer to hold appid, need to free after using
6119 * @param[out] access pointer to hold access, need to free after using
6120 * @return 0 if success, error code(<0) if fail
6121 * @retval PMINFO_R_OK success
6122 * @retval PMINFO_R_EINVAL invalid argument
6123 * @retval PMINFO_R_ERROR internal error
6126 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6129 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6130 * @brief This API gets the application 'guest mode visibility' value from the DB
6132 * @par This API is for package-manager client application
6133 * @par Sync (or) Async : Synchronous API
6135 * @param[in] handle pointer to application info handle
6136 * @param[out] status pointer to hold app guest mode visibility value
6137 * @return 0 if success, error code(<0) if fail
6138 * @retval PMINFO_R_OK success
6139 * @retval PMINFO_R_EINVAL invalid argument
6140 * @retval PMINFO_R_ERROR internal error
6141 * @pre pkgmgrinfo_appinfo_get_appinfo()
6142 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6143 * @see pkgmgrinfo_appinfo_get_appid()
6144 * @see pkgmgrinfo_appinfo_is_multiple()
6146 static int get_app_guestmode_visibility(const char *appid)
6150 pkgmgrinfo_appinfo_h handle;
6151 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6152 if (ret != PMINFO_R_OK)
6154 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6155 if (ret != PMINFO_R_OK) {
6156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6159 printf("app guest mode visibility: %d\n", status);
6160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6165 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6168 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6169 * @brief This API sets the package 'installed_storage' value in db
6171 * @par This API is for package-manager client application
6172 * @par Sync (or) Async : Synchronous API
6174 * @param[in] pkgid pointer to the package ID.
6175 * @param[in] location package install location
6176 * @param[in] external_pkg_path image path if pkg has installed at external storage
6177 * @return 0 if success, error code(<0) if fail
6178 * @retval PMINFO_R_OK success
6179 * @retval PMINFO_R_EINVAL invalid argument
6180 * @retval PMINFO_R_ERROR internal error
6182 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6186 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6187 if (ret != PMINFO_R_OK) {
6194 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6195 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6197 /* version compare */
6198 int pkgmgrinfo_compare_package_version(const char *current_version,
6199 const char *target_version, pkgmgrinfo_version_compare_type *res);
6206 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6207 int flag, void *user_data, uid_t uid);
6208 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6209 int flag, void *user_data);
6210 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6211 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6213 int pkgmgrinfo_appinfo_get_installed_list_full(
6214 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6217 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6218 pkgmgrinfo_archiveinfo_h *handle);
6219 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6220 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6221 const char **pkgid);
6222 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6224 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6225 const char **version);
6226 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6227 const char **api_version);
6228 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6229 const char **description);
6230 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6231 const char **label);
6232 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6233 const char **author);
6234 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6235 const unsigned char **icon, size_t *size);
6238 * @pkgmgrinfo client API end
6246 #endif /* __PKG_INFO_H__ */