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_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
115 /** Integer property for filtering based on package info*/
116 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
145 /** Integer property for filtering app support mode */
146 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
148 /** Boolean property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
169 /** will be updated*/
170 /** string property for filtering based on pkg info*/
171 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
173 /* For multiuser support */
174 const char *getIconPath(uid_t uid, bool readonly);
175 char *getUserPkgParserDBPath(void);
176 char *getUserPkgParserDBPathUID(uid_t uid);
177 char *getUserPkgCertDBPath(void);
178 char *getUserPkgCertDBPathUID(uid_t uid);
179 const char *getUserManifestPath(uid_t uid, bool readonly);
182 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
183 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
184 * @brief This API gets list of installed packages
186 * @par This API is for package-manager client application
187 * @par Sync (or) Async : Synchronous API
188 * @param[in] pkg_list_cb iteration function for list
189 * @param[in] user_data user data to be passed to callback function
190 * @param[in] uid the addressee user id of the instruction
191 * @return 0 if success, error code(<0) if fail
192 * @retval PMINFO_R_OK success
193 * @retval PMINFO_R_EINVAL invalid argument
194 * @retval PMINFO_R_ERROR internal error
198 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
202 pkgid1 = (char *)user_data;
203 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
204 if (strcmp(pkgid1, pkgid2) == 0) {
211 static int list_pkgs()
214 char *name = "helloworld";
215 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
216 if (ret != PMINFO_R_OK) {
223 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
224 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
227 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
228 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
229 * @brief This API gets list of disabled packages
231 * @par This API is for package-manager client application
232 * @par Sync (or) Async : Synchronous API
233 * @param[in] pkg_list_cb iteration function for list
234 * @param[in] user_data user data to be passed to callback function
235 * @param[in] uid the addressee user id of the instruction
236 * @return 0 if success, error code(<0) if fail
237 * @retval PMINFO_R_OK success
238 * @retval PMINFO_R_EINVAL invalid argument
239 * @retval PMINFO_R_ERROR internal error
243 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
244 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
247 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
248 * @brief This API creates the package information handle from db which is not disabled
250 * @par This API is for package-manager client application
251 * @par Sync (or) Async : Synchronous API
253 * @param[in] pkgid pointer to package ID
254 * @param[in] uid the addressee user id of the instruction
255 * @param[out] handle pointer to the package info handle.
256 * @return 0 if success, error code(<0) if fail
257 * @retval PMINFO_R_OK success
258 * @retval PMINFO_R_EINVAL invalid argument
259 * @retval PMINFO_R_ERROR internal error
261 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
262 * @see pkgmgrinfo_pkginfo_get_pkgid()
263 * @see pkgmgrinfo_pkginfo_is_removable()
265 static int get_pkg_type(const char *pkgid)
269 pkgmgrinfo_pkginfo_h handle;
270 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
271 if (ret != PMINFO_R_OK)
273 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
274 if (ret != PMINFO_R_OK) {
275 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
278 printf("pkgtype: %s\n", type);
279 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
284 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
285 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
288 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
289 * @brief This API creates the disabled package information handle from db
291 * @par This API is for package-manager client application
292 * @par Sync (or) Async : Synchronous API
294 * @param[in] pkgid pointer to package ID
295 * @param[in] uid the addressee user id of the instruction
296 * @param[out] handle pointer to the package info handle.
297 * @return 0 if success, error code(<0) if fail
298 * @retval PMINFO_R_OK success
299 * @retval PMINFO_R_EINVAL invalid argument
300 * @retval PMINFO_R_ERROR internal error
302 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
303 * @see pkgmgrinfo_pkginfo_get_pkginfo()
305 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
306 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
309 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
310 * @brief This API creates the package information handle from db regardless of its disable or storage status
312 * @par This API is for package-manager client application
313 * @par Sync (or) Async : Synchronous API
315 * @param[in] pkgid pointer to package ID
316 * @param[in] uid the addressee user id of the instruction
317 * @param[out] handle pointer to the package info handle.
318 * @return 0 if success, error code(<0) if fail
319 * @retval PMINFO_R_OK success
320 * @retval PMINFO_R_EINVAL invalid argument
321 * @retval PMINFO_R_ERROR internal error
323 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
324 * @see pkgmgrinfo_pkginfo_get_pkgid()
325 * @see pkgmgrinfo_pkginfo_is_removable()
327 static int get_pkg_type(const char *pkgid)
331 pkgmgrinfo_pkginfo_h handle;
332 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
333 if (ret != PMINFO_R_OK)
335 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
336 if (ret != PMINFO_R_OK) {
337 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
340 printf("pkgtype: %s\n", type);
341 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
346 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
347 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
350 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
351 * @brief This API gets the package name from the package ID
353 * @par This API is for package-manager client application
354 * @par Sync (or) Async : Synchronous API
356 * @param[in] handle pointer to package info handle
357 * @param[out] pkg_name pointer to hold package name
358 * @return 0 if success, error code(<0) if fail
359 * @retval PMINFO_R_OK success
360 * @retval PMINFO_R_EINVAL invalid argument
361 * @retval PMINFO_R_ERROR internal error
362 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
363 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
364 * @see pkgmgrinfo_pkginfo_get_type()
365 * @see pkgmgrinfo_pkginfo_is_removable()
367 static int get_pkg_name(const char *pkgid)
370 char *pkgname = NULL;
371 pkgmgrinfo_pkginfo_h handle;
372 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
373 if (ret != PMINFO_R_OK)
375 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
376 if (ret != PMINFO_R_OK) {
377 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
380 printf("pkgname: %s\n", pkgname);
381 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
386 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
389 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
390 * @brief This API gets the package id from the package ID
392 * @par This API is for package-manager client application
393 * @par Sync (or) Async : Synchronous API
395 * @param[in] handle pointer to package info handle
396 * @param[out] pkgid pointer to hold package id
397 * @return 0 if success, error code(<0) if fail
398 * @retval PMINFO_R_OK success
399 * @retval PMINFO_R_EINVAL invalid argument
400 * @retval PMINFO_R_ERROR internal error
401 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
402 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
403 * @see pkgmgrinfo_pkginfo_get_type()
404 * @see pkgmgrinfo_pkginfo_is_removable()
406 static int get_pkgid(const char *pkgid)
410 pkgmgrinfo_pkginfo_h handle;
411 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
412 if (ret != PMINFO_R_OK)
414 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
415 if (ret != PMINFO_R_OK) {
416 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
419 printf("pkg id: %s\n", pkg_id);
420 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
425 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
428 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
429 * @brief This API gets the package type from the package ID
431 * @par This API is for package-manager client application
432 * @par Sync (or) Async : Synchronous API
434 * @param[in] handle pointer to package info handle
435 * @param[out] type pointer to hold package type
436 * @return 0 if success, error code(<0) if fail
437 * @retval PMINFO_R_OK success
438 * @retval PMINFO_R_EINVAL invalid argument
439 * @retval PMINFO_R_ERROR internal error
440 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
441 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
442 * @see pkgmgrinfo_pkginfo_get_pkgid()
443 * @see pkgmgrinfo_pkginfo_is_removable()
445 static int get_pkg_type(const char *pkgid)
449 pkgmgrinfo_pkginfo_h handle;
450 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
451 if (ret != PMINFO_R_OK)
453 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
454 if (ret != PMINFO_R_OK) {
455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
458 printf("pkgtype: %s\n", type);
459 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
464 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
467 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
468 * @brief This API gets the package version from the package ID
470 * @par This API is for package-manager client application
471 * @par Sync (or) Async : Synchronous API
473 * @param[in] handle pointer to package info handle
474 * @param[out] version pointer to hold package version
475 * @return 0 if success, error code(<0) if fail
476 * @retval PMINFO_R_OK success
477 * @retval PMINFO_R_EINVAL invalid argument
478 * @retval PMINFO_R_ERROR internal error
479 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
480 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
481 * @see pkgmgrinfo_pkginfo_get_pkgid()
482 * @see pkgmgrinfo_pkginfo_is_removable()
484 static int get_pkg_version(const char *pkgid)
487 char *version = NULL;
488 pkgmgrinfo_pkginfo_h handle;
489 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
490 if (ret != PMINFO_R_OK)
492 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
493 if (ret != PMINFO_R_OK) {
494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
497 printf("pkg version: %s\n", version);
498 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
503 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
506 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
507 * @brief This API gets the package api_version from the package ID
509 * @par This API is for package-manager client application
510 * @par Sync (or) Async : Synchronous API
512 * @param[in] handle pointer to package info handle
513 * @param[out] api_version pointer to hold package api_version
514 * @return 0 if success, error code(<0) if fail
515 * @retval PMINFO_R_OK success
516 * @retval PMINFO_R_EINVAL invalid argument
517 * @retval PMINFO_R_ERROR internal error
518 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
519 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
520 * @see pkgmgrinfo_pkginfo_get_pkgid()
521 * @see pkgmgrinfo_pkginfo_is_removable()
523 static int get_pkg_api_version(const char *pkgid)
526 char *api_version = NULL;
527 pkgmgrinfo_pkginfo_h handle = NULL;
528 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
529 if (ret != PMINFO_R_OK)
531 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
532 if (ret != PMINFO_R_OK) {
533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
536 printf("pkg api_version: %s\n", api_version);
537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
542 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
545 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
546 * @brief This API gets tep(tizen expansion package) file name associated with the package
548 * @par This API is for package-manager client application
549 * @par Sync (or) Async : Synchronous API
551 * @param[in] handle pointer to the pkginfo handle.
552 * @param[out] tep_name pointer to hold tep name
553 * @return 0 if success, error code(<0) if fail
554 * @retval PMINFO_R_OK success
555 * @retval PMINFO_R_EINVAL invalid argument
556 * @retval PMINFO_R_ERROR internal error
557 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
558 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
559 * @see pkgmgrinfo_pkginfo_get_pkgid()
561 static int get_tep_name(const char *pkgid)
564 char *tep_name = NULL;
565 pkgmgrinfo_pkginfo_h handle = NULL;
566 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
567 if (ret != PMINFO_R_OK)
569 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
570 if (ret != PMINFO_R_OK) {
571 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
574 printf("TEP name is: %s\n", tep_name);
575 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
580 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
583 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
584 * @brief This API gets package mount point path associated with the package
585 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
587 * @par This API is for package-manager client application
588 * @par Sync (or) Async : Synchronous API
590 * @param[in] handle pointer to the pkginfo handle.
591 * @param[out] zip_mount_file pointer to hold zip mount file
592 * @return 0 if success, error code(<0) if fail
593 * @retval PMINFO_R_OK success
594 * @retval PMINFO_R_EINVAL invalid argument
595 * @retval PMINFO_R_ERROR internal error
596 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
597 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
598 * @see pkgmgrinfo_pkginfo_get_pkgid()
600 static int get_zip_mount_file(const char *pkgid)
603 char *zip_mount_file = NULL;
604 pkgmgrinfo_pkginfo_h handle = NULL;
605 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
606 if (ret != PMINFO_R_OK)
608 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
609 if (ret != PMINFO_R_OK) {
610 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
613 if (zip_mount_file != NULL)
614 printf("Zip mount path is: %s\n", zip_mount_file);
615 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
623 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
624 * @brief This API gets package external image path associated with the package
625 * if package is installed in external storage.
626 * Otherwise, the return value will be PMINFO_R_ENOENT.
628 * @par This API is for package-manager client application
629 * @par Sync (or) Async : Synchronous API
631 * @param[in] handle pointer to the pkginfo handle.
632 * @param[out] ext_image_path pointer to hold external image path
633 * @return 0 if success, error code(<0) if fail
634 * @retval PMINFO_R_OK success
635 * @retval PMINFO_R_EINVAL invalid argument
636 * @retval PMINFO_R_ERROR internal error
637 * @revall PMINFO_R_ENOENT no valid data
638 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
639 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
640 * @see pkgmgrinfo_pkginfo_get_pkgid()
642 static int get_external_image_path(const char *pkgid)
645 char *ext_image_path = NULL;
646 pkgmgrinfo_pkginfo_h handle = NULL;
647 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
648 if (ret != PMINFO_R_OK)
650 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
651 if (ret != PMINFO_R_OK) {
652 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
655 printf("external image path is: %s\n", ext_image_path);
656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
661 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
664 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
665 * @brief This API gets the package install location from the package ID
667 * @par This API is for package-manager client application
668 * @par Sync (or) Async : Synchronous API
670 * @param[in] handle pointer to package info handle
671 * @param[out] location pointer to hold package install location
672 * @return 0 if success, error code(<0) if fail
673 * @retval PMINFO_R_OK success
674 * @retval PMINFO_R_EINVAL invalid argument
675 * @retval PMINFO_R_ERROR internal error
676 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
677 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
678 * @see pkgmgrinfo_pkginfo_get_pkgid()
679 * @see pkgmgrinfo_pkginfo_is_removable()
681 static int get_pkg_install_location(const char *pkgid)
684 pkgmgrinfo_install_location location;
685 pkgmgrinfo_pkginfo_h handle;
686 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
687 if (ret != PMINFO_R_OK)
689 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
690 if (ret != PMINFO_R_OK) {
691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
694 printf("pkg install location: %d\n", location);
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
700 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
703 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
704 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
705 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
706 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
708 * @par This API is for package-manager client application
709 * @par Sync (or) Async : Synchronous API
711 * @param[in] handle pointer to package info handle
712 * @param[out] size pointer to hold package size
713 * @return 0 if success, error code(<0) if fail
714 * @retval PMINFO_R_OK success
715 * @retval PMINFO_R_EINVAL invalid argument
716 * @retval PMINFO_R_ERROR internal error
717 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
718 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
719 * @see pkgmgrinfo_pkginfo_get_pkgid()
720 * @see pkgmgrinfo_pkginfo_is_removable()
722 static int get_pkg_size(const char *pkgid)
726 pkgmgrinfo_pkginfo_h handle;
727 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
728 if (ret != PMINFO_R_OK)
730 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
731 if (ret != PMINFO_R_OK) {
732 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
735 printf("pkgsize: %d\n", size);
736 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
741 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
744 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
745 * @brief This API gets the package icon from the package ID
747 * @par This API is for package-manager client application
748 * @par Sync (or) Async : Synchronous API
750 * @param[in] handle pointer to package info handle
751 * @param[out] icon pointer to hold package icon
752 * @return 0 if success, error code(<0) if fail
753 * @retval PMINFO_R_OK success
754 * @retval PMINFO_R_EINVAL invalid argument
755 * @retval PMINFO_R_ERROR internal error
756 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
757 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
758 * @see pkgmgrinfo_pkginfo_get_pkgid()
759 * @see pkgmgrinfo_pkginfo_is_removable()
761 static int get_pkg_icon(const char *pkgid)
765 pkgmgrinfo_pkginfo_h handle;
766 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
767 if (ret != PMINFO_R_OK)
769 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
770 if (ret != PMINFO_R_OK) {
771 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
774 printf("pkg icon: %s\n", icon);
775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
780 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
783 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
784 * @brief This API gets the package label from the package ID
786 * @par This API is for package-manager client application
787 * @par Sync (or) Async : Synchronous API
789 * @param[in] handle pointer to package info handle
790 * @param[out] label pointer to hold package label
791 * @return 0 if success, error code(<0) if fail
792 * @retval PMINFO_R_OK success
793 * @retval PMINFO_R_EINVAL invalid argument
794 * @retval PMINFO_R_ERROR internal error
795 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
796 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
797 * @see pkgmgrinfo_pkginfo_get_pkgid()
798 * @see pkgmgrinfo_pkginfo_is_removable()
800 static int get_pkg_label(const char *pkgid)
804 pkgmgrinfo_pkginfo_h handle;
805 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
806 if (ret != PMINFO_R_OK)
808 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
809 if (ret != PMINFO_R_OK) {
810 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
813 printf("pkg label: %s\n", label);
814 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
819 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
822 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
823 * @brief This API gets the package description from the package ID
825 * @par This API is for package-manager client application
826 * @par Sync (or) Async : Synchronous API
828 * @param[in] handle pointer to package info handle
829 * @param[out] description pointer to hold package description
830 * @return 0 if success, error code(<0) if fail
831 * @retval PMINFO_R_OK success
832 * @retval PMINFO_R_EINVAL invalid argument
833 * @retval PMINFO_R_ERROR internal error
834 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
835 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
836 * @see pkgmgrinfo_pkginfo_get_pkgid()
837 * @see pkgmgrinfo_pkginfo_is_removable()
839 static int get_pkg_description(const char *pkgid)
842 char *description = NULL;
843 pkgmgrinfo_pkginfo_h handle;
844 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
845 if (ret != PMINFO_R_OK)
847 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
848 if (ret != PMINFO_R_OK) {
849 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
852 printf("pkg description: %s\n", description);
853 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
858 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
861 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
862 * @brief This API gets the package's author name from the package ID
864 * @par This API is for package-manager client application
865 * @par Sync (or) Async : Synchronous API
867 * @param[in] handle pointer to package info handle
868 * @param[out] author_name pointer to hold package author name
869 * @return 0 if success, error code(<0) if fail
870 * @retval PMINFO_R_OK success
871 * @retval PMINFO_R_EINVAL invalid argument
872 * @retval PMINFO_R_ERROR internal error
873 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
874 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
875 * @see pkgmgrinfo_pkginfo_get_pkgid()
876 * @see pkgmgrinfo_pkginfo_is_removable()
878 static int get_pkg_author_name(const char *pkgid)
881 char *author_name = NULL;
882 pkgmgrinfo_pkginfo_h handle;
883 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
884 if (ret != PMINFO_R_OK)
886 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
887 if (ret != PMINFO_R_OK) {
888 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
891 printf("pkg author name: %s\n", author_name);
892 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
897 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
900 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
901 * @brief This API gets the package's author email from the package ID
903 * @par This API is for package-manager client application
904 * @par Sync (or) Async : Synchronous API
906 * @param[in] handle pointer to package info handle
907 * @param[out] author_email pointer to hold package author email
908 * @return 0 if success, error code(<0) if fail
909 * @retval PMINFO_R_OK success
910 * @retval PMINFO_R_EINVAL invalid argument
911 * @retval PMINFO_R_ERROR internal error
912 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
913 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
914 * @see pkgmgrinfo_pkginfo_get_pkgid()
915 * @see pkgmgrinfo_pkginfo_is_removable()
917 static int get_pkg_author_email(const char *pkgid)
920 char *author_email = NULL;
921 pkgmgrinfo_pkginfo_h handle;
922 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
923 if (ret != PMINFO_R_OK)
925 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
926 if (ret != PMINFO_R_OK) {
927 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
930 printf("pkg author email: %s\n", author_email);
931 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
936 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
939 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
940 * @brief This API gets the package's author href from the package ID
942 * @par This API is for package-manager client application
943 * @par Sync (or) Async : Synchronous API
945 * @param[in] handle pointer to package info handle
946 * @param[out] author_href pointer to hold package author href
947 * @return 0 if success, error code(<0) if fail
948 * @retval PMINFO_R_OK success
949 * @retval PMINFO_R_EINVAL invalid argument
950 * @retval PMINFO_R_ERROR internal error
951 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
952 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
953 * @see pkgmgrinfo_pkginfo_get_pkgid()
954 * @see pkgmgrinfo_pkginfo_is_removable()
956 static int get_pkg_author_href(const char *pkgid)
959 char *author_href = NULL;
960 pkgmgrinfo_pkginfo_h handle;
961 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
962 if (ret != PMINFO_R_OK)
964 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
965 if (ret != PMINFO_R_OK) {
966 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
969 printf("pkg author href: %s\n", author_href);
970 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
975 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
978 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
979 * @brief This API gets the package installed storagae value from the package ID
981 * @par This API is for package-manager client application
982 * @par Sync (or) Async : Synchronous API
984 * @param[in] handle pointer to package info handle
985 * @param[out] storage pointer to hold package installed storage
986 * @return 0 if success, error code(<0) if fail
987 * @retval PMINFO_R_OK success
988 * @retval PMINFO_R_EINVAL invalid argument
989 * @retval PMINFO_R_ERROR internal error
990 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
991 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
992 * @see pkgmgrinfo_pkginfo_get_pkgid()
993 * @see pkgmgrinfo_pkginfo_is_removable()
995 static int get_pkg_installed_storage(const char *pkgid)
998 pkgmgrinfo_installed_storage storage;
999 pkgmgrinfo_pkginfo_h handle;
1000 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1001 if (ret != PMINFO_R_OK)
1003 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1004 if (ret != PMINFO_R_OK) {
1005 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1008 printf("pkg installed storage: %d\n", storage);
1009 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1014 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1017 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1018 * @brief This API gets the installed time of package from the package ID
1020 * @par This API is for package-manager client application
1021 * @par Sync (or) Async : Synchronous API
1023 * @param[in] handle pointer to package info handle
1024 * @param[out] installed_time pointer to hold installed time of package
1025 * @return 0 if success, error code(<0) if fail
1026 * @retval PMINFO_R_OK success
1027 * @retval PMINFO_R_EINVAL invalid argument
1028 * @retval PMINFO_R_ERROR internal error
1029 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1030 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1031 * @see pkgmgrinfo_pkginfo_get_pkgid()
1032 * @see pkgmgrinfo_pkginfo_is_removable()
1034 static int get_pkg_installed_time(const char *pkgid)
1037 int installed_time = 0;
1038 pkgmgrinfo_pkginfo_h handle;
1039 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1040 if (ret != PMINFO_R_OK)
1042 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1043 if (ret != PMINFO_R_OK) {
1044 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1047 printf("installed_time: %d\n", installed_time);
1048 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1053 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1056 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1057 * @brief This API gets the launch mode of package from the package ID
1059 * @par This API is for package-manager client application
1060 * @par Sync (or) Async : Synchronous API
1062 * @param[in] handle pointer to package info handle
1063 * @param[out] mode pointer to hold launch mode of package
1064 * @return 0 if success, error code(<0) if fail
1065 * @retval PMINFO_R_OK success
1066 * @retval PMINFO_R_EINVAL invalid argument
1067 * @retval PMINFO_R_ERROR internal error
1068 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1069 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1070 * @see pkgmgrinfo_pkginfo_get_pkgid()
1071 * @see pkgmgrinfo_pkginfo_is_removable()
1073 static int get_pkg_launch_mode(const char *pkgid)
1076 char *launch_mode = NULL;
1077 pkgmgrinfo_pkginfo_h handle;
1078 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1079 if (ret != PMINFO_R_OK)
1081 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1082 if (ret != PMINFO_R_OK) {
1083 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1086 printf("launch mode: %s\n", mode);
1087 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1092 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1095 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1096 * @brief This API gets the store client id of package from the package ID
1098 * @par This API is for package-manager client application
1099 * @par Sync (or) Async : Synchronous API
1101 * @param[in] handle pointer to package info handle
1102 * @param[out] storeclientid pointer to hold store client id of package
1103 * @return 0 if success, error code(<0) if fail
1104 * @retval PMINFO_R_OK success
1105 * @retval PMINFO_R_EINVAL invalid argument
1106 * @retval PMINFO_R_ERROR internal error
1107 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1108 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1109 * @see pkgmgrinfo_pkginfo_get_pkgid()
1110 * @see pkgmgrinfo_pkginfo_is_removable()
1112 static int get_pkg_storeclientid(const char *pkgid)
1115 char *storeclientid = 0;
1116 pkgmgrinfo_pkginfo_h handle;
1117 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1118 if (ret != PMINFO_R_OK)
1120 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1121 if (ret != PMINFO_R_OK) {
1122 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1125 printf(store client id: %s\n", storeclientid);
1126 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1131 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1134 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1135 * @brief This API gets the main app id of package from the package ID
1137 * @par This API is for package-manager client application
1138 * @par Sync (or) Async : Synchronous API
1140 * @param[in] handle pointer to package info handle
1141 * @param[out] mainappid pointer to hold main app id of package
1142 * @return 0 if success, error code(<0) if fail
1143 * @retval PMINFO_R_OK success
1144 * @retval PMINFO_R_EINVAL invalid argument
1145 * @retval PMINFO_R_ERROR internal error
1146 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1147 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1148 * @see pkgmgrinfo_pkginfo_get_pkgid()
1149 * @see pkgmgrinfo_pkginfo_is_removable()
1151 static int get_pkg_mainappid(const char *pkgid)
1154 char *mainappid = 0;
1155 pkgmgrinfo_pkginfo_h handle;
1156 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1157 if (ret != PMINFO_R_OK)
1159 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1160 if (ret != PMINFO_R_OK) {
1161 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1164 printf(main app id: %s\n", mainappid);
1165 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1170 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1173 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1174 * @brief This API gets the url of package from the package ID
1176 * @par This API is for package-manager client application
1177 * @par Sync (or) Async : Synchronous API
1179 * @param[in] handle pointer to package info handle
1180 * @param[out] url pointer to hold url of package
1181 * @return 0 if success, error code(<0) if fail
1182 * @retval PMINFO_R_OK success
1183 * @retval PMINFO_R_EINVAL invalid argument
1184 * @retval PMINFO_R_ERROR internal error
1185 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1186 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1187 * @see pkgmgrinfo_pkginfo_get_pkgid()
1188 * @see pkgmgrinfo_pkginfo_is_removable()
1190 static int get_pkg_url(const char *pkgid)
1194 pkgmgrinfo_pkginfo_h handle;
1195 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1196 if (ret != PMINFO_R_OK)
1198 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1199 if (ret != PMINFO_R_OK) {
1200 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1203 printf("url : %s\n", url);
1204 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1209 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1212 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1213 * @brief This API gets the root path of package
1215 * @par Sync (or) Async : Synchronous API
1217 * @param[in] handle pointer to package info handle
1218 * @param[out] path pointer to hold root path of package
1219 * @return 0 if success, error code(<0) if fail
1220 * @retval PMINFO_R_OK success
1221 * @retval PMINFO_R_EINVAL invalid argument
1222 * @retval PMINFO_R_ERROR internal error
1224 static int get_root_path(const char *pkgid)
1228 pkgmgrinfo_pkginfo_h handle;
1229 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1230 if (ret != PMINFO_R_OK)
1233 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1234 if (ret != PMINFO_R_OK) {
1235 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1238 printf("path : %s\n", path);
1239 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1245 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1249 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1250 * @brief This API gets the csc path of package
1252 * @par Sync (or) Async : Synchronous API
1254 * @param[in] handle pointer to package info handle
1255 * @param[out] path pointer to hold csc path of package
1256 * @return 0 if success, error code(<0) if fail
1257 * @retval PMINFO_R_OK success
1258 * @retval PMINFO_R_EINVAL invalid argument
1259 * @retval PMINFO_R_ERROR internal error
1261 static int get_csc_path(const char *pkgid)
1265 pkgmgrinfo_pkginfo_h handle;
1266 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1267 if (ret != PMINFO_R_OK)
1270 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1271 if (ret != PMINFO_R_OK) {
1272 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1275 printf("path : %s\n", path);
1276 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1282 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1285 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1286 * @brief This API gets the support_mode of package
1288 * @par Sync (or) Async : Synchronous API
1290 * @param[in] handle pointer to package info handle
1291 * @param[out] support_mode pointer to hold support_mode of package
1292 * @return 0 if success, error code(<0) if fail
1293 * @retval PMINFO_R_OK success
1294 * @retval PMINFO_R_EINVAL invalid argument
1295 * @retval PMINFO_R_ERROR internal error
1297 static int get_support_mode(const char *pkgid)
1300 int support_mode = 0;
1301 pkgmgrinfo_pkginfo_h handle = NULL;
1302 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1303 if (ret != PMINFO_R_OK)
1306 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1307 if (ret != PMINFO_R_OK) {
1308 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1311 printf("support_mode : %s\n", support_mode);
1312 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1318 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1321 * @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)
1322 * @brief This API compare the cert information from given package id
1324 * @par This API is for package-manager client application
1325 * @par Sync (or) Async : Synchronous API
1327 * @param[in] lhs_package_id pointer to first package ID
1328 * @param[in] rhs_package_id pointer to second package ID
1329 * @param[out] compare_result pointer to the compare result.
1330 * @return 0 if success, error code(<0) if fail
1331 * @retval PMINFO_R_OK success
1332 * @retval PMINFO_R_EINVAL invalid argument
1333 * @retval PMINFO_R_ERROR internal error
1335 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1336 * @see pkgmgrinfo_pkginfo_get_pkgid()
1337 * @see pkgmgrinfo_pkginfo_is_removable()
1339 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1342 pkgmgrinfo_cert_compare_result_type_e result;
1344 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1345 if (ret != PMINFO_R_OK) {
1348 printf("result: %d\n", result);
1353 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);
1354 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);
1356 * @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)
1357 * @brief This API compare the cert information from given app id
1359 * @par This API is for package-manager client application
1360 * @par Sync (or) Async : Synchronous API
1362 * @param[in] lhs_app_id pointer to first app ID
1363 * @param[in] rhs_app_id pointer to second app ID
1364 * @param[out] compare_result pointer to the compare result.
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
1370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1371 * @see pkgmgrinfo_pkginfo_get_pkgid()
1372 * @see pkgmgrinfo_pkginfo_is_removable()
1374 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1377 pkgmgrinfo_cert_compare_result_type_e result;
1379 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1380 if (ret != PMINFO_R_OK) {
1383 printf("result: %d\n", result);
1388 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);
1389 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);
1391 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1392 * @brief This API gets the package 'removable' value from the package ID
1394 * @par This API is for package-manager client application
1395 * @par Sync (or) Async : Synchronous API
1397 * @param[in] handle pointer to package info handle
1398 * @param[out] removable pointer to hold package removable value
1399 * @return 0 if success, error code(<0) if fail
1400 * @retval PMINFO_R_OK success
1401 * @retval PMINFO_R_EINVAL invalid argument
1402 * @retval PMINFO_R_ERROR internal error
1403 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1404 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1405 * @see pkgmgrinfo_pkginfo_get_pkgid()
1406 * @see pkgmgrinfo_pkginfo_is_readonly()
1408 static int get_pkg_removable(const char *pkgid)
1412 pkgmgrinfo_pkginfo_h handle;
1413 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1414 if (ret != PMINFO_R_OK)
1416 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1417 if (ret != PMINFO_R_OK) {
1418 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1421 printf("pkg removable: %d\n", removable);
1422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1427 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1430 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1431 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1433 * @par This API is for package-manager client application
1434 * @par Sync (or) Async : Synchronous API
1436 * @param[in] handle pointer to package info handle
1437 * @param[out] movable pointer to hold package movable state
1438 * @return 0 if success, error code(<0) if fail
1439 * @retval PMINFO_R_OK success
1440 * @retval PMINFO_R_EINVAL invalid argument
1441 * @retval PMINFO_R_ERROR internal error
1442 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1443 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1444 * @see pkgmgrinfo_pkginfo_get_pkgid()
1446 static int get_pkg_movable(const char *pkgid)
1450 pkgmgrinfo_pkginfo_h handle;
1451 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1452 if (ret != PMINFO_R_OK)
1454 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1455 if (ret != PMINFO_R_OK) {
1456 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1459 printf("pkg movable: %d\n", movable);
1460 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1465 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1468 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1469 * @brief This API gets the package 'preload' value from the package ID
1471 * @par This API is for package-manager client application
1472 * @par Sync (or) Async : Synchronous API
1474 * @param[in] handle pointer to package info handle
1475 * @param[out] preload pointer to hold package preload value
1476 * @return 0 if success, error code(<0) if fail
1477 * @retval PMINFO_R_OK success
1478 * @retval PMINFO_R_EINVAL invalid argument
1479 * @retval PMINFO_R_ERROR internal error
1480 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1481 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1482 * @see pkgmgrinfo_pkginfo_get_pkgid()
1483 * @see pkgmgrinfo_pkginfo_is_readonly()
1485 static int get_pkg_preload(const char *pkgid)
1489 pkgmgrinfo_pkginfo_h handle;
1490 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1491 if (ret != PMINFO_R_OK)
1493 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1494 if (ret != PMINFO_R_OK) {
1495 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1498 printf("pkg preload: %d\n", preload);
1499 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1504 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1507 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1508 * @brief This API gets the value for given handle is system or not
1510 * @par This API is for package-manager client application
1511 * @par Sync (or) Async : Synchronous API
1513 * @param[in] handle pointer to package info handle
1514 * @param[out] system pointer to hold system is or not
1515 * @return 0 if success, error code(<0) if fail
1516 * @retval PMINFO_R_OK success
1517 * @retval PMINFO_R_EINVAL invalid argument
1518 * @retval PMINFO_R_ERROR internal error
1519 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1520 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1521 * @see pkgmgrinfo_pkginfo_get_pkgid()
1522 * @see pkgmgrinfo_pkginfo_is_readonly()
1524 static int get_pkg_system(const char *pkgid)
1527 bool system = false;
1528 pkgmgrinfo_pkginfo_h handle = NULL;
1529 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1530 if (ret != PMINFO_R_OK)
1532 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1533 if (ret != PMINFO_R_OK) {
1534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1537 printf("pkg system: %d\n", system);
1538 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1543 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1546 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1547 * @brief This API gets the package 'readonly' value from the package ID
1549 * @par This API is for package-manager client application
1550 * @par Sync (or) Async : Synchronous API
1552 * @param[in] handle pointer to package info handle
1553 * @param[out] readonly pointer to hold package readonly value
1554 * @return 0 if success, error code(<0) if fail
1555 * @retval PMINFO_R_OK success
1556 * @retval PMINFO_R_EINVAL invalid argument
1557 * @retval PMINFO_R_ERROR internal error
1558 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1559 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1560 * @see pkgmgrinfo_pkginfo_get_pkgid()
1561 * @see pkgmgrinfo_pkginfo_is_removable()
1563 static int get_pkg_readonly(const char *pkgid)
1567 pkgmgrinfo_pkginfo_h handle;
1568 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1569 if (ret != PMINFO_R_OK)
1571 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1572 if (ret != PMINFO_R_OK) {
1573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1576 printf("pkg readonly: %d\n", readonly);
1577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1582 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1586 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1587 * @brief This API gets the package 'upate' value from the package ID
1589 * @par This API is for package-manager client application
1590 * @par Sync (or) Async : Synchronous API
1592 * @param[in] handle pointer to package info handle
1593 * @param[out] update pointer to hold package update value
1594 * @return 0 if success, error code(<0) if fail
1595 * @retval PMINFO_R_OK success
1596 * @retval PMINFO_R_EINVAL invalid argument
1597 * @retval PMINFO_R_ERROR internal error
1598 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1599 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1600 * @see pkgmgrinfo_pkginfo_get_pkgid()
1602 static int get_pkg_update(const char *pkgid)
1606 pkgmgrinfo_pkginfo_h handle;
1607 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1608 if (ret != PMINFO_R_OK)
1610 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1611 if (ret != PMINFO_R_OK) {
1612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1615 printf("pkg update: %d\n", update);
1616 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1621 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1624 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1625 * @brief This API gets the package 'support_disable' value from the package ID
1627 * @par This API is for package-manager client application
1628 * @par Sync (or) Async : Synchronous API
1630 * @param[in] handle pointer to package info handle
1631 * @param[out] support_disable pointer to hold package support_disable value
1632 * @return 0 if success, error code(<0) if fail
1633 * @retval PMINFO_R_OK success
1634 * @retval PMINFO_R_EINVAL invalid argument
1635 * @retval PMINFO_R_ERROR internal error
1636 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1637 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1638 * @see pkgmgrinfo_pkginfo_get_pkgid()
1640 static int get_pkg_support_disable(const char *pkgid)
1643 bool support_disable;
1644 pkgmgrinfo_pkginfo_h handle = NULL;
1645 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1646 if (ret != PMINFO_R_OK)
1648 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1649 if (ret != PMINFO_R_OK) {
1650 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1653 printf("pkg support_disable: %d\n", support_disable);
1654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1659 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1662 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1663 * @brief This API gets whethere the given package is global package or user package
1665 * @par This API is for package-manager client application
1666 * @par Sync (or) Async : Synchronous API
1668 * @param[in] handle pointer to package info handle
1669 * @param[in] global pointer to hold package global value
1670 * @return 0 if success, error code(<0) if fail
1671 * @retval PMINFO_R_OK success
1672 * @retval PMINFO_R_EINVAL invalid argument
1673 * @retval PMINFO_R_ERROR internal error
1674 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1675 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1676 * @see pkgmgrinfo_pkginfo_get_pkgid()
1677 static int get_pkg_support_disable(const char *pkgid)
1681 pkgmgrinfo_pkginfo_h handle = NULL;
1682 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1683 if (ret != PMINFO_R_OK)
1685 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1686 if (ret != PMINFO_R_OK) {
1687 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1690 printf("pkg is_global: %d\n", global);
1691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1696 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1699 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1700 * @brief This API gets the package 'accessible' value from the package ID
1702 * @par This API is for package-manager client application
1703 * @par Sync (or) Async : Synchronous API
1705 * @param[in] handle pointer to package info handle
1706 * @param[out] accessible pointer to hold package accessible value
1707 * @return 0 if success, error code(<0) if fail
1708 * @retval PMINFO_R_OK success
1709 * @retval PMINFO_R_EINVAL invalid argument
1710 * @retval PMINFO_R_ERROR internal error
1711 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1712 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1713 * @see pkgmgrinfo_pkginfo_get_pkgid()
1714 * @see pkgmgrinfo_pkginfo_is_readonly()
1716 static int get_pkg_accessible(const char *pkgid)
1720 pkgmgrinfo_pkginfo_h handle;
1721 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1722 if (ret != PMINFO_R_OK)
1724 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1725 if (ret != PMINFO_R_OK) {
1726 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1729 printf("pkg accessible: %d\n", accessible);
1730 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1735 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1738 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1739 * @brief This API destroys the package information handle freeing up all the resources
1741 * @par This API is for package-manager client application
1742 * @par Sync (or) Async : Synchronous API
1744 * @param[in] handle pointer to the package info handle
1745 * @return 0 if success, error code(<0) if fail
1746 * @retval PMINFO_R_OK success
1747 * @retval PMINFO_R_EINVAL invalid argument
1748 * @retval PMINFO_R_ERROR internal error
1749 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1751 * @see pkgmgrinfo_pkginfo_get_pkgid()
1752 * @see pkgmgrinfo_pkginfo_is_removable()
1754 static int get_pkg_type(const char *pkgid)
1758 pkgmgrinfo_pkginfo_h handle;
1759 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1760 if (ret != PMINFO_R_OK)
1762 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1763 if (ret != PMINFO_R_OK) {
1764 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1767 printf("pkgtype: %s\n", type);
1768 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1773 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1776 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1777 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1778 The query will search the entire package information collected from the manifest file of all the installed packages
1780 * @par This API is for package-manager client application
1781 * @par Sync (or) Async : Synchronous API
1783 * @param[out] handle pointer to the package info filter handle.
1784 * @return 0 if success, error code(<0) if fail
1785 * @retval PMINFO_R_OK success
1786 * @retval PMINFO_R_EINVAL invalid argument
1787 * @retval PMINFO_R_ERROR internal error
1789 * @post pkgmgrinfo_pkginfo_filter_destroy()
1790 * @see pkgmgrinfo_pkginfo_filter_count()
1791 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1793 static int get_tpk_pkg_count()
1797 pkgmgrinfo_pkginfo_filter_h handle;
1798 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1799 if (ret != PMINFO_R_OK)
1801 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1802 if (ret != PMINFO_R_OK) {
1803 pkgmgrinfo_pkginfo_filter_destroy(handle);
1806 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1807 if (ret != PMINFO_R_OK) {
1808 pkgmgrinfo_pkginfo_filter_destroy(handle);
1811 printf("No of tpk pkgs: %d\n", count);
1812 pkgmgrinfo_pkginfo_filter_destroy(handle);
1817 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1820 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1821 * @brief This API destroys the package information filter handle freeing up all the resources
1823 * @par This API is for package-manager client application
1824 * @par Sync (or) Async : Synchronous API
1826 * @param[in] handle pointer to the package info filter handle.
1827 * @return 0 if success, error code(<0) if fail
1828 * @retval PMINFO_R_OK success
1829 * @retval PMINFO_R_EINVAL invalid argument
1830 * @retval PMINFO_R_ERROR internal error
1831 * @pre pkgmgrinfo_pkginfo_filter_create()
1833 * @see pkgmgrinfo_pkginfo_filter_count()
1834 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1836 static int get_tpk_pkg_count()
1840 pkgmgrinfo_pkginfo_filter_h handle;
1841 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1842 if (ret != PMINFO_R_OK)
1844 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1845 if (ret != PMINFO_R_OK) {
1846 pkgmgrinfo_pkginfo_filter_destroy(handle);
1849 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1850 if (ret != PMINFO_R_OK) {
1851 pkgmgrinfo_pkginfo_filter_destroy(handle);
1854 printf("No of tpk pkgs: %d\n", count);
1855 pkgmgrinfo_pkginfo_filter_destroy(handle);
1860 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1863 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1864 * @brief This API adds a boolean filter property to the filter handle
1866 * @par This API is for package-manager client application
1867 * @par Sync (or) Async : Synchronous API
1869 * @param[in] handle pointer to the package info filter handle.
1870 * @param[in] property boolean property name.
1871 * @param[in] value value corresponding to the property.
1872 * @return 0 if success, error code(<0) if fail
1873 * @retval PMINFO_R_OK success
1874 * @retval PMINFO_R_EINVAL invalid argument
1875 * @retval PMINFO_R_ERROR internal error
1876 * @pre pkgmgrinfo_pkginfo_filter_create()
1877 * @post pkgmgrinfo_pkginfo_filter_destroy()
1878 * @see pkgmgrinfo_pkginfo_filter_count()
1879 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1881 static int get_preload_pkg_count()
1885 pkgmgrinfo_pkginfo_filter_h handle;
1886 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1887 if (ret != PMINFO_R_OK)
1889 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1890 if (ret != PMINFO_R_OK) {
1891 pkgmgrinfo_pkginfo_filter_destroy(handle);
1894 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1895 if (ret != PMINFO_R_OK) {
1896 pkgmgrinfo_pkginfo_filter_destroy(handle);
1899 printf("No of preload pkgs: %d\n", count);
1900 pkgmgrinfo_pkginfo_filter_destroy(handle);
1905 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1906 const char *property, const bool value);
1909 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1910 * @brief This API adds an integer filter property to the filter handle
1912 * @par This API is for package-manager client application
1913 * @par Sync (or) Async : Synchronous API
1915 * @param[in] handle pointer to the package info filter handle.
1916 * @param[in] property integer property name.
1917 * @param[in] value value corresponding to the property.
1918 * @return 0 if success, error code(<0) if fail
1919 * @retval PMINFO_R_OK success
1920 * @retval PMINFO_R_EINVAL invalid argument
1921 * @retval PMINFO_R_ERROR internal error
1922 * @pre pkgmgrinfo_pkginfo_filter_create()
1923 * @post pkgmgrinfo_pkginfo_filter_destroy()
1924 * @see pkgmgrinfo_pkginfo_filter_count()
1925 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1927 static int get_pkg_count()
1931 pkgmgrinfo_pkginfo_filter_h handle;
1932 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1933 if (ret != PMINFO_R_OK)
1935 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1936 if (ret != PMINFO_R_OK) {
1937 pkgmgrinfo_pkginfo_filter_destroy(handle);
1940 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1941 if (ret != PMINFO_R_OK) {
1942 pkgmgrinfo_pkginfo_filter_destroy(handle);
1945 printf("No of preload pkgs: %d\n", count);
1946 pkgmgrinfo_pkginfo_filter_destroy(handle);
1951 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1952 const char *property, const int value);
1955 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1956 * @brief This API adds a string filter property to the filter handle
1958 * @par This API is for package-manager client application
1959 * @par Sync (or) Async : Synchronous API
1961 * @param[in] handle pointer to the package info filter handle.
1962 * @param[in] property string property name.
1963 * @param[in] value value corresponding to the property.
1964 * @return 0 if success, error code(<0) if fail
1965 * @retval PMINFO_R_OK success
1966 * @retval PMINFO_R_EINVAL invalid argument
1967 * @retval PMINFO_R_ERROR internal error
1968 * @pre pkgmgrinfo_pkginfo_filter_create()
1969 * @post pkgmgrinfo_pkginfo_filter_destroy()
1970 * @see pkgmgrinfo_pkginfo_filter_count()
1971 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1973 static int get_tpk_pkg_count()
1977 pkgmgrinfo_pkginfo_filter_h handle;
1978 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1979 if (ret != PMINFO_R_OK)
1981 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1982 if (ret != PMINFO_R_OK) {
1983 pkgmgrinfo_pkginfo_filter_destroy(handle);
1986 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1987 if (ret != PMINFO_R_OK) {
1988 pkgmgrinfo_pkginfo_filter_destroy(handle);
1991 printf("No of tpk pkgs: %d\n", count);
1992 pkgmgrinfo_pkginfo_filter_destroy(handle);
1997 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1998 const char *property, const char *value);
2001 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2002 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2004 * @par This API is for package-manager client application
2005 * @par Sync (or) Async : Synchronous API
2007 * @param[in] handle pointer to the package info filter handle.
2008 * @param[in] pkg_cb callback function.
2009 * @param[in] user_data user data to be passed to the callback function
2010 * @return 0 if success, error code(<0) if fail
2011 * @retval PMINFO_R_OK success
2012 * @retval PMINFO_R_EINVAL invalid argument
2013 * @retval PMINFO_R_ERROR internal error
2014 * @pre pkgmgrinfo_pkginfo_filter_create()
2015 * @post pkgmgrinfo_pkginfo_filter_destroy()
2016 * @see pkgmgrinfo_pkginfo_filter_count()
2018 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2021 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2022 printf("pkg id : %s\n", pkgid);
2026 static int get_tpk_pkg_list()
2029 pkgmgrinfo_pkginfo_filter_h handle;
2030 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2031 if (ret != PMINFO_R_OK)
2033 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2034 if (ret != PMINFO_R_OK) {
2035 pkgmgrinfo_pkginfo_filter_destroy(handle);
2038 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2039 if (ret != PMINFO_R_OK) {
2040 pkgmgrinfo_pkginfo_filter_destroy(handle);
2043 pkgmgrinfo_pkginfo_filter_destroy(handle);
2048 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2049 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2050 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2051 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2054 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2055 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2056 * @brief This API counts the package that satisfy the filter conditions
2058 * @par This API is for package-manager client application
2059 * @par Sync (or) Async : Synchronous API
2061 * @param[in] handle pointer to the package info filter handle.
2062 * @param[in] count pointer to store the count value.
2063 * @param[in] uid the addressee user id of the instruction
2064 * @return 0 if success, error code(<0) if fail
2065 * @retval PMINFO_R_OK success
2066 * @retval PMINFO_R_EINVAL invalid argument
2067 * @retval PMINFO_R_ERROR internal error
2068 * @pre pkgmgrinfo_pkginfo_filter_create()
2069 * @post pkgmgrinfo_pkginfo_filter_destroy()
2070 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2072 static int get_tpk_pkg_count()
2076 pkgmgrinfo_pkginfo_filter_h handle;
2077 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2078 if (ret != PMINFO_R_OK)
2080 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2081 if (ret != PMINFO_R_OK) {
2082 pkgmgrinfo_pkginfo_filter_destroy(handle);
2085 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2086 if (ret != PMINFO_R_OK) {
2087 pkgmgrinfo_pkginfo_filter_destroy(handle);
2090 printf("No of tpk pkgs: %d\n", count);
2091 pkgmgrinfo_pkginfo_filter_destroy(handle);
2096 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2097 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2099 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2100 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2101 * @brief This API gets the list of privilege for a particular package
2103 * @par This API is for package-manager client application
2104 * @par Sync (or) Async : Synchronous API
2105 * @param[in] handle pointer to the package info handle.
2106 * @param[in] privilege_func callback function for list
2107 * @param[in] user_data user data to be passed to callback function
2108 * @return 0 if success, error code(<0) if fail
2109 * @retval PMINFO_R_OK success
2110 * @retval PMINFO_R_EINVAL invalid argument
2111 * @retval PMINFO_R_ERROR internal error
2112 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2113 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2115 int privilege_func(const char *name, void *user_data)
2117 if (strcmp(name, (char *)user_data) == 0)
2123 static int list_privilege(const char *package, char *privilege)
2126 pkgmgrinfo_pkginfo_h handle;
2127 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2128 if (ret != PMINFO_R_OK)
2130 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2131 if (ret != PMINFO_R_OK) {
2132 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2135 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2140 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2141 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2143 /* TODO: add doxygen comment here */
2144 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2147 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2148 * @brief This API copy the application information handle
2150 * @par This API is for package-manager client application
2151 * @par Sync (or) Async : Synchronous API
2153 * @param[in] handle pointer to the package info handle.
2154 * @param[out] handle pointer to the package info handle.
2155 * @return 0 if success, error code(<0) if fail
2156 * @retval PMINFO_R_OK success
2157 * @retval PMINFO_R_EINVAL invalid argument
2158 * @retval PMINFO_R_ERROR internal error
2160 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2162 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2166 pkgmgrinfo_pkginfo_h clone;
2168 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2169 if (ret != PMINFO_R_OK)
2173 printf("package: %s\n", clone->package);
2174 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2179 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2183 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2184 pkgmgrinfo_app_list_cb app_func, void *user_data)
2185 * @brief This API gets list of installed applications for a particular package
2187 * @par This API is for package-manager client application
2188 * @par Sync (or) Async : Synchronous API
2189 * @param[in] handle package info handle
2190 * @param[in] component application component
2191 * @param[in] app_func iteration function for list
2192 * @param[in] user_data user data to be passed to callback function
2193 * @return 0 if success, error code(<0) if fail
2194 * @retval PMINFO_R_OK success
2195 * @retval PMINFO_R_EINVAL invalid argument
2196 * @retval PMINFO_R_ERROR internal error
2197 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2198 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2200 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2203 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2204 printf("appid : %s\n", appid);
2208 static int list_apps(const char *pkgid)
2211 pkgmgrinfo_pkginfo_h handle;
2212 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2213 if (ret != PMINFO_R_OK)
2215 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2216 if (ret != PMINFO_R_OK) {
2217 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2220 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2225 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2226 pkgmgrinfo_app_list_cb app_func, void *user_data);
2227 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2228 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2231 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2232 * @brief This API gets list of installed applications from all packages with minimum informaion.
2234 * @par This API is for package-manager client application
2235 * @par Sync (or) Async : Synchronous API
2236 * @param[in] app_func iteration function for list
2237 * @param[in] user_data user data to be passed to callback function
2238 * @return 0 if success, error code(<0) if fail
2239 * @retval PMINFO_R_OK success
2240 * @retval PMINFO_R_EINVAL invalid argument
2241 * @retval PMINFO_R_ERROR internal error
2245 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2247 char *pkgid1 = NULL;
2248 char *pkgid2 = NULL;
2249 pkgid1 = (char *)user_data;
2250 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2251 if (strcmp(pkgid1, pkgid2) == 0) {
2258 static int list_apps()
2261 char *name = "helloworld";
2262 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2263 if (ret != PMINFO_R_OK) {
2270 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2271 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2274 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2275 * @brief This API gets list of installed applications from all packages.
2277 * @par This API is for package-manager client application
2278 * @par Sync (or) Async : Synchronous API
2279 * @param[in] app_func iteration function for list
2280 * @param[in] user_data user data to be passed to callback function
2281 * @return 0 if success, error code(<0) if fail
2282 * @retval PMINFO_R_OK success
2283 * @retval PMINFO_R_EINVAL invalid argument
2284 * @retval PMINFO_R_ERROR internal error
2288 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2290 char *pkgid1 = NULL;
2291 char *pkgid2 = NULL;
2292 pkgid1 = (char *)user_data;
2293 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2294 if (strcmp(pkgid1, pkgid2) == 0) {
2301 static int list_apps()
2304 char *name = "helloworld";
2305 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2306 if (ret != PMINFO_R_OK) {
2313 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2314 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2317 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2318 * @brief This API creates the disabled application information handle from db
2320 * @par This API is for package-manager client application
2321 * @par Sync (or) Async : Synchronous API
2323 * @param[in] appid pointer to appid
2324 * @param[out] handle pointer to the application info handle.
2325 * @return 0 if success, error code(<0) if fail
2326 * @retval PMINFO_R_OK success
2327 * @retval PMINFO_R_EINVAL invalid argument
2328 * @retval PMINFO_R_ERROR internal error
2330 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2331 * @see pkgmgrinfo_appinfo_get_pkgid()
2332 * @see pkgmgrinfo_appinfo_is_multiple()
2334 static int get_disabled_app_type(const char *appid)
2338 pkgmgrinfo_appinfo_h handle;
2339 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2340 if (ret != PMINFO_R_OK)
2342 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2343 if (ret != PMINFO_R_OK) {
2344 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2347 printf("apptype: %s\n", type);
2348 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2353 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2354 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2357 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2358 * @brief This API creates the application information handle from db
2360 * @par This API is for package-manager client application
2361 * @par Sync (or) Async : Synchronous API
2363 * @param[in] appid pointer to appid
2364 * @param[out] handle pointer to the application info handle.
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
2370 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2371 * @see pkgmgrinfo_appinfo_get_pkgid()
2372 * @see pkgmgrinfo_appinfo_is_multiple()
2374 static int get_app_type(const char *appid)
2378 pkgmgrinfo_appinfo_h handle;
2379 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2380 if (ret != PMINFO_R_OK)
2382 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2383 if (ret != PMINFO_R_OK) {
2384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2387 printf("apptype: %s\n", type);
2388 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2393 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2394 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2397 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2398 * @brief This API creates the application information handle from db regardless of its disable or storage status
2400 * @par This API is for package-manager client application
2401 * @par Sync (or) Async : Synchronous API
2403 * @param[in] appid pointer to appid
2404 * @param[out] handle pointer to the application info handle.
2405 * @return 0 if success, error code(<0) if fail
2406 * @retval PMINFO_R_OK success
2407 * @retval PMINFO_R_EINVAL invalid argument
2408 * @retval PMINFO_R_ERROR internal error
2410 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2411 * @see pkgmgrinfo_appinfo_get_pkgid()
2412 * @see pkgmgrinfo_appinfo_is_multiple()
2414 static int get_app_type(const char *appid)
2418 pkgmgrinfo_appinfo_h handle;
2419 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2420 if (ret != PMINFO_R_OK)
2422 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2423 if (ret != PMINFO_R_OK) {
2424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2427 printf("apptype: %s\n", type);
2428 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2433 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2434 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2437 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2438 * @brief This API gets the application ID
2440 * @par This API is for package-manager client application
2441 * @par Sync (or) Async : Synchronous API
2443 * @param[in] handle pointer to the application info handle.
2444 * @param[out] appid pointer to hold appid
2445 * @return 0 if success, error code(<0) if fail
2446 * @retval PMINFO_R_OK success
2447 * @retval PMINFO_R_EINVAL invalid argument
2448 * @retval PMINFO_R_ERROR internal error
2449 * @pre pkgmgrinfo_appinfo_get_appinfo()
2450 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2451 * @see pkgmgrinfo_appinfo_get_pkgid()
2452 * @see pkgmgrinfo_appinfo_is_multiple()
2454 static int get_app_id(const char *appid)
2457 char *app_id = NULL;
2458 pkgmgrinfo_appinfo_h handle;
2459 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2460 if (ret != PMINFO_R_OK)
2462 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2463 if (ret != PMINFO_R_OK) {
2464 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2467 printf("app id: %s\n", app_id);
2468 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2473 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2476 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2477 * @brief This API gets the package name of the application
2479 * @par This API is for package-manager client application
2480 * @par Sync (or) Async : Synchronous API
2482 * @param[in] handle pointer to the application info handle.
2483 * @param[out] pkg_name pointer to hold package name
2484 * @return 0 if success, error code(<0) if fail
2485 * @retval PMINFO_R_OK success
2486 * @retval PMINFO_R_EINVAL invalid argument
2487 * @retval PMINFO_R_ERROR internal error
2488 * @pre pkgmgrinfo_appinfo_get_appinfo()
2489 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2490 * @see pkgmgrinfo_appinfo_get_appid()
2491 * @see pkgmgrinfo_appinfo_is_multiple()
2493 static int get_app_pkgname(const char *appid)
2496 char *pkgname = NULL;
2497 pkgmgrinfo_appinfo_h handle;
2498 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2499 if (ret != PMINFO_R_OK)
2501 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2502 if (ret != PMINFO_R_OK) {
2503 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2506 printf("pkg name: %s\n", pkgname);
2507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2512 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2515 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2516 * @brief This API gets the package id of the application
2518 * @par This API is for package-manager client application
2519 * @par Sync (or) Async : Synchronous API
2521 * @param[in] handle pointer to the application info handle.
2522 * @param[out] pkgid pointer to hold package id
2523 * @return 0 if success, error code(<0) if fail
2524 * @retval PMINFO_R_OK success
2525 * @retval PMINFO_R_EINVAL invalid argument
2526 * @retval PMINFO_R_ERROR internal error
2527 * @pre pkgmgrinfo_appinfo_get_appinfo()
2528 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2529 * @see pkgmgrinfo_appinfo_get_appid()
2530 * @see pkgmgrinfo_appinfo_is_multiple()
2532 static int get_app_pkgid(const char *appid)
2536 pkgmgrinfo_appinfo_h handle;
2537 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2538 if (ret != PMINFO_R_OK)
2540 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2541 if (ret != PMINFO_R_OK) {
2542 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2545 printf("pkg id: %s\n", pkgid);
2546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2551 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2554 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2555 * @brief This API gets the package type of the application
2557 * @par This API is for package-manager client application
2558 * @par Sync (or) Async : Synchronous API
2560 * @param[in] handle pointer to the application info handle.
2561 * @param[out] pkgtype pointer to hold package type
2562 * @return 0 if success, error code(<0) if fail
2563 * @retval PMINFO_R_OK success
2564 * @retval PMINFO_R_EINVAL invalid argument
2565 * @retval PMINFO_R_ERROR internal error
2566 * @pre pkgmgrinfo_appinfo_get_appinfo()
2567 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2568 * @see pkgmgrinfo_appinfo_get_appid()
2569 * @see pkgmgrinfo_appinfo_is_multiple()
2571 static int get_app_pkgtype(const char *appid)
2574 char *pkgtype = NULL;
2575 pkgmgrinfo_appinfo_h handle = NULL;
2576 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2577 if (ret != PMINFO_R_OK)
2579 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2580 if (ret != PMINFO_R_OK) {
2581 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2584 printf("pkgtype: %s\n", pkgtype);
2585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2590 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2593 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2594 * @brief This API gets the executable name of the application
2596 * @par This API is for package-manager client application
2597 * @par Sync (or) Async : Synchronous API
2599 * @param[in] handle pointer to the application info handle.
2600 * @param[out] exec pointer to hold app exec name
2601 * @return 0 if success, error code(<0) if fail
2602 * @retval PMINFO_R_OK success
2603 * @retval PMINFO_R_EINVAL invalid argument
2604 * @retval PMINFO_R_ERROR internal error
2605 * @pre pkgmgrinfo_appinfo_get_appinfo()
2606 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2607 * @see pkgmgrinfo_appinfo_get_appid()
2608 * @see pkgmgrinfo_appinfo_is_multiple()
2610 static int get_app_exec(const char *appid)
2614 pkgmgrinfo_appinfo_h handle;
2615 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2616 if (ret != PMINFO_R_OK)
2618 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2619 if (ret != PMINFO_R_OK) {
2620 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2623 printf("exec name: %s\n", exec);
2624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2629 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2632 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2633 * @brief This API gets the icon name of the application
2635 * @par This API is for package-manager client application
2636 * @par Sync (or) Async : Synchronous API
2638 * @param[in] handle pointer to the application info handle.
2639 * @param[out] icon pointer to hold app icon name
2640 * @return 0 if success, error code(<0) if fail
2641 * @retval PMINFO_R_OK success
2642 * @retval PMINFO_R_EINVAL invalid argument
2643 * @retval PMINFO_R_ERROR internal error
2644 * @pre pkgmgrinfo_appinfo_get_appinfo()
2645 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2646 * @see pkgmgrinfo_appinfo_get_appid()
2647 * @see pkgmgrinfo_appinfo_is_multiple()
2649 static int get_app_icon(const char *appid)
2653 pkgmgrinfo_appinfo_h handle;
2654 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2655 if (ret != PMINFO_R_OK)
2657 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2658 if (ret != PMINFO_R_OK) {
2659 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2662 printf("icon name: %s\n", icon);
2663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2668 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2671 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2672 * @brief This API gets the label of the application
2674 * @par This API is for package-manager client application
2675 * @par Sync (or) Async : Synchronous API
2677 * @param[in] handle pointer to the application info handle.
2678 * @param[out] label pointer to hold app label
2679 * @return 0 if success, error code(<0) if fail
2680 * @retval PMINFO_R_OK success
2681 * @retval PMINFO_R_EINVAL invalid argument
2682 * @retval PMINFO_R_ERROR internal error
2683 * @pre pkgmgrinfo_appinfo_get_appinfo()
2684 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2685 * @see pkgmgrinfo_appinfo_get_appid()
2686 * @see pkgmgrinfo_appinfo_is_multiple()
2688 static int get_app_label(const char *appid)
2692 pkgmgrinfo_appinfo_h handle;
2693 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2694 if (ret != PMINFO_R_OK)
2696 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2697 if (ret != PMINFO_R_OK) {
2698 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2701 printf("label : %s\n", label);
2702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2707 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2710 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2711 * @brief This API gets exactly matched label by given appid and locale
2713 * @par This API is for package-manager client application
2714 * @par Sync (or) Async : Synchronous API
2716 * @param[in] appid pointer to appid
2717 * @param[in] locale pointer to locale
2718 * @param[out] label pointer to hold app label
2719 * @return 0 if success, error code(<0) if fail
2720 * @retval PMINFO_R_OK success
2721 * @retval PMINFO_R_EINVAL invalid argument
2722 * @retval PMINFO_R_ERROR internal error
2724 static int get_localed_label(const char *appid, const char *locale)
2729 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2730 if (ret != PMINFO_R_OK)
2733 printf("localed label: %s\n", label);
2741 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2742 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2745 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2746 * @brief This API gets metadata value by given metadata key
2748 * @par This API is for package-manager client application
2749 * @par Sync (or) Async : Synchronous API
2751 * @param[in] handle pointer to the application info handle
2752 * @param[in] metadata_key metadata key
2753 * @param[out] metadata_value pointer to hold metadata value
2754 * @return 0 if success, error code(<0) if fail
2755 * @retval PMINFO_R_OK success
2756 * @retval PMINFO_R_EINVAL invalid argument
2758 static int get_metadata_value(const char *appid, const char *metadata_key)
2761 pkgmgrinfo_appinfo_h handle = NULL;
2762 char *metadata_value = NULL;
2764 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2765 if (ret != PMINFO_R_OK)
2768 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2769 if (ret != PMINFO_R_OK) {
2770 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2779 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2782 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2783 * @brief This API gets the component of the application
2785 * @par This API is for package-manager client application
2786 * @par Sync (or) Async : Synchronous API
2788 * @param[in] handle pointer to the application info handle.
2789 * @param[out] component pointer to hold app component
2790 * @return 0 if success, error code(<0) if fail
2791 * @retval PMINFO_R_OK success
2792 * @retval PMINFO_R_EINVAL invalid argument
2793 * @retval PMINFO_R_ERROR internal error
2794 * @pre pkgmgrinfo_appinfo_get_appinfo()
2795 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2796 * @see pkgmgrinfo_appinfo_get_appid()
2797 * @see pkgmgrinfo_appinfo_is_multiple()
2799 static int get_app_component(const char *appid)
2802 pkgmgrinfo_app_component component;
2803 pkgmgrinfo_appinfo_h handle;
2804 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2805 if (ret != PMINFO_R_OK)
2807 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2808 if (ret != PMINFO_R_OK) {
2809 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2812 printf("component : %s\n", component);
2813 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2818 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2821 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2822 * @brief This API gets the apptype of the application
2824 * @par This API is for package-manager client application
2825 * @par Sync (or) Async : Synchronous API
2827 * @param[in] handle pointer to the application info handle.
2828 * @param[out] app_type pointer to hold apptype
2829 * @return 0 if success, error code(<0) if fail
2830 * @retval PMINFO_R_OK success
2831 * @retval PMINFO_R_EINVAL invalid argument
2832 * @retval PMINFO_R_ERROR internal error
2833 * @pre pkgmgrinfo_appinfo_get_appinfo()
2834 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2835 * @see pkgmgrinfo_appinfo_get_appid()
2836 * @see pkgmgrinfo_appinfo_is_multiple()
2838 static int get_app_type(const char *appid)
2841 char *apptype = NULL;
2842 pkgmgrinfo_appinfo_h handle;
2843 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2844 if (ret != PMINFO_R_OK)
2846 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2847 if (ret != PMINFO_R_OK) {
2848 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2851 printf("apptype : %s\n", apptype);
2852 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2857 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2860 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2861 int *operation_count, char ***operation)
2862 * @brief This API gets the list of operation of the application
2864 * @par This API is for package-manager client application
2865 * @par Sync (or) Async : Synchronous API
2867 * @param[in] handle pointer to the appcontrol handle.
2868 * @param[out] operation_count pointer to hold number of operations
2869 * @param[out] operation pointer to hold list of operations
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_uri()
2877 * @see pkgmgrinfo_appinfo_get_mime()
2879 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2884 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2885 for (i = 0; i < oc; i++) {
2886 if (strcmp(operation[i], (char *)user_data) == 0)
2893 static int check_operation(const char *appid, char *operation)
2896 pkgmgrinfo_appinfo_h handle;
2897 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2898 if (ret != PMINFO_R_OK)
2900 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2901 if (ret != PMINFO_R_OK) {
2902 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2910 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2911 int *operation_count, char ***operation);
2914 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2915 int *uri_count, char ***uri)
2916 * @brief This API gets the list of uri of the application
2918 * @par This API is for package-manager client application
2919 * @par Sync (or) Async : Synchronous API
2921 * @param[in] handle pointer to the appcontrol handle.
2922 * @param[out] uri_count pointer to hold number of uris
2923 * @param[out] uri pointer to hold list of uris
2924 * @return 0 if success, error code(<0) if fail
2925 * @retval PMINFO_R_OK success
2926 * @retval PMINFO_R_EINVAL invalid argument
2927 * @retval PMINFO_R_ERROR internal error
2928 * @pre pkgmgrinfo_appinfo_get_appinfo()
2929 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2930 * @see pkgmgrinfo_appinfo_get_operation()
2931 * @see pkgmgrinfo_appinfo_get_mime()
2933 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2938 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2939 for (i = 0; i < uc; i++) {
2940 if (strcmp(uri[i], (char *)user_data) == 0)
2947 static int check_uri(const char *appid, char *uri)
2950 pkgmgrinfo_appinfo_h handle;
2951 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2952 if (ret != PMINFO_R_OK)
2954 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2955 if (ret != PMINFO_R_OK) {
2956 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2959 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2964 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2965 int *uri_count, char ***uri);
2968 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2969 int *mime_count, char ***mime)
2970 * @brief This API gets the list of mime of the application
2972 * @par This API is for package-manager client application
2973 * @par Sync (or) Async : Synchronous API
2975 * @param[in] handle pointer to the appcontrol handle.
2976 * @param[out] mime_count pointer to hold number of mimes
2977 * @param[out] mime pointer to hold list of mimes
2978 * @return 0 if success, error code(<0) if fail
2979 * @retval PMINFO_R_OK success
2980 * @retval PMINFO_R_EINVAL invalid argument
2981 * @retval PMINFO_R_ERROR internal error
2982 * @pre pkgmgrinfo_appinfo_get_appinfo()
2983 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2984 * @see pkgmgrinfo_appinfo_get_uri()
2985 * @see pkgmgrinfo_appinfo_get_operation()
2987 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2992 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2993 for (i = 0; i < mc; i++) {
2994 if (strcmp(mime[i], (char *)user_data) == 0)
3001 static int check_mime(const char *appid, char *mime)
3004 pkgmgrinfo_appinfo_h handle;
3005 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3006 if (ret != PMINFO_R_OK)
3008 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3009 if (ret != PMINFO_R_OK) {
3010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3013 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3018 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3019 int *mime_count, char ***mime);
3022 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3023 int *subapp_count, char ***subapp)
3024 * @brief This API gets the list of subapp of the application
3026 * @par This API is for package-manager client application
3027 * @par Sync (or) Async : Synchronous API
3029 * @param[in] handle pointer to the appcontrol handle.
3030 * @param[out] subapp_count pointer to hold number of subapp
3031 * @param[out] subapp pointer to hold list of subapp
3032 * @return 0 if success, error code(<0) if fail
3033 * @retval PMINFO_R_OK success
3034 * @retval PMINFO_R_EINVAL invalid argument
3035 * @retval PMINFO_R_ERROR internal error
3036 * @pre pkgmgrinfo_appinfo_get_appinfo()
3037 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3038 * @see pkgmgrinfo_appinfo_get_uri()
3039 * @see pkgmgrinfo_appinfo_get_operation()
3041 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3045 char **subapp = NULL;
3046 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3047 for (i = 0; i < sc; i++) {
3048 if (strcmp(subapp[i], (char *)user_data) == 0)
3055 static int check_subapp(const char *appid, char *subapp)
3058 pkgmgrinfo_appinfo_h handle = NULL;
3059 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3060 if (ret != PMINFO_R_OK)
3062 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3063 if (ret != PMINFO_R_OK) {
3064 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3067 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3072 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3073 int *subapp_count, char ***subapp);
3076 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3077 * @brief This API gets the notification icon of the application
3079 * @par This API is for package-manager client application
3080 * @par Sync (or) Async : Synchronous API
3082 * @param[in] handle pointer to the application info handle.
3083 * @param[out] path pointer to hold notification icon
3084 * @return 0 if success, error code(<0) if fail
3085 * @retval PMINFO_R_OK success
3086 * @retval PMINFO_R_EINVAL invalid argument
3087 * @retval PMINFO_R_ERROR internal error
3088 * @pre pkgmgrinfo_appinfo_get_appinfo()
3089 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3090 * @see pkgmgrinfo_appinfo_get_appid()
3091 * @see pkgmgrinfo_appinfo_is_multiple()
3093 static int get_app_notification_icon(const char *appid)
3096 char *notification_icon = NULL;
3097 pkgmgrinfo_appinfo_h handle;
3098 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3099 if (ret != PMINFO_R_OK)
3101 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3102 if (ret != PMINFO_R_OK) {
3103 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3106 printf("notification icon : %s\n", notification_icon);
3107 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3112 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3115 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3116 * @brief This API gets the setting icon of the application
3118 * @par This API is for package-manager client application
3119 * @par Sync (or) Async : Synchronous API
3121 * @param[in] handle pointer to the application info handle.
3122 * @param[out] path pointer to hold setting icon
3123 * @return 0 if success, error code(<0) if fail
3124 * @retval PMINFO_R_OK success
3125 * @retval PMINFO_R_EINVAL invalid argument
3126 * @retval PMINFO_R_ERROR internal error
3127 * @pre pkgmgrinfo_appinfo_get_appinfo()
3128 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3129 * @see pkgmgrinfo_appinfo_get_appid()
3130 * @see pkgmgrinfo_appinfo_is_multiple()
3132 static int get_app_setting_icon(const char *appid)
3135 char *setting_icon = NULL;
3136 pkgmgrinfo_appinfo_h handle;
3137 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3138 if (ret != PMINFO_R_OK)
3140 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3141 if (ret != PMINFO_R_OK) {
3142 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3145 printf("setting icon : %s\n", setting_icon);
3146 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3151 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3154 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3155 * @brief This API gets the type of recent image on app-tray
3157 * @par This API is for package-manager client application
3158 * @par Sync (or) Async : Synchronous API
3160 * @param[in] handle pointer to the application info handle.
3161 * @param[out] type pointer to hold image type
3162 * @return 0 if success, error code(<0) if fail
3163 * @retval PMINFO_R_OK success
3164 * @retval PMINFO_R_EINVAL invalid argument
3165 * @retval PMINFO_R_ERROR internal error
3166 * @pre pkgmgrinfo_appinfo_get_appinfo()
3167 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3168 * @see pkgmgrinfo_appinfo_get_appid()
3169 * @see pkgmgrinfo_appinfo_is_multiple()
3171 static int get_app_recent_image_type(const char *appid)
3174 pkgmgrinfo_app_recentimage type;
3175 pkgmgrinfo_appinfo_h handle;
3176 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3177 if (ret != PMINFO_R_OK)
3179 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3180 if (ret != PMINFO_R_OK) {
3181 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3184 printf("recent image type: %d\n", type);
3185 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3190 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3194 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3195 * @brief This API gets the preview image of application
3197 * @par Sync (or) Async : Synchronous API
3199 * @param[in] handle pointer to the application info handle.
3200 * @param[out] preview_img pointer to hold preview image path
3201 * @return 0 if success, error code(<0) if fail
3202 * @retval PMINFO_R_OK success
3203 * @retval PMINFO_R_EINVAL invalid argument
3204 * @retval PMINFO_R_ERROR internal error
3205 * @pre pkgmgrinfo_appinfo_get_appinfo()
3206 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3207 * @see pkgmgrinfo_appinfo_get_appid()
3209 static int get_app_previewimage(const char *appid)
3212 char *preview = NULL;
3213 pkgmgrinfo_appinfo_h handle = NULL;
3214 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3215 if (ret != PMINFO_R_OK)
3217 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3218 if (ret != PMINFO_R_OK) {
3219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3222 printf("preview image path : %s\n", preview);
3223 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3228 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3232 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3233 * @brief This API gets the package permission type of the application
3235 * @par This API is for package-manager client application
3236 * @par Sync (or) Async : Synchronous API
3238 * @param[in] handle pointer to the application info handle.
3239 * @param[out] permission pointer to hold package permission
3240 * @return 0 if success, error code(<0) if fail
3241 * @retval PMINFO_R_OK success
3242 * @retval PMINFO_R_EINVAL invalid argument
3243 * @retval PMINFO_R_ERROR internal error
3244 * @pre pkgmgrinfo_appinfo_get_appinfo()
3245 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3246 * @see pkgmgrinfo_appinfo_get_appid()
3248 static int get_app_permission(const char *appid)
3251 pkgmgrinfo_permission_type permission = 0;
3252 pkgmgrinfo_appinfo_h handle;
3254 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3255 if (ret != PMINFO_R_OK)
3257 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3258 if (ret != PMINFO_R_OK) {
3259 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3262 printf("permission type: %d\n", permission);
3263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3268 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3271 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3272 * @brief This API gets the component_type
3274 * @par This API is for package-manager client application
3275 * @par Sync (or) Async : Synchronous API
3277 * @param[in] handle pointer to the application info handle.
3278 * @param[out] component_type pointer to hold component_type
3279 * @return 0 if success, error code(<0) if fail
3280 * @retval PMINFO_R_OK success
3281 * @retval PMINFO_R_EINVAL invalid argument
3282 * @retval PMINFO_R_ERROR internal error
3283 * @pre pkgmgrinfo_appinfo_get_appinfo()
3284 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3285 * @see pkgmgrinfo_appinfo_get_pkgid()
3286 * @see pkgmgrinfo_appinfo_is_multiple()
3288 static int get_component_type(const char *appid)
3291 char *component_type = NULL;
3292 pkgmgrinfo_appinfo_h handle;
3293 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3294 if (ret != PMINFO_R_OK)
3296 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3297 if (ret != PMINFO_R_OK) {
3298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3301 printf("component_type: %s\n", component_type);
3302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3307 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3310 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3311 * @brief This API gets the application 'hwacceleration' value from the app ID
3313 * @par This API is for package-manager client application
3314 * @par Sync (or) Async : Synchronous API
3316 * @param[in] handle pointer to application info handle
3317 * @param[out] hwacceleration pointer to hold package hwacceleration value
3318 * @return 0 if success, error code(<0) if fail
3319 * @retval PMINFO_R_OK success
3320 * @retval PMINFO_R_EINVAL invalid argument
3321 * @retval PMINFO_R_ERROR internal error
3322 * @pre pkgmgrinfo_appinfo_get_appinfo()
3323 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3324 * @see pkgmgrinfo_appinfo_get_appid()
3325 * @see pkgmgrinfo_appinfo_is_multiple()
3327 static int get_app_hwacceleration(const char *appid)
3330 pkgmgrinfo_app_hwacceleration hwacceleration;
3331 pkgmgrinfo_appinfo_h handle;
3332 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3333 if (ret != PMINFO_R_OK)
3335 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3336 if (ret != PMINFO_R_OK) {
3337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3340 printf("app hwacceleration: %d\n", hwacceleration);
3341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3346 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3349 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3350 * @brief This API gets the application 'screenreader' value from the app ID
3352 * @par This API is for package-manager client application
3353 * @par Sync (or) Async : Synchronous API
3355 * @param[in] handle pointer to application info handle
3356 * @param[out] screenreader pointer to hold package accessibility value
3357 * @return 0 if success, error code(<0) if fail
3358 * @retval PMINFO_R_OK success
3359 * @retval PMINFO_R_EINVAL invalid argument
3360 * @retval PMINFO_R_ERROR internal error
3361 * @pre pkgmgrinfo_appinfo_get_appinfo()
3362 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3363 * @see pkgmgrinfo_appinfo_get_appid()
3364 * @see pkgmgrinfo_appinfo_is_multiple()
3366 static int get_app_screenreader(const char *appid)
3369 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3370 pkgmgrinfo_appinfo_h handle = NULL;
3371 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3372 if (ret != PMINFO_R_OK)
3374 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3375 if (ret != PMINFO_R_OK) {
3376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3379 printf("app screenreader: %d\n", screenreader);
3380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3385 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3388 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3389 * @brief This API gets the application's landscape & portrait effect images
3391 * @par This API is for package-manager client application
3392 * @par Sync (or) Async : Synchronous API
3394 * @param[in] handle pointer to application info handle
3395 * @param[out] portrait_img contains portrait mode effect image
3396 * @param[out] landscape_img contains landscape mode effect image
3397 * @return 0 if success, error code(<0) if fail
3398 * @retval PMINFO_R_OK success
3399 * @retval PMINFO_R_EINVAL invalid argument
3400 * @retval PMINFO_R_ERROR internal error
3401 * @pre pkgmgrinfo_appinfo_get_appinfo()
3402 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3403 * @see pkgmgrinfo_appinfo_get_appid()
3404 * @see pkgmgrinfo_appinfo_is_nodisplay()
3406 static int get_app_effectimages(const char *appid)
3409 char *portraitimg = NULL;
3410 char *landscapeimg = NULL;
3411 pkgmgrinfo_appinfo_h handle;
3412 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3413 if (ret != PMINFO_R_OK)
3415 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3416 if (ret != PMINFO_R_OK) {
3417 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3420 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3421 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3426 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3429 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3430 * @brief This API gets the application's effect image type
3432 * @par This API is for package-manager client application
3433 * @par Sync (or) Async : Synchronous API
3435 * @param[in] handle pointer to application info handle
3436 * @param[out] effectimg_type contains effect image type
3437 * @return 0 if success, error code(<0) if fail
3438 * @retval PMINFO_R_OK success
3439 * @retval PMINFO_R_EINVAL invalid argument
3440 * @retval PMINFO_R_ERROR internal error
3441 * @pre pkgmgrinfo_appinfo_get_appinfo()
3442 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3443 * @see pkgmgrinfo_appinfo_get_appid()
3444 * @see pkgmgrinfo_appinfo_is_nodisplay()
3446 static int get_app_effectimage_type(const char *appid)
3449 char *effectimg_type = NULL;
3450 pkgmgrinfo_appinfo_h handle = NULL;
3451 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3452 if (ret != PMINFO_R_OK)
3454 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3455 if (ret != PMINFO_R_OK) {
3456 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3459 printf("app effect image type: %s\n", effectimg_type);
3460 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3465 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3468 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3469 * @brief This API gets the submode_mainid of the application
3471 * @par This API is for package-manager client application
3472 * @par Sync (or) Async : Synchronous API
3474 * @param[in] handle pointer to the application info handle.
3475 * @param[out] submode_mainid pointer to hold package name
3476 * @return 0 if success, error code(<0) if fail
3477 * @retval PMINFO_R_OK success
3478 * @retval PMINFO_R_EINVAL invalid argument
3479 * @retval PMINFO_R_ERROR internal error
3480 * @pre pkgmgrinfo_appinfo_get_appinfo()
3481 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3482 * @see pkgmgrinfo_appinfo_get_appid()
3483 * @see pkgmgrinfo_appinfo_is_multiple()
3485 static int get_app_submode_mainid(const char *appid)
3488 char *submode_mainid = NULL;
3489 pkgmgrinfo_appinfo_h handle = NULL;
3490 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3491 if (ret != PMINFO_R_OK)
3493 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3494 if (ret != PMINFO_R_OK) {
3495 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3498 printf("submode_mainid: %s\n", submode_mainid);
3499 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3504 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3507 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3508 * @brief This API gets the datacontrol info
3510 * @par This API is for package-manager client application
3511 * @par Sync (or) Async : Synchronous API
3513 * @param[in] providerid pointer to the providerid of dataconltrol.
3514 * @param[in] type pointer to the type of dataconltrol.
3515 * @param[out] appid pointer to hold appid, need to free after using
3516 * @param[out] access pointer to hold access, need to free after using
3517 * @return 0 if success, error code(<0) if fail
3518 * @retval PMINFO_R_OK success
3519 * @retval PMINFO_R_EINVAL invalid argument
3520 * @retval PMINFO_R_ERROR internal error
3523 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3524 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3527 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3528 * @brief This API gets the appid of datacontrol
3530 * @par This API is for package-manager client application
3531 * @par Sync (or) Async : Synchronous API
3533 * @param[in] providerid pointer to the providerid of dataconltrol.
3534 * @param[out] appid pointer to hold appid, need to free after using
3535 * @return 0 if success, error code(<0) if fail
3536 * @retval PMINFO_R_OK success
3537 * @retval PMINFO_R_EINVAL invalid argument
3538 * @retval PMINFO_R_ERROR internal error
3541 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3542 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3545 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3546 * @brief This API gets the alias_appid of the application
3548 * @par This API is for package-manager client application
3549 * @par Sync (or) Async : Synchronous API
3551 * @param[in] handle pointer to the application info handle.
3552 * @param[out] alias_appid pointer to hold app alias_appid
3553 * @return 0 if success, error code(<0) if fail
3554 * @retval PMINFO_R_OK success
3555 * @retval PMINFO_R_EINVAL invalid argument
3556 * @retval PMINFO_R_ERROR internal error
3557 * @pre pkgmgrinfo_appinfo_get_appinfo()
3558 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3559 * @see pkgmgrinfo_appinfo_get_appid()
3561 static int get_alias_appid(const char *appid)
3564 char *alias_appid= 0;
3565 pkgmgrinfo_appinfo_h handle = NULL;
3566 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3567 if (ret != PMINFO_R_OK)
3569 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3570 if (ret != PMINFO_R_OK) {
3571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3574 printf("alias_appid: %s\n", alias_appid);
3575 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3580 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3583 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3584 * @brief This API gets the effective_appid of the application
3586 * @par This API is for package-manager client application
3587 * @par Sync (or) Async : Synchronous API
3589 * @param[in] handle pointer to the application info handle.
3590 * @param[out] effective_appid pointer to hold app effective_appid
3591 * @return 0 if success, error code(<0) if fail
3592 * @retval PMINFO_R_OK success
3593 * @retval PMINFO_R_EINVAL invalid argument
3594 * @retval PMINFO_R_ERROR internal error
3595 * @pre pkgmgrinfo_appinfo_get_appinfo()
3596 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3597 * @see pkgmgrinfo_appinfo_get_appid()
3599 static int get_effective_appid(const char *appid)
3602 char *effective_appid= 0;
3603 pkgmgrinfo_appinfo_h handle = NULL;
3604 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3605 if (ret != PMINFO_R_OK)
3607 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3608 if (ret != PMINFO_R_OK) {
3609 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3612 printf("effective_appid: %s\n", effective_appid);
3613 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3618 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3621 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3622 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3624 * @par This API is for package-manager client application
3625 * @par Sync (or) Async : Synchronous API
3627 * @param[in] handle pointer to the appinfo handle.
3628 * @param[out] tep_name pointer to hold tep name
3629 * @return 0 if success, error code(<0) if fail
3630 * @retval PMINFO_R_OK success
3631 * @retval PMINFO_R_EINVAL invalid argument
3632 * @retval PMINFO_R_ERROR internal error
3633 * @pre pkgmgrinfo_appinfo_get_appinfo()
3634 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3635 * @see pkgmgrinfo_appinfo_get_appid()
3637 static int get_tep_name(const char *appid)
3640 char *tep_name = NULL;
3641 pkgmgrinfo_appinfo_h handle = NULL;
3642 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3643 if (ret != PMINFO_R_OK)
3645 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3646 if (ret != PMINFO_R_OK) {
3647 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3650 printf("TEP name is: %s\n", tep_name);
3651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3656 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3659 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3660 * @brief This API gets zip mount file name associated with the package which contain given application
3661 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3663 * @par This API is for package-manager client application
3664 * @par Sync (or) Async : Synchronous API
3666 * @param[in] handle pointer to the appinfo handle.
3667 * @param[out] zip_mount_file pointer to hold zip mount file name
3668 * @return 0 if success, error code(<0) if fail
3669 * @retval PMINFO_R_OK success
3670 * @retval PMINFO_R_EINVAL invalid argument
3671 * @retval PMINFO_R_ERROR internal error
3672 * @pre pkgmgrinfo_appinfo_get_appinfo()
3673 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3674 * @see pkgmgrinfo_appinfo_get_appid()
3676 static int get_zip_mount_file(const char *appid)
3679 char *zip_mount_file = NULL;
3680 pkgmgrinfo_appinfo_h handle = NULL;
3681 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3682 if (ret != PMINFO_R_OK)
3684 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3685 if (ret != PMINFO_R_OK) {
3686 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3689 printf("Mount file name is: %s\n", zip_mount_file);
3690 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3695 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3698 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3699 * @brief This API gets the root path of application
3701 * @par Sync (or) Async : Synchronous API
3703 * @param[in] handle pointer to appinfo handle
3704 * @param[out] path pointer to hold root path of application
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
3710 static int get_root_path(const char *appid)
3714 pkgmgrinfo_appinfo_h handle;
3715 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3716 if (ret != PMINFO_R_OK)
3719 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3720 if (ret != PMINFO_R_OK) {
3721 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3724 printf("path : %s\n", path);
3725 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3731 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3734 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3735 * @brief This API gets the application api_version from the application ID
3737 * @par This API is for package-manager client application
3738 * @par Sync (or) Async : Synchronous API
3740 * @param[in] handle pointer to appinfo handle
3741 * @param[out] api_version pointer to hold application api_version
3742 * @return 0 if success, error code(<0) if fail
3743 * @retval PMINFO_R_OK success
3744 * @retval PMINFO_R_EINVAL invalid argument
3745 * @retval PMINFO_R_ERROR internal error
3746 * @pre pkgmgrinfo_appinfo_get_appinfo()
3747 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3748 * @see pkgmgrinfo_appinfo_get_appid()
3750 static int get_app_api_version(const char *appid)
3753 char *api_version = NULL;
3754 pkgmgrinfo_appinfo_h handle = NULL;
3755 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3756 if (ret != PMINFO_R_OK)
3758 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3759 if (ret != PMINFO_R_OK) {
3760 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3763 printf("app api_version: %s\n", api_version);
3764 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3769 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3772 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3773 * @brief This API gets the installed_time of the application
3775 * @par This API is for package-manager client application
3776 * @par Sync (or) Async : Synchronous API
3778 * @param[in] handle pointer to the application info handle.
3779 * @param[out] installed_time pointer to hold installed_time
3780 * @return 0 if success, error code(<0) if fail
3781 * @retval PMINFO_R_OK success
3782 * @retval PMINFO_R_EINVAL invalid argument
3783 * @retval PMINFO_R_ERROR internal error
3784 * @pre pkgmgrinfo_appinfo_get_appinfo()
3785 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3786 * @see pkgmgrinfo_appinfo_get_appid()
3787 * @see pkgmgrinfo_appinfo_is_multiple()
3789 static int get_app_installed_time(const char *appid)
3792 int installed_time = 0;
3793 pkgmgrinfo_appinfo_h handle = NULL;
3794 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3795 if (ret != PMINFO_R_OK)
3797 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
3798 if (ret != PMINFO_R_OK) {
3799 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3802 printf("installed_time: %d\n", installed_time);
3803 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3808 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
3811 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
3812 * @brief This API gets the support_mode of the application
3814 * @par This API is for package-manager client application
3815 * @par Sync (or) Async : Synchronous API
3817 * @param[in] handle pointer to the application info handle.
3818 * @param[out] support_mode pointer to hold app support_mode
3819 * @return 0 if success, error code(<0) if fail
3820 * @retval PMINFO_R_OK success
3821 * @retval PMINFO_R_EINVAL invalid argument
3822 * @retval PMINFO_R_ERROR internal error
3823 * @pre pkgmgrinfo_appinfo_get_appinfo()
3824 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3825 * @see pkgmgrinfo_appinfo_get_appid()
3827 static int get_app_support_mode(const char *appid)
3830 int support_mode = 0;
3831 pkgmgrinfo_appinfo_h handle = NULL;
3832 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3833 if (ret != PMINFO_R_OK)
3835 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
3836 if (ret != PMINFO_R_OK) {
3837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3840 printf("support_mode: %s\n", support_mode);
3841 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3846 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
3849 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3850 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3851 * @brief This API gets the list of permission for a particular application
3853 * @par This API is for package-manager client application
3854 * @par Sync (or) Async : Synchronous API
3855 * @param[in] handle pointer to the application info handle.
3856 * @param[in] permission_func callback function for list
3857 * @param[in] user_data user data to be passed to callback function
3858 * @return 0 if success, error code(<0) if fail
3859 * @retval PMINFO_R_OK success
3860 * @retval PMINFO_R_EINVAL invalid argument
3861 * @retval PMINFO_R_ERROR internal error
3862 * @pre pkgmgrinfo_appinfo_get_appinfo()
3863 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3865 int permission_func(const char *name, void *user_data)
3867 if (strcmp(name, (char *)user_data) == 0)
3873 static int list_permission(const char *appid, char *permission)
3876 pkgmgrinfo_appinfo_h handle;
3877 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3878 if (ret != PMINFO_R_OK)
3880 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3881 if (ret != PMINFO_R_OK) {
3882 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3885 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3890 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3891 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3894 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3895 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3896 * @brief This API gets the list of category for a particular application
3898 * @par This API is for package-manager client application
3899 * @par Sync (or) Async : Synchronous API
3900 * @param[in] handle pointer to the application info handle.
3901 * @param[in] category_func callback function for list
3902 * @param[in] user_data user data to be passed to callback function
3903 * @return 0 if success, error code(<0) if fail
3904 * @retval PMINFO_R_OK success
3905 * @retval PMINFO_R_EINVAL invalid argument
3906 * @retval PMINFO_R_ERROR internal error
3907 * @pre pkgmgrinfo_appinfo_get_appinfo()
3908 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3910 int category_func(const char *name, void *user_data)
3912 if (strcmp(name, (char *)user_data) == 0)
3918 static int list_category(const char *appid, char *category)
3921 pkgmgrinfo_appinfo_h handle;
3922 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3923 if (ret != PMINFO_R_OK)
3925 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3926 if (ret != PMINFO_R_OK) {
3927 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3930 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3935 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3936 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3939 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3940 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3941 * @brief This API gets the list of metadata for a particular application
3943 * @par This API is for package-manager client application
3944 * @par Sync (or) Async : Synchronous API
3945 * @param[in] handle pointer to the application info handle.
3946 * @param[in] metadata_func callback function for list
3947 * @param[in] user_data user data to be passed to callback function
3948 * @return 0 if success, error code(<0) if fail
3949 * @retval PMINFO_R_OK success
3950 * @retval PMINFO_R_EINVAL invalid argument
3951 * @retval PMINFO_R_ERROR internal error
3952 * @pre pkgmgrinfo_appinfo_get_appinfo()
3953 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3955 int metadata_func(const char *key, const char *value, void *user_data)
3957 if (strcmp(key, (char *)user_data) == 0) {
3958 printf("Value is %s\n", value);
3965 static int list_metadata(const char *appid, char *key)
3968 pkgmgrinfo_appinfo_h handle;
3969 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3970 if (ret != PMINFO_R_OK)
3972 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3973 if (ret != PMINFO_R_OK) {
3974 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3977 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3982 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3983 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3987 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3988 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3989 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3990 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3991 * @brief This API gets the list of app-control for a particular application
3993 * @par This API is for package-manager client application
3994 * @par Sync (or) Async : Synchronous API
3995 * @param[in] handle pointer to the application info handle.
3996 * @param[in] appcontrol_func callback function for list
3997 * @param[in] user_data user data to be passed to callback function
3998 * @param[in] uid the addressee user id of the instruction
3999 * @return 0 if success, error code(<0) if fail
4000 * @retval PMINFO_R_OK success
4001 * @retval PMINFO_R_EINVAL invalid argument
4002 * @retval PMINFO_R_ERROR internal error
4003 * @pre pkgmgrinfo_appinfo_get_appinfo()
4004 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4006 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4011 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4012 for (i = 0; i < oc; i++) {
4013 if (strcmp(operation[i], (char *)user_data) == 0)
4020 static int check_operation(const char *appid, char *operation)
4023 pkgmgrinfo_appinfo_h handle;
4024 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4025 if (ret != PMINFO_R_OK)
4027 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4028 if (ret != PMINFO_R_OK) {
4029 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4037 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4038 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4043 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4044 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4047 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4048 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4049 * @brief This API gets the list of splashscreen for a particular application
4051 * @par This API is for package-manager client application
4052 * @par Sync (or) Async : Synchronous API
4053 * @param[in] handle pointer to the application info handle.
4054 * @param[in] splash_screen_func callback function for list
4055 * @param[in] user_data user data to be passed to callback function
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
4060 * @pre pkgmgrinfo_appinfo_get_appinfo()
4061 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4064 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4065 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4068 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4069 * @brief This API gets the application 'nodisplay' value from the app ID
4071 * @par This API is for package-manager client application
4072 * @par Sync (or) Async : Synchronous API
4074 * @param[in] handle pointer to application info handle
4075 * @param[out] nodisplay pointer to hold package nodisplay value
4076 * @return 0 if success, error code(<0) if fail
4077 * @retval PMINFO_R_OK success
4078 * @retval PMINFO_R_EINVAL invalid argument
4079 * @retval PMINFO_R_ERROR internal error
4080 * @pre pkgmgrinfo_appinfo_get_appinfo()
4081 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4082 * @see pkgmgrinfo_appinfo_get_appid()
4083 * @see pkgmgrinfo_appinfo_is_multiple()
4085 static int get_app_nodisplay(const char *appid)
4089 pkgmgrinfo_appinfo_h handle;
4090 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4091 if (ret != PMINFO_R_OK)
4093 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4094 if (ret != PMINFO_R_OK) {
4095 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4098 printf("app nodisplay: %d\n", nodisplay);
4099 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4104 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4107 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4108 * @brief This API gets the application 'multiple' value from the app ID
4110 * @par This API is for package-manager client application
4111 * @par Sync (or) Async : Synchronous API
4113 * @param[in] handle pointer to application info handle
4114 * @param[out] multiple pointer to hold package multiple value
4115 * @return 0 if success, error code(<0) if fail
4116 * @retval PMINFO_R_OK success
4117 * @retval PMINFO_R_EINVAL invalid argument
4118 * @retval PMINFO_R_ERROR internal error
4119 * @pre pkgmgrinfo_appinfo_get_appinfo()
4120 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4121 * @see pkgmgrinfo_appinfo_get_appid()
4122 * @see pkgmgrinfo_appinfo_is_nodisplay()
4124 static int get_app_multiple(const char *appid)
4128 pkgmgrinfo_appinfo_h handle;
4129 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4130 if (ret != PMINFO_R_OK)
4132 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4133 if (ret != PMINFO_R_OK) {
4134 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4137 printf("app multiple: %d\n", multiple);
4138 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4143 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4146 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4147 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4148 * application launching effect. If fales, indicator will be hidden during application launching effect
4150 * @par This API is for package-manager client application
4151 * @par Sync (or) Async : Synchronous API
4153 * @param[in] handle pointer to application info handle
4154 * @param[out] indicator_disp contains indicator display status for application launching effect
4155 * @return 0 if success, error code(<0) if fail
4156 * @retval PMINFO_R_OK success
4157 * @retval PMINFO_R_EINVAL invalid argument
4158 * @retval PMINFO_R_ERROR internal error
4159 * @pre pkgmgrinfo_appinfo_get_appinfo()
4160 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4161 * @see pkgmgrinfo_appinfo_get_appid()
4162 * @see pkgmgrinfo_appinfo_is_nodisplay()
4164 static int get_app_indicator_display(const char *appid)
4167 bool indicator_disp;
4168 pkgmgrinfo_appinfo_h handle;
4169 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4170 if (ret != PMINFO_R_OK)
4172 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4173 if (ret != PMINFO_R_OK){
4174 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4177 printf("app indicator disp : %d\n", indicator_disp);
4178 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4183 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4186 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4187 * @brief This API gets the application 'taskmanage' value from the app ID
4189 * @par This API is for package-manager client application
4190 * @par Sync (or) Async : Synchronous API
4192 * @param[in] handle pointer to application info handle
4193 * @param[out] taskmanage pointer to hold package taskmanage value
4194 * @return 0 if success, error code(<0) if fail
4195 * @retval PMINFO_R_OK success
4196 * @retval PMINFO_R_EINVAL invalid argument
4197 * @retval PMINFO_R_ERROR internal error
4198 * @pre pkgmgrinfo_appinfo_get_appinfo()
4199 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4200 * @see pkgmgrinfo_appinfo_get_appid()
4201 * @see pkgmgrinfo_appinfo_is_multiple()
4203 static int get_app_taskmanage(const char *appid)
4207 pkgmgrinfo_appinfo_h handle;
4208 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4209 if (ret != PMINFO_R_OK)
4211 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4212 if (ret != PMINFO_R_OK) {
4213 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4216 printf("app taskmanage: %d\n", taskmanage);
4217 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4222 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4225 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4226 * @brief This API gets the application 'taskmanage' value from the app ID
4228 * @par This API is for package-manager client application
4229 * @par Sync (or) Async : Synchronous API
4231 * @param[in] handle pointer to application info handle
4232 * @param[out] enabled pointer to hold package enabled value
4233 * @return 0 if success, error code(<0) if fail
4234 * @retval PMINFO_R_OK success
4235 * @retval PMINFO_R_EINVAL invalid argument
4236 * @retval PMINFO_R_ERROR internal error
4237 * @pre pkgmgrinfo_appinfo_get_appinfo()
4238 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4239 * @see pkgmgrinfo_appinfo_get_appid()
4240 * @see pkgmgrinfo_appinfo_is_multiple()
4242 static int get_app_enabled(const char *appid)
4246 pkgmgrinfo_appinfo_h handle;
4247 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4248 if (ret != PMINFO_R_OK)
4250 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4251 if (ret != PMINFO_R_OK) {
4252 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4255 printf("app enabled: %d\n", enabled);
4256 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4261 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4264 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4265 * @brief This API gets the application 'onboot' value from the app ID
4267 * @par This API is for package-manager client application
4268 * @par Sync (or) Async : Synchronous API
4270 * @param[in] handle pointer to application info handle
4271 * @param[out] onboot pointer to hold package onboot value
4272 * @return 0 if success, error code(<0) if fail
4273 * @retval PMINFO_R_OK success
4274 * @retval PMINFO_R_EINVAL invalid argument
4275 * @retval PMINFO_R_ERROR internal error
4276 * @pre pkgmgrinfo_appinfo_get_appinfo()
4277 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4278 * @see pkgmgrinfo_appinfo_get_appid()
4279 * @see pkgmgrinfo_appinfo_is_multiple()
4281 static int get_app_onboot(const char *appid)
4285 pkgmgrinfo_appinfo_h handle;
4286 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4287 if (ret != PMINFO_R_OK)
4289 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4290 if (ret != PMINFO_R_OK) {
4291 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4294 printf("app onboot: %d\n", onboot);
4295 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4300 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4303 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4304 * @brief This API gets the application 'autorestart' value from the app ID
4306 * @par This API is for package-manager client application
4307 * @par Sync (or) Async : Synchronous API
4309 * @param[in] handle pointer to application info handle
4310 * @param[out] autorestart pointer to hold package autorestart value
4311 * @return 0 if success, error code(<0) if fail
4312 * @retval PMINFO_R_OK success
4313 * @retval PMINFO_R_EINVAL invalid argument
4314 * @retval PMINFO_R_ERROR internal error
4315 * @pre pkgmgrinfo_appinfo_get_appinfo()
4316 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4317 * @see pkgmgrinfo_appinfo_get_appid()
4318 * @see pkgmgrinfo_appinfo_is_multiple()
4320 static int get_app_autorestart(const char *appid)
4324 pkgmgrinfo_appinfo_h handle;
4325 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4326 if (ret != PMINFO_R_OK)
4328 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4329 if (ret != PMINFO_R_OK) {
4330 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4333 printf("app autorestart: %d\n", autorestart);
4334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4339 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4342 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4343 * @brief This API gets the value for given application is main app or not from handle
4345 * @par This API is for package-manager client application
4346 * @par Sync (or) Async : Synchronous API
4348 * @param[in] handle pointer to application info handle
4349 * @param[out] mainapp pointer to hold package mainapp is or not
4350 * @return 0 if success, error code(<0) if fail
4351 * @retval PMINFO_R_OK success
4352 * @retval PMINFO_R_EINVAL invalid argument
4353 * @retval PMINFO_R_ERROR internal error
4354 * @pre pkgmgrinfo_appinfo_get_appinfo()
4355 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4356 * @see pkgmgrinfo_appinfo_get_appid()
4357 * @see pkgmgrinfo_appinfo_is_multiple()
4359 static int get_app_mainapp(const char *appid)
4363 pkgmgrinfo_appinfo_h handle;
4364 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4365 if (ret != PMINFO_R_OK)
4367 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4368 if (ret != PMINFO_R_OK) {
4369 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4372 printf("mainapp: %d\n", mainapp);
4373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4378 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4382 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4383 * @brief This API gets the value for given application is preload or not from handle
4385 * @par This API is for package-manager client application
4386 * @par Sync (or) Async : Synchronous API
4388 * @param[in] handle pointer to application info handle
4389 * @param[out] preload pointer to hold preload is or not
4390 * @return 0 if success, error code(<0) if fail
4391 * @retval PMINFO_R_OK success
4392 * @retval PMINFO_R_EINVAL invalid argument
4393 * @retval PMINFO_R_ERROR internal error
4394 * @pre pkgmgrinfo_appinfo_get_appinfo()
4395 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4396 * @see pkgmgrinfo_appinfo_get_appid()
4397 * @see pkgmgrinfo_appinfo_is_multiple()
4399 static int get_app_preload(const char *appid)
4403 pkgmgrinfo_appinfo_h handle = NULL;
4404 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4405 if (ret != PMINFO_R_OK)
4407 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4408 if (ret != PMINFO_R_OK) {
4409 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4412 printf("preload: %d\n", preload);
4413 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4418 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4421 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4422 * @brief This API gets the value for given application is submode or not from handle
4424 * @par This API is for package-manager client application
4425 * @par Sync (or) Async : Synchronous API
4427 * @param[in] handle pointer to application info handle
4428 * @param[out] submode pointer to hold submode is or not
4429 * @return 0 if success, error code(<0) if fail
4430 * @retval PMINFO_R_OK success
4431 * @retval PMINFO_R_EINVAL invalid argument
4432 * @retval PMINFO_R_ERROR internal error
4433 * @pre pkgmgrinfo_appinfo_get_appinfo()
4434 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4435 * @see pkgmgrinfo_appinfo_get_appid()
4436 * @see pkgmgrinfo_appinfo_is_multiple()
4438 static int get_app_submode(const char *appid)
4442 pkgmgrinfo_appinfo_h handle = NULL;
4443 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4444 if (ret != PMINFO_R_OK)
4446 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4447 if (ret != PMINFO_R_OK) {
4448 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4451 printf("submode: %d\n", submode);
4452 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4457 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4460 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4461 * @brief This API gets the value for given application is process_pool or not from handle
4463 * @par This API is for package-manager client application
4464 * @par Sync (or) Async : Synchronous API
4466 * @param[in] handle pointer to application info handle
4467 * @param[out] process_pool pointer to hold process_pool is or not
4468 * @return 0 if success, error code(<0) if fail
4469 * @retval PMINFO_R_OK success
4470 * @retval PMINFO_R_EINVAL invalid argument
4471 * @retval PMINFO_R_ERROR internal error
4472 * @pre pkgmgrinfo_appinfo_get_appinfo()
4473 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4474 * @see pkgmgrinfo_appinfo_get_appid()
4476 static int get_app_process_pool(const char *appid)
4479 bool process_pool = 0;
4480 pkgmgrinfo_appinfo_h handle = NULL;
4481 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4482 if (ret != PMINFO_R_OK)
4484 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4485 if (ret != PMINFO_R_OK) {
4486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4489 printf("process_pool: %d\n", process_pool);
4490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4495 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4498 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4499 * @brief This API gets the installed storage location of the application
4501 * @par This API is for package-manager client application
4502 * @par Sync (or) Async : Synchronous API
4504 * @param[in] handle pointer to the application info handle.
4505 * @param[out] app_type pointer to hold installed storage location
4506 * @return 0 if success, error code(<0) if fail
4507 * @retval PMINFO_R_OK success
4508 * @retval PMINFO_R_EINVAL invalid argument
4509 * @retval PMINFO_R_ERROR internal error
4510 * @pre pkgmgrinfo_appinfo_get_appinfo()
4511 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4512 * @see pkgmgrinfo_appinfo_get_appid()
4514 static int get_app_installed_location(const char *appid)
4517 pkgmgrinfo_installed_storage storage;
4518 pkgmgrinfo_appinfo_h handle = NULL;
4519 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4520 if (ret != PMINFO_R_OK)
4522 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4523 if (ret != PMINFO_R_OK) {
4524 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4527 printf("Installed storage location : %d\n", storage);
4528 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4533 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4537 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4538 * @brief This API checks if the application has the given category
4540 * @par This API is for package-manager client application
4541 * @par Sync (or) Async : Synchronous API
4543 * @param[in] handle pointer to the application info handle
4544 * @param[in] category category
4545 * @param[out] exist value Gets whether the application has the given category
4546 * @return 0 if success, error code(<0) if fail
4547 * @retval PMINFO_R_OK success
4548 * @retval PMINFO_R_EINVAL invalid argument
4549 * @retval PMINFO_R_ERROR internal error
4551 static int is_category_exist(const char *appid, const char *category)
4554 pkgmgrinfo_appinfo_h handle;
4557 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4558 if (ret != PMINFO_R_OK)
4561 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4562 if (ret != PMINFO_R_OK) {
4563 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4567 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4572 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4575 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4576 * @brief This API gets the application 'ui_gadget' value from the app ID
4578 * @par This API is for package-manager client application
4579 * @par Sync (or) Async : Synchronous API
4581 * @param[in] handle pointer to application info handle
4582 * @param[out] ui_gadget pointer to hold package ui_gadget value
4583 * @return 0 if success, error code(<0) if fail
4584 * @retval PMINFO_R_OK success
4585 * @retval PMINFO_R_EINVAL invalid argument
4586 * @pre pkgmgrinfo_appinfo_get_appinfo()
4587 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4589 static int get_app_ui_gadget(const char *appid)
4593 pkgmgrinfo_appinfo_h handle = NULL;
4594 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4595 if (ret != PMINFO_R_OK)
4597 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4598 if (ret != PMINFO_R_OK) {
4599 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4602 printf("app ui_gadget: %d\n", ui_gadget);
4603 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4608 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4611 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4612 * @brief This API gets the application 'support_disable' value from the app ID
4614 * @par This API is for package-manager client application
4615 * @par Sync (or) Async : Synchronous API
4617 * @param[in] handle pointer to application info handle
4618 * @param[out] support_disable pointer to hold package support_disable value
4619 * @return 0 if success, error code(<0) if fail
4620 * @retval PMINFO_R_OK success
4621 * @retval PMINFO_R_EINVAL invalid argument
4622 * @pre pkgmgrinfo_appinfo_get_appinfo()
4623 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4625 static int get_app_support_disable(const char *appid)
4628 bool support_disable;
4629 pkgmgrinfo_appinfo_h handle = NULL;
4630 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4631 if (ret != PMINFO_R_OK)
4633 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4634 if (ret != PMINFO_R_OK) {
4635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4638 printf("app support_disable: %d\n", support_disable);
4639 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4644 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4647 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4648 * @brief This API gets the application 'removable' value from the app ID
4650 * @par This API is for package-manager client application
4651 * @par Sync (or) Async : Synchronous API
4653 * @param[in] handle pointer to application info handle
4654 * @param[out] removable pointer to hold package removable value
4655 * @return 0 if success, error code(<0) if fail
4656 * @retval PMINFO_R_OK success
4657 * @retval PMINFO_R_EINVAL invalid argument
4658 * @retval PMINFO_R_ERROR internal error
4659 * @pre pkgmgrinfo_appinfo_get_appinfo()
4660 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4661 * @see pkgmgrinfo_appinfo_get_appid()
4663 static int get_app_removable(const char *appid)
4667 pkgmgrinfo_appinfo_h handle = NULL;
4668 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4669 if (ret != PMINFO_R_OK)
4671 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4672 if (ret != PMINFO_R_OK) {
4673 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4676 printf("app removable: %d\n", removable);
4677 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4682 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4685 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4686 * @brief This API gets the application 'system' value from the app ID
4688 * @par This API is for package-manager client application
4689 * @par Sync (or) Async : Synchronous API
4691 * @param[in] handle pointer to application info handle
4692 * @param[out] system pointer to hold package system value
4693 * @return 0 if success, error code(<0) if fail
4694 * @retval PMINFO_R_OK success
4695 * @retval PMINFO_R_EINVAL invalid argument
4696 * @retval PMINFO_R_ERROR internal error
4697 * @pre pkgmgrinfo_appinfo_get_appinfo()
4698 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4699 * @see pkgmgrinfo_appinfo_get_appid()
4701 static int get_app_system(const char *appid)
4704 bool system = false;
4705 pkgmgrinfo_appinfo_h handle = NULL;
4706 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4707 if (ret != PMINFO_R_OK)
4709 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4710 if (ret != PMINFO_R_OK) {
4711 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4714 printf("app system: %d\n", system);
4715 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4720 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4724 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4725 * @brief This API gets the application 'is_disable' value from the app ID
4727 * @par This API is for package-manager client application
4728 * @par Sync (or) Async : Synchronous API
4730 * @param[in] handle pointer to application info handle
4731 * @param[out] disabled pointer to hold application is_disabled value
4732 * @return 0 if success, error code(<0) if fail
4733 * @retval PMINFO_R_OK success
4734 * @retval PMINFO_R_EINVAL invalid argument
4735 * @pre pkgmgrinfo_appinfo_get_appinfo()
4736 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4738 static int get_app_is_disable(const char *appid)
4742 pkgmgrinfo_appinfo_h handle = NULL;
4743 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4744 if (ret != PMINFO_R_OK)
4746 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4747 if (ret != PMINFO_R_OK) {
4748 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4751 printf("app is_disable: %d\n", is_disable);
4752 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4757 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4760 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4761 * @brief This API gets whethere the given application is global application or user application
4763 * @par This API is for package-manager client application
4764 * @par Sync (or) Async : Synchronous API
4766 * @param[in] handle pointer to application info handle
4767 * @param[in] global pointer to hold application global value
4768 * @return 0 if success, error code(<0) if fail
4769 * @retval PMINFO_R_OK success
4770 * @retval PMINFO_R_EINVAL invalid argument
4771 * @retval PMINFO_R_ERROR internal error
4772 * @pre pkgmgrinfo_appinfo_get_appinfo()
4773 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4774 * @see pkgmgrinfo_appinfo_get_appid()
4775 static int get_app_is_global(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_global(handle, &global);
4784 if (ret != PMINFO_R_OK) {
4785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4788 printf("app is_global: %d\n", global);
4789 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4794 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4797 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4798 * @brief This API gets the application 'splash_screen_display' value from the app ID
4800 * @par This API is for package-manager client application
4801 * @par Sync (or) Async : Synchronous API
4803 * @param[in] handle pointer to application info handle
4804 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4805 * @return 0 if success, error code(<0) if fail
4806 * @retval PMINFO_R_OK success
4807 * @retval PMINFO_R_EINVAL invalid argument
4808 * @retval PMINFO_R_ERROR internal error
4810 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4813 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
4814 * @brief This API gets the application 'support_ambient' value from the app ID
4816 * @par This API is for package-manager client application
4817 * @par Sync (or) Async : Synchronous API
4819 * @param[in] handle pointer to application info handle
4820 * @param[out] support_ambient pointer to hold package support_ambient value
4821 * @return 0 if success, error code(<0) if fail
4822 * @retval PMINFO_R_OK success
4823 * @retval PMINFO_R_EINVAL invalid argument
4824 * @retval PMINFO_R_ERROR internal error
4826 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
4829 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4830 * @brief This API destroys the application information handle freeing up all the resources
4832 * @par This API is for package-manager client application
4833 * @par Sync (or) Async : Synchronous API
4835 * @param[in] handle pointer to the application info handle.
4836 * @return 0 if success, error code(<0) if fail
4837 * @retval PMINFO_R_OK success
4838 * @retval PMINFO_R_EINVAL invalid argument
4839 * @retval PMINFO_R_ERROR internal error
4840 * @pre pkgmgrinfo_appinfo_get_appinfo()
4842 * @see pkgmgrinfo_appinfo_get_pkgid()
4843 * @see pkgmgrinfo_appinfo_is_multiple()
4845 static int get_app_type(const char *appid)
4849 pkgmgrinfo_appinfo_h handle;
4850 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4851 if (ret != PMINFO_R_OK)
4853 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4854 if (ret != PMINFO_R_OK) {
4855 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4858 printf("apptype: %s\n", type);
4859 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4864 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4867 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4868 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4869 The query will search the entire application information collected from the manifest file of all the installed packages
4871 * @par This API is for package-manager client application
4872 * @par Sync (or) Async : Synchronous API
4874 * @param[out] handle pointer to the application info filter handle.
4875 * @return 0 if success, error code(<0) if fail
4876 * @retval PMINFO_R_OK success
4877 * @retval PMINFO_R_EINVAL invalid argument
4878 * @retval PMINFO_R_ERROR internal error
4880 * @post pkgmgrinfo_appinfo_filter_destroy()
4881 * @see pkgmgrinfo_appinfo_filter_count()
4882 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4884 static int get_capp_count()
4888 pkgmgrinfo_appinfo_filter_h handle;
4889 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4890 if (ret != PMINFO_R_OK)
4892 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4893 if (ret != PMINFO_R_OK) {
4894 pkgmgrinfo_appinfo_filter_destroy(handle);
4897 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4898 if (ret != PMINFO_R_OK) {
4899 pkgmgrinfo_appinfo_filter_destroy(handle);
4902 printf("No of capp: %d\n", count);
4903 pkgmgrinfo_appinfo_filter_destroy(handle);
4908 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4911 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4912 * @brief This API destroys the application information filter handle freeing up all the resources
4914 * @par This API is for package-manager client application
4915 * @par Sync (or) Async : Synchronous API
4917 * @param[in] handle pointer to the application info filter handle.
4918 * @return 0 if success, error code(<0) if fail
4919 * @retval PMINFO_R_OK success
4920 * @retval PMINFO_R_EINVAL invalid argument
4921 * @retval PMINFO_R_ERROR internal error
4922 * @pre pkgmgrinfo_appinfo_filter_create()
4924 * @see pkgmgrinfo_appinfo_filter_count()
4925 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4927 static int get_capp_count()
4931 pkgmgrinfo_appinfo_filter_h handle;
4932 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4933 if (ret != PMINFO_R_OK)
4935 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4936 if (ret != PMINFO_R_OK) {
4937 pkgmgrinfo_appinfo_filter_destroy(handle);
4940 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4941 if (ret != PMINFO_R_OK) {
4942 pkgmgrinfo_appinfo_filter_destroy(handle);
4945 printf("No of capp: %d\n", count);
4946 pkgmgrinfo_appinfo_filter_destroy(handle);
4951 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4954 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4955 * @brief This API adds a boolean filter property to the filter handle
4957 * @par This API is for package-manager client application
4958 * @par Sync (or) Async : Synchronous API
4960 * @param[in] handle pointer to the application info filter handle.
4961 * @param[in] property boolean property name.
4962 * @param[in] value value corresponding to the property.
4963 * @return 0 if success, error code(<0) if fail
4964 * @retval PMINFO_R_OK success
4965 * @retval PMINFO_R_EINVAL invalid argument
4966 * @retval PMINFO_R_ERROR internal error
4967 * @pre pkgmgrinfo_appinfo_filter_create()
4968 * @post pkgmgrinfo_appinfo_filter_destroy()
4969 * @see pkgmgrinfo_appinfo_filter_count()
4970 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4972 static int get_taskmanageable_app_count()
4976 pkgmgrinfo_appinfo_filter_h handle;
4977 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4978 if (ret != PMINFO_R_OK)
4980 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4981 if (ret != PMINFO_R_OK) {
4982 pkgmgrinfo_appinfo_filter_destroy(handle);
4985 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4986 if (ret != PMINFO_R_OK) {
4987 pkgmgrinfo_appinfo_filter_destroy(handle);
4990 printf("No of taskmanageable apps: %d\n", count);
4991 pkgmgrinfo_appinfo_filter_destroy(handle);
4996 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4997 const char *property, const bool value);
5000 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5001 * @brief This API adds an integer filter property to the filter handle
5003 * @par This API is for package-manager client application
5004 * @par Sync (or) Async : Synchronous API
5006 * @param[in] handle pointer to the application info filter handle.
5007 * @param[in] property integer property name.
5008 * @param[in] value value corresponding to the property.
5009 * @return 0 if success, error code(<0) if fail
5010 * @retval PMINFO_R_OK success
5011 * @retval PMINFO_R_EINVAL invalid argument
5012 * @retval PMINFO_R_ERROR internal error
5013 * @pre pkgmgrinfo_appinfo_filter_create()
5014 * @post pkgmgrinfo_appinfo_filter_destroy()
5015 * @see pkgmgrinfo_appinfo_filter_count()
5016 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5018 static int get_taskmanageable_app_count()
5022 pkgmgrinfo_appinfo_filter_h handle;
5023 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5024 if (ret != PMINFO_R_OK)
5026 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5027 if (ret != PMINFO_R_OK) {
5028 pkgmgrinfo_appinfo_filter_destroy(handle);
5031 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5032 if (ret != PMINFO_R_OK) {
5033 pkgmgrinfo_appinfo_filter_destroy(handle);
5036 printf("No of apps: %d\n", count);
5037 pkgmgrinfo_appinfo_filter_destroy(handle);
5042 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5043 const char *property, const int value);
5046 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5047 * @brief This API adds a string filter property to the filter handle
5049 * @par This API is for package-manager client application
5050 * @par Sync (or) Async : Synchronous API
5052 * @param[in] handle pointer to the application info filter handle.
5053 * @param[in] property string property name.
5054 * @param[in] value value corresponding to the property.
5055 * @return 0 if success, error code(<0) if fail
5056 * @retval PMINFO_R_OK success
5057 * @retval PMINFO_R_EINVAL invalid argument
5058 * @retval PMINFO_R_ERROR internal error
5059 * @pre pkgmgrinfo_appinfo_filter_create()
5060 * @post pkgmgrinfo_appinfo_filter_destroy()
5061 * @see pkgmgrinfo_appinfo_filter_count()
5062 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5064 static int get_capp_count()
5068 pkgmgrinfo_appinfo_filter_h handle;
5069 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5070 if (ret != PMINFO_R_OK)
5072 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5073 if (ret != PMINFO_R_OK) {
5074 pkgmgrinfo_appinfo_filter_destroy(handle);
5077 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5078 if (ret != PMINFO_R_OK) {
5079 pkgmgrinfo_appinfo_filter_destroy(handle);
5082 printf("No of capp: %d\n", count);
5083 pkgmgrinfo_appinfo_filter_destroy(handle);
5088 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5089 const char *property, const char *value);
5092 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5093 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5095 * @par This API is for package-manager client application
5096 * @par Sync (or) Async : Synchronous API
5098 * @param[in] handle pointer to the application info filter handle.
5099 * @param[in] app_cb callback function.
5100 * @param[in] user_data user data to be passed to the callback function
5101 * @return 0 if success, error code(<0) if fail
5102 * @retval PMINFO_R_OK success
5103 * @retval PMINFO_R_EINVAL invalid argument
5104 * @retval PMINFO_R_ERROR internal error
5105 * @pre pkgmgrinfo_appinfo_filter_create()
5106 * @post pkgmgrinfo_appinfo_filter_destroy()
5107 * @see pkgmgrinfo_appinfo_filter_count()
5109 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5112 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5113 printf("appid : %s\n", appid);
5117 static int get_capp_list()
5120 pkgmgrinfo_appinfo_filter_h handle;
5121 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5122 if (ret != PMINFO_R_OK)
5124 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5125 if (ret != PMINFO_R_OK) {
5126 pkgmgrinfo_appinfo_filter_destroy(handle);
5129 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5130 if (ret != PMINFO_R_OK) {
5131 pkgmgrinfo_appinfo_filter_destroy(handle);
5134 pkgmgrinfo_appinfo_filter_destroy(handle);
5139 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5140 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5141 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5142 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5145 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5146 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5147 * @brief This API counts the application that satisfy the filter conditions
5149 * @par This API is for package-manager client application
5150 * @par Sync (or) Async : Synchronous API
5152 * @param[in] handle pointer to the application info filter handle.
5153 * @param[in] count pointer to store count value
5154 * @param[in] uid the addressee user id of the instruction
5155 * @return 0 if success, error code(<0) if fail
5156 * @retval PMINFO_R_OK success
5157 * @retval PMINFO_R_EINVAL invalid argument
5158 * @retval PMINFO_R_ERROR internal error
5159 * @pre pkgmgrinfo_appinfo_filter_create()
5160 * @post pkgmgrinfo_appinfo_filter_destroy()
5161 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5163 static int get_capp_count()
5167 pkgmgrinfo_appinfo_filter_h handle;
5168 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5169 if (ret != PMINFO_R_OK)
5171 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5172 if (ret != PMINFO_R_OK) {
5173 pkgmgrinfo_appinfo_filter_destroy(handle);
5176 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5177 if (ret != PMINFO_R_OK) {
5178 pkgmgrinfo_appinfo_filter_destroy(handle);
5181 printf("No of capp: %d\n", count);
5182 pkgmgrinfo_appinfo_filter_destroy(handle);
5187 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5188 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5190 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5191 * @brief This API creates the application's metadata information filter handle from db.
5193 * @par This API is for package-manager client application
5194 * @par Sync (or) Async : Synchronous API
5196 * @param[out] handle pointer to the application metadata info filter handle.
5197 * @return 0 if success, error code(<0) if fail
5198 * @retval PMINFO_R_OK success
5199 * @retval PMINFO_R_EINVAL invalid argument
5200 * @retval PMINFO_R_ERROR internal error
5202 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5203 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5205 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5208 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5209 printf("appid : %s\n", appid);
5213 static int get_app_list(const char *mkey, const char *mvalue)
5216 pkgmgrinfo_appinfo_metadata_filter_h handle;
5217 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5218 if (ret != PMINFO_R_OK)
5220 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5221 if (ret != PMINFO_R_OK) {
5222 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5225 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5226 if (ret != PMINFO_R_OK) {
5227 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5230 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5235 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5238 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5239 * @brief This API destroys the application's metadata information filter handle.
5241 * @par This API is for package-manager client application
5242 * @par Sync (or) Async : Synchronous API
5244 * @param[in] handle pointer to the application metadata info filter handle.
5245 * @return 0 if success, error code(<0) if fail
5246 * @retval PMINFO_R_OK success
5247 * @retval PMINFO_R_EINVAL invalid argument
5248 * @retval PMINFO_R_ERROR internal error
5249 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5251 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5253 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5256 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5257 printf("appid : %s\n", appid);
5261 static int get_app_list(const char *mkey, const char *mvalue)
5264 pkgmgrinfo_appinfo_metadata_filter_h handle;
5265 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5266 if (ret != PMINFO_R_OK)
5268 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5269 if (ret != PMINFO_R_OK) {
5270 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5273 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5274 if (ret != PMINFO_R_OK) {
5275 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5278 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5283 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5286 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5287 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5288 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5290 * @par This API is for package-manager client application
5291 * @par Sync (or) Async : Synchronous API
5293 * @param[in] handle pointer to the application metadata info filter handle.
5294 * @param[in] key pointer to metadata key
5295 * @param[in] value pointer to metadata value
5296 * @return 0 if success, error code(<0) if fail
5297 * @retval PMINFO_R_OK success
5298 * @retval PMINFO_R_EINVAL invalid argument
5299 * @retval PMINFO_R_ERROR internal error
5300 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5301 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5302 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5304 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5307 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5308 printf("appid : %s\n", appid);
5312 static int get_app_list(const char *mkey, const char *mvalue)
5315 pkgmgrinfo_appinfo_metadata_filter_h handle;
5316 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5317 if (ret != PMINFO_R_OK)
5319 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5320 if (ret != PMINFO_R_OK) {
5321 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5324 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5325 if (ret != PMINFO_R_OK) {
5326 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5329 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5334 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5335 const char *key, const char *value);
5338 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5339 * @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)
5340 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5341 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5342 * negative value, no more callbacks will be called and API will return.
5344 * @par This API is for package-manager client application
5345 * @par Sync (or) Async : Synchronous API
5347 * @param[in] handle pointer to the application metadata info filter handle.
5348 * @param[in] app_cb function pointer to callback
5349 * @param[in] user_data pointer to user data
5350 * @param[in] uid the addressee user id of the instruction
5351 * @return 0 if success, error code(<0) if fail
5352 * @retval PMINFO_R_OK success
5353 * @retval PMINFO_R_EINVAL invalid argument
5354 * @retval PMINFO_R_ERROR internal error
5355 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5356 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5358 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5361 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5362 printf("appid : %s\n", appid);
5366 static int get_app_list(const char *mkey, const char *mvalue)
5369 pkgmgrinfo_appinfo_metadata_filter_h handle;
5370 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5371 if (ret != PMINFO_R_OK)
5373 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5374 if (ret != PMINFO_R_OK) {
5375 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5378 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5379 if (ret != PMINFO_R_OK) {
5380 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5383 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5388 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5389 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5390 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5391 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5393 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5394 * @brief This API creates the package cert information handle to get data from db.
5396 * @par This API is for package-manager client application
5397 * @par Sync (or) Async : Synchronous API
5399 * @param[out] handle pointer to the package cert handle.
5400 * @return 0 if success, error code(<0) if fail
5401 * @retval PMINFO_R_OK success
5402 * @retval PMINFO_R_EINVAL invalid argument
5403 * @retval PMINFO_R_ERROR internal error
5405 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5406 * @see pkgmgrinfo_pkginfo_get_cert_value()
5407 * @see pkgmgrinfo_pkginfo_load_certinfo()
5409 static int get_cert_info(const char *pkgid)
5412 pkgmgrinfo_certinfo_h handle;
5413 char *auth_cert = NULL;
5414 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5415 if (ret != PMINFO_R_OK)
5417 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5418 if (ret != PMINFO_R_OK) {
5419 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5422 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5423 if (ret != PMINFO_R_OK) {
5424 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5427 printf("Author root certificate: %s\n", auth_root);
5428 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5433 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5436 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5437 * @brief This API loads the package cert information handle with data from db.
5439 * @par This API is for package-manager client application
5440 * @par Sync (or) Async : Synchronous API
5442 * @param[in] pkgid pointer to the package ID.
5443 * @param[in] handle pointer to the package cert handle.
5444 * @return 0 if success, error code(<0) if fail
5445 * @retval PMINFO_R_OK success
5446 * @retval PMINFO_R_EINVAL invalid argument
5447 * @retval PMINFO_R_ERROR internal error
5448 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5449 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5450 * @see pkgmgrinfo_pkginfo_get_cert_value()
5452 static int get_cert_info(const char *pkgid)
5455 pkgmgrinfo_certinfo_h handle;
5456 char *auth_cert = NULL;
5457 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5458 if (ret != PMINFO_R_OK)
5460 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5461 if (ret != PMINFO_R_OK) {
5462 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5465 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5466 if (ret != PMINFO_R_OK) {
5467 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5470 printf("Author root certificate: %s\n", auth_root);
5471 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5476 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5479 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5480 * @brief This API gets the package cert information from the handle
5482 * @par This API is for package-manager client application
5483 * @par Sync (or) Async : Synchronous API
5485 * @param[in] handle pointer to the package cert handle.
5486 * @param[in] cert_type certificate type
5487 * @param[out] cert_value pointer to hold certificate value
5488 * @return 0 if success, error code(<0) if fail
5489 * @retval PMINFO_R_OK success
5490 * @retval PMINFO_R_EINVAL invalid argument
5491 * @retval PMINFO_R_ERROR internal error
5492 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5493 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5494 * @see pkgmgrinfo_pkginfo_load_certinfo()
5496 static int get_cert_info(const char *pkgid)
5499 pkgmgrinfo_certinfo_h handle;
5500 char *auth_cert = NULL;
5501 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5502 if (ret != PMINFO_R_OK)
5504 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5505 if (ret != PMINFO_R_OK) {
5506 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5509 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5510 if (ret != PMINFO_R_OK) {
5511 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5514 printf("Author root certificate: %s\n", auth_root);
5515 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5520 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5523 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5524 * @brief This API destroys the package cert information handle freeing up all the resources
5526 * @par This API is for package-manager client application
5527 * @par Sync (or) Async : Synchronous API
5529 * @param[in] handle pointer to the package cert handle.
5530 * @return 0 if success, error code(<0) if fail
5531 * @retval PMINFO_R_OK success
5532 * @retval PMINFO_R_EINVAL invalid argument
5533 * @retval PMINFO_R_ERROR internal error
5534 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5536 * @see pkgmgrinfo_pkginfo_load_certinfo()
5538 static int get_cert_info(const char *pkgid)
5541 pkgmgrinfo_certinfo_h handle;
5542 char *auth_cert = NULL;
5543 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5544 if (ret != PMINFO_R_OK)
5546 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5547 if (ret != PMINFO_R_OK) {
5548 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5551 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5552 if (ret != PMINFO_R_OK) {
5553 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5556 printf("Author root certificate: %s\n", auth_root);
5557 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5562 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5565 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5566 * @brief This API deletes the package cert information from DB
5568 * @par This API is for package-manager client application
5569 * @par Sync (or) Async : Synchronous API
5571 * @param[in] pkgid pointer to the package ID.
5572 * @return 0 if success, error code(<0) if fail
5573 * @retval PMINFO_R_OK success
5574 * @retval PMINFO_R_EINVAL invalid argument
5575 * @retval PMINFO_R_ERROR internal error
5579 static int delete_cert_info(const char *pkgid)
5582 ret = pkgmgrinfo_delete_certinfo(pkgid);
5583 if (ret != PMINFO_R_OK)
5589 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5590 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5593 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5594 * @brief This API creates the package cert information handle to set data in db.
5596 * @par This API is for package-manager client application
5597 * @par Sync (or) Async : Synchronous API
5599 * @param[out] handle pointer to the package cert handle.
5600 * @return 0 if success, error code(<0) if fail
5601 * @retval PMINFO_R_OK success
5602 * @retval PMINFO_R_EINVAL invalid argument
5603 * @retval PMINFO_R_ERROR internal error
5605 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5606 * @see pkgmgrinfo_set_cert_value()
5607 * @see pkgmgrinfo_save_certinfo()
5609 static int set_cert_in_db(const char *pkgid)
5612 pkgmgrinfo_instcertinfo_h handle;
5613 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5614 if (ret != PMINFO_R_OK)
5616 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5617 if (ret != PMINFO_R_OK) {
5618 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5621 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5622 if (ret != PMINFO_R_OK) {
5623 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5626 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5631 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5634 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5635 * @brief This API sets the package cert information in the handle.
5637 * @par This API is for package-manager client application
5638 * @par Sync (or) Async : Synchronous API
5640 * @param[in] handle pointer to the package cert handle.
5641 * @param[in] cert_type certificate type.
5642 * @param[in] cert_value certificate value.
5643 * @return 0 if success, error code(<0) if fail
5644 * @retval PMINFO_R_OK success
5645 * @retval PMINFO_R_EINVAL invalid argument
5646 * @retval PMINFO_R_ERROR internal error
5647 * @pre pkgmgrinfo_create_certinfo_set_handle()
5648 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5649 * @see pkgmgrinfo_save_certinfo()
5651 static int set_cert_in_db(const char *pkgid)
5654 pkgmgrinfo_instcertinfo_h handle;
5655 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5656 if (ret != PMINFO_R_OK)
5658 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5659 if (ret != PMINFO_R_OK) {
5660 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5663 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5664 if (ret != PMINFO_R_OK) {
5665 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5668 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5673 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5676 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5677 * @brief This API saves the package cert information in the DB.
5679 * @par This API is for package-manager client application
5680 * @par Sync (or) Async : Synchronous API
5682 * @param[in] pkgid pointer to the package ID.
5683 * @param[in] handle pointer to the package cert handle.
5684 * @return 0 if success, error code(<0) if fail
5685 * @retval PMINFO_R_OK success
5686 * @retval PMINFO_R_EINVAL invalid argument
5687 * @retval PMINFO_R_ERROR internal error
5688 * @pre pkgmgrinfo_create_certinfo_set_handle()
5689 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5690 * @see pkgmgrinfo_save_certinfo()
5692 static int set_cert_in_db(const char *pkgid)
5695 pkgmgrinfo_instcertinfo_h handle;
5696 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5697 if (ret != PMINFO_R_OK)
5699 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5700 if (ret != PMINFO_R_OK) {
5701 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5704 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5705 if (ret != PMINFO_R_OK) {
5706 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5709 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5714 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5717 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5718 * @brief This API destroys the package cert information handle freeing up all the resources.
5720 * @par This API is for package-manager client application
5721 * @par Sync (or) Async : Synchronous API
5723 * @param[in] handle pointer to the package cert handle.
5724 * @return 0 if success, error code(<0) if fail
5725 * @retval PMINFO_R_OK success
5726 * @retval PMINFO_R_EINVAL invalid argument
5727 * @retval PMINFO_R_ERROR internal error
5728 * @pre pkgmgrinfo_create_certinfo_set_handle()
5730 * @see pkgmgrinfo_save_certinfo()
5732 static int set_cert_in_db(const char *pkgid)
5735 pkgmgrinfo_instcertinfo_h handle;
5736 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5737 if (ret != PMINFO_R_OK)
5739 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5740 if (ret != PMINFO_R_OK) {
5741 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5744 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5745 if (ret != PMINFO_R_OK) {
5746 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5749 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5754 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5757 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5758 * @brief This API gets the datacontrol info
5760 * @par This API is for package-manager client application
5761 * @par Sync (or) Async : Synchronous API
5763 * @param[in] providerid pointer to the providerid of dataconltrol.
5764 * @param[in] type pointer to the type of dataconltrol.
5765 * @param[out] appid pointer to hold appid, need to free after using
5766 * @param[out] access pointer to hold access, need to free after using
5767 * @return 0 if success, error code(<0) if fail
5768 * @retval PMINFO_R_OK success
5769 * @retval PMINFO_R_EINVAL invalid argument
5770 * @retval PMINFO_R_ERROR internal error
5773 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5776 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5777 * @brief This API gets the application 'guest mode visibility' value from the DB
5779 * @par This API is for package-manager client application
5780 * @par Sync (or) Async : Synchronous API
5782 * @param[in] handle pointer to application info handle
5783 * @param[out] status pointer to hold app guest mode visibility value
5784 * @return 0 if success, error code(<0) if fail
5785 * @retval PMINFO_R_OK success
5786 * @retval PMINFO_R_EINVAL invalid argument
5787 * @retval PMINFO_R_ERROR internal error
5788 * @pre pkgmgrinfo_appinfo_get_appinfo()
5789 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5790 * @see pkgmgrinfo_appinfo_get_appid()
5791 * @see pkgmgrinfo_appinfo_is_multiple()
5793 static int get_app_guestmode_visibility(const char *appid)
5797 pkgmgrinfo_appinfo_h handle;
5798 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5799 if (ret != PMINFO_R_OK)
5801 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5802 if (ret != PMINFO_R_OK) {
5803 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5806 printf("app guest mode visibility: %d\n", status);
5807 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5812 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5815 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5816 * @brief This API sets the package 'installed_storage' value in db
5818 * @par This API is for package-manager client application
5819 * @par Sync (or) Async : Synchronous API
5821 * @param[in] pkgid pointer to the package ID.
5822 * @param[in] location package install location
5823 * @param[in] external_pkg_path image path if pkg has installed at external storage
5824 * @return 0 if success, error code(<0) if fail
5825 * @retval PMINFO_R_OK success
5826 * @retval PMINFO_R_EINVAL invalid argument
5827 * @retval PMINFO_R_ERROR internal error
5829 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5833 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5834 if (ret != PMINFO_R_OK) {
5841 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
5842 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
5844 /* version compare */
5845 int pkgmgrinfo_compare_package_version(const char *current_version,
5846 const char *target_version, pkgmgrinfo_version_compare_type *res);
5853 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5854 int flag, void *user_data, uid_t uid);
5855 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5856 int flag, void *user_data);
5857 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5858 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5860 int pkgmgrinfo_appinfo_get_installed_list_full(
5861 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5864 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
5865 pkgmgrinfo_archiveinfo_h *handle);
5866 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
5867 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
5868 const char **pkgid);
5869 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
5871 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
5872 const char **version);
5873 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
5874 const char **api_version);
5875 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
5876 const char **description);
5877 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
5878 const char **label);
5879 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
5880 const char **author);
5881 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
5882 const unsigned char **icon, size_t *size);
5885 * @pkgmgrinfo client API end
5893 #endif /* __PKG_INFO_H__ */