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"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE"
149 /** Integer property for filtering app disabled by user*/
150 #define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE"
151 /** Integer property for filtering app support mode */
152 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
175 /** will be updated*/
176 /** string property for filtering based on pkg info*/
177 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
179 /* For multiuser support */
180 const char *getIconPath(uid_t uid, bool readonly);
181 char *getUserPkgParserDBPath(void);
182 char *getUserPkgParserDBPathUID(uid_t uid);
183 char *getUserPkgCertDBPath(void);
184 char *getUserPkgCertDBPathUID(uid_t uid);
185 const char *getUserManifestPath(uid_t uid, bool readonly);
188 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
189 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
190 * @brief This API gets list of installed packages
192 * @par This API is for package-manager client application
193 * @par Sync (or) Async : Synchronous API
194 * @param[in] pkg_list_cb iteration function for list
195 * @param[in] user_data user data to be passed to callback function
196 * @param[in] uid the addressee user id of the instruction
197 * @return 0 if success, error code(<0) if fail
198 * @retval PMINFO_R_OK success
199 * @retval PMINFO_R_EINVAL invalid argument
200 * @retval PMINFO_R_ERROR internal error
204 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
208 pkgid1 = (char *)user_data;
209 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
210 if (strcmp(pkgid1, pkgid2) == 0) {
217 static int list_pkgs()
220 char *name = "helloworld";
221 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
222 if (ret != PMINFO_R_OK) {
229 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
230 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
233 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
234 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
235 * @brief This API gets list of disabled packages
237 * @par This API is for package-manager client application
238 * @par Sync (or) Async : Synchronous API
239 * @param[in] pkg_list_cb iteration function for list
240 * @param[in] user_data user data to be passed to callback function
241 * @param[in] uid the addressee user id of the instruction
242 * @return 0 if success, error code(<0) if fail
243 * @retval PMINFO_R_OK success
244 * @retval PMINFO_R_EINVAL invalid argument
245 * @retval PMINFO_R_ERROR internal error
249 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
250 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
253 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
254 * @brief This API creates the package information handle from db which is not disabled
256 * @par This API is for package-manager client application
257 * @par Sync (or) Async : Synchronous API
259 * @param[in] pkgid pointer to package ID
260 * @param[in] uid the addressee user id of the instruction
261 * @param[out] handle pointer to the package info handle.
262 * @return 0 if success, error code(<0) if fail
263 * @retval PMINFO_R_OK success
264 * @retval PMINFO_R_EINVAL invalid argument
265 * @retval PMINFO_R_ERROR internal error
267 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
268 * @see pkgmgrinfo_pkginfo_get_pkgid()
269 * @see pkgmgrinfo_pkginfo_is_removable()
271 static int get_pkg_type(const char *pkgid)
275 pkgmgrinfo_pkginfo_h handle;
276 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
277 if (ret != PMINFO_R_OK)
279 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
280 if (ret != PMINFO_R_OK) {
281 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
284 printf("pkgtype: %s\n", type);
285 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
290 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
291 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
294 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
295 * @brief This API creates the disabled package information handle from db
297 * @par This API is for package-manager client application
298 * @par Sync (or) Async : Synchronous API
300 * @param[in] pkgid pointer to package ID
301 * @param[in] uid the addressee user id of the instruction
302 * @param[out] handle pointer to the package info handle.
303 * @return 0 if success, error code(<0) if fail
304 * @retval PMINFO_R_OK success
305 * @retval PMINFO_R_EINVAL invalid argument
306 * @retval PMINFO_R_ERROR internal error
308 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
309 * @see pkgmgrinfo_pkginfo_get_pkginfo()
311 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
312 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
315 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
316 * @brief This API creates the package information handle from db regardless of its disable or storage status
318 * @par This API is for package-manager client application
319 * @par Sync (or) Async : Synchronous API
321 * @param[in] pkgid pointer to package ID
322 * @param[in] uid the addressee user id of the instruction
323 * @param[out] handle pointer to the package info handle.
324 * @return 0 if success, error code(<0) if fail
325 * @retval PMINFO_R_OK success
326 * @retval PMINFO_R_EINVAL invalid argument
327 * @retval PMINFO_R_ERROR internal error
329 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
330 * @see pkgmgrinfo_pkginfo_get_pkgid()
331 * @see pkgmgrinfo_pkginfo_is_removable()
333 static int get_pkg_type(const char *pkgid)
337 pkgmgrinfo_pkginfo_h handle;
338 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
339 if (ret != PMINFO_R_OK)
341 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
342 if (ret != PMINFO_R_OK) {
343 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
346 printf("pkgtype: %s\n", type);
347 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
352 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
353 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
356 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
357 * @brief This API gets the package name from the package ID
359 * @par This API is for package-manager client application
360 * @par Sync (or) Async : Synchronous API
362 * @param[in] handle pointer to package info handle
363 * @param[out] pkg_name pointer to hold package name
364 * @return 0 if success, error code(<0) if fail
365 * @retval PMINFO_R_OK success
366 * @retval PMINFO_R_EINVAL invalid argument
367 * @retval PMINFO_R_ERROR internal error
368 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
369 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
370 * @see pkgmgrinfo_pkginfo_get_type()
371 * @see pkgmgrinfo_pkginfo_is_removable()
373 static int get_pkg_name(const char *pkgid)
376 char *pkgname = NULL;
377 pkgmgrinfo_pkginfo_h handle;
378 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
379 if (ret != PMINFO_R_OK)
381 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
382 if (ret != PMINFO_R_OK) {
383 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
386 printf("pkgname: %s\n", pkgname);
387 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
392 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
395 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
396 * @brief This API gets the package id from the package ID
398 * @par This API is for package-manager client application
399 * @par Sync (or) Async : Synchronous API
401 * @param[in] handle pointer to package info handle
402 * @param[out] pkgid pointer to hold package id
403 * @return 0 if success, error code(<0) if fail
404 * @retval PMINFO_R_OK success
405 * @retval PMINFO_R_EINVAL invalid argument
406 * @retval PMINFO_R_ERROR internal error
407 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
408 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
409 * @see pkgmgrinfo_pkginfo_get_type()
410 * @see pkgmgrinfo_pkginfo_is_removable()
412 static int get_pkgid(const char *pkgid)
416 pkgmgrinfo_pkginfo_h handle;
417 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
418 if (ret != PMINFO_R_OK)
420 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
421 if (ret != PMINFO_R_OK) {
422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
425 printf("pkg id: %s\n", pkg_id);
426 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
431 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
434 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
435 * @brief This API gets the package type from the package ID
437 * @par This API is for package-manager client application
438 * @par Sync (or) Async : Synchronous API
440 * @param[in] handle pointer to package info handle
441 * @param[out] type pointer to hold package type
442 * @return 0 if success, error code(<0) if fail
443 * @retval PMINFO_R_OK success
444 * @retval PMINFO_R_EINVAL invalid argument
445 * @retval PMINFO_R_ERROR internal error
446 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
447 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
448 * @see pkgmgrinfo_pkginfo_get_pkgid()
449 * @see pkgmgrinfo_pkginfo_is_removable()
451 static int get_pkg_type(const char *pkgid)
455 pkgmgrinfo_pkginfo_h handle;
456 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
457 if (ret != PMINFO_R_OK)
459 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
460 if (ret != PMINFO_R_OK) {
461 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
464 printf("pkgtype: %s\n", type);
465 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
470 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
473 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
474 * @brief This API gets the package version from the package ID
476 * @par This API is for package-manager client application
477 * @par Sync (or) Async : Synchronous API
479 * @param[in] handle pointer to package info handle
480 * @param[out] version pointer to hold package version
481 * @return 0 if success, error code(<0) if fail
482 * @retval PMINFO_R_OK success
483 * @retval PMINFO_R_EINVAL invalid argument
484 * @retval PMINFO_R_ERROR internal error
485 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
486 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
487 * @see pkgmgrinfo_pkginfo_get_pkgid()
488 * @see pkgmgrinfo_pkginfo_is_removable()
490 static int get_pkg_version(const char *pkgid)
493 char *version = NULL;
494 pkgmgrinfo_pkginfo_h handle;
495 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
496 if (ret != PMINFO_R_OK)
498 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
499 if (ret != PMINFO_R_OK) {
500 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
503 printf("pkg version: %s\n", version);
504 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
509 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
512 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
513 * @brief This API gets the package api_version from the package ID
515 * @par This API is for package-manager client application
516 * @par Sync (or) Async : Synchronous API
518 * @param[in] handle pointer to package info handle
519 * @param[out] api_version pointer to hold package api_version
520 * @return 0 if success, error code(<0) if fail
521 * @retval PMINFO_R_OK success
522 * @retval PMINFO_R_EINVAL invalid argument
523 * @retval PMINFO_R_ERROR internal error
524 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
525 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
526 * @see pkgmgrinfo_pkginfo_get_pkgid()
527 * @see pkgmgrinfo_pkginfo_is_removable()
529 static int get_pkg_api_version(const char *pkgid)
532 char *api_version = NULL;
533 pkgmgrinfo_pkginfo_h handle = NULL;
534 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
535 if (ret != PMINFO_R_OK)
537 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
538 if (ret != PMINFO_R_OK) {
539 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
542 printf("pkg api_version: %s\n", api_version);
543 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
548 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
551 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
552 * @brief This API gets tep(tizen expansion package) file name associated with the package
554 * @par This API is for package-manager client application
555 * @par Sync (or) Async : Synchronous API
557 * @param[in] handle pointer to the pkginfo handle.
558 * @param[out] tep_name pointer to hold tep name
559 * @return 0 if success, error code(<0) if fail
560 * @retval PMINFO_R_OK success
561 * @retval PMINFO_R_EINVAL invalid argument
562 * @retval PMINFO_R_ERROR internal error
563 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
564 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
565 * @see pkgmgrinfo_pkginfo_get_pkgid()
567 static int get_tep_name(const char *pkgid)
570 char *tep_name = NULL;
571 pkgmgrinfo_pkginfo_h handle = NULL;
572 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
573 if (ret != PMINFO_R_OK)
575 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
576 if (ret != PMINFO_R_OK) {
577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
580 printf("TEP name is: %s\n", tep_name);
581 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
586 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
589 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
590 * @brief This API gets package mount point path associated with the package
591 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
593 * @par This API is for package-manager client application
594 * @par Sync (or) Async : Synchronous API
596 * @param[in] handle pointer to the pkginfo handle.
597 * @param[out] zip_mount_file pointer to hold zip mount file
598 * @return 0 if success, error code(<0) if fail
599 * @retval PMINFO_R_OK success
600 * @retval PMINFO_R_EINVAL invalid argument
601 * @retval PMINFO_R_ERROR internal error
602 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
603 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
604 * @see pkgmgrinfo_pkginfo_get_pkgid()
606 static int get_zip_mount_file(const char *pkgid)
609 char *zip_mount_file = NULL;
610 pkgmgrinfo_pkginfo_h handle = NULL;
611 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
612 if (ret != PMINFO_R_OK)
614 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
615 if (ret != PMINFO_R_OK) {
616 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
619 if (zip_mount_file != NULL)
620 printf("Zip mount path is: %s\n", zip_mount_file);
621 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
626 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
629 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
630 * @brief This API gets the package install location from the package ID
632 * @par This API is for package-manager client application
633 * @par Sync (or) Async : Synchronous API
635 * @param[in] handle pointer to package info handle
636 * @param[out] location pointer to hold package install location
637 * @return 0 if success, error code(<0) if fail
638 * @retval PMINFO_R_OK success
639 * @retval PMINFO_R_EINVAL invalid argument
640 * @retval PMINFO_R_ERROR internal error
641 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
642 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
643 * @see pkgmgrinfo_pkginfo_get_pkgid()
644 * @see pkgmgrinfo_pkginfo_is_removable()
646 static int get_pkg_install_location(const char *pkgid)
649 pkgmgrinfo_install_location location;
650 pkgmgrinfo_pkginfo_h handle;
651 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
652 if (ret != PMINFO_R_OK)
654 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
655 if (ret != PMINFO_R_OK) {
656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
659 printf("pkg install location: %d\n", location);
660 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
665 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
668 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
669 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
670 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
671 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
673 * @par This API is for package-manager client application
674 * @par Sync (or) Async : Synchronous API
676 * @param[in] handle pointer to package info handle
677 * @param[out] size pointer to hold package size
678 * @return 0 if success, error code(<0) if fail
679 * @retval PMINFO_R_OK success
680 * @retval PMINFO_R_EINVAL invalid argument
681 * @retval PMINFO_R_ERROR internal error
682 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
683 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
684 * @see pkgmgrinfo_pkginfo_get_pkgid()
685 * @see pkgmgrinfo_pkginfo_is_removable()
687 static int get_pkg_size(const char *pkgid)
691 pkgmgrinfo_pkginfo_h handle;
692 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
693 if (ret != PMINFO_R_OK)
695 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
696 if (ret != PMINFO_R_OK) {
697 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
700 printf("pkgsize: %d\n", size);
701 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
706 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
709 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
710 * @brief This API gets the package icon from the package ID
712 * @par This API is for package-manager client application
713 * @par Sync (or) Async : Synchronous API
715 * @param[in] handle pointer to package info handle
716 * @param[out] icon pointer to hold package icon
717 * @return 0 if success, error code(<0) if fail
718 * @retval PMINFO_R_OK success
719 * @retval PMINFO_R_EINVAL invalid argument
720 * @retval PMINFO_R_ERROR internal error
721 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
722 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
723 * @see pkgmgrinfo_pkginfo_get_pkgid()
724 * @see pkgmgrinfo_pkginfo_is_removable()
726 static int get_pkg_icon(const char *pkgid)
730 pkgmgrinfo_pkginfo_h handle;
731 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
732 if (ret != PMINFO_R_OK)
734 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
735 if (ret != PMINFO_R_OK) {
736 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
739 printf("pkg icon: %s\n", icon);
740 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
745 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
748 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
749 * @brief This API gets the package label from the package ID
751 * @par This API is for package-manager client application
752 * @par Sync (or) Async : Synchronous API
754 * @param[in] handle pointer to package info handle
755 * @param[out] label pointer to hold package label
756 * @return 0 if success, error code(<0) if fail
757 * @retval PMINFO_R_OK success
758 * @retval PMINFO_R_EINVAL invalid argument
759 * @retval PMINFO_R_ERROR internal error
760 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
761 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
762 * @see pkgmgrinfo_pkginfo_get_pkgid()
763 * @see pkgmgrinfo_pkginfo_is_removable()
765 static int get_pkg_label(const char *pkgid)
769 pkgmgrinfo_pkginfo_h handle;
770 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
771 if (ret != PMINFO_R_OK)
773 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
774 if (ret != PMINFO_R_OK) {
775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
778 printf("pkg label: %s\n", label);
779 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
784 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
787 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
788 * @brief This API gets the package description from the package ID
790 * @par This API is for package-manager client application
791 * @par Sync (or) Async : Synchronous API
793 * @param[in] handle pointer to package info handle
794 * @param[out] description pointer to hold package description
795 * @return 0 if success, error code(<0) if fail
796 * @retval PMINFO_R_OK success
797 * @retval PMINFO_R_EINVAL invalid argument
798 * @retval PMINFO_R_ERROR internal error
799 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
800 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
801 * @see pkgmgrinfo_pkginfo_get_pkgid()
802 * @see pkgmgrinfo_pkginfo_is_removable()
804 static int get_pkg_description(const char *pkgid)
807 char *description = NULL;
808 pkgmgrinfo_pkginfo_h handle;
809 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
810 if (ret != PMINFO_R_OK)
812 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
813 if (ret != PMINFO_R_OK) {
814 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
817 printf("pkg description: %s\n", description);
818 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
823 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
826 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
827 * @brief This API gets the package's author name from the package ID
829 * @par This API is for package-manager client application
830 * @par Sync (or) Async : Synchronous API
832 * @param[in] handle pointer to package info handle
833 * @param[out] author_name pointer to hold package author name
834 * @return 0 if success, error code(<0) if fail
835 * @retval PMINFO_R_OK success
836 * @retval PMINFO_R_EINVAL invalid argument
837 * @retval PMINFO_R_ERROR internal error
838 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
839 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
840 * @see pkgmgrinfo_pkginfo_get_pkgid()
841 * @see pkgmgrinfo_pkginfo_is_removable()
843 static int get_pkg_author_name(const char *pkgid)
846 char *author_name = NULL;
847 pkgmgrinfo_pkginfo_h handle;
848 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
849 if (ret != PMINFO_R_OK)
851 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
852 if (ret != PMINFO_R_OK) {
853 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
856 printf("pkg author name: %s\n", author_name);
857 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
862 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
865 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
866 * @brief This API gets the package's author email from the package ID
868 * @par This API is for package-manager client application
869 * @par Sync (or) Async : Synchronous API
871 * @param[in] handle pointer to package info handle
872 * @param[out] author_email pointer to hold package author email
873 * @return 0 if success, error code(<0) if fail
874 * @retval PMINFO_R_OK success
875 * @retval PMINFO_R_EINVAL invalid argument
876 * @retval PMINFO_R_ERROR internal error
877 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
878 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
879 * @see pkgmgrinfo_pkginfo_get_pkgid()
880 * @see pkgmgrinfo_pkginfo_is_removable()
882 static int get_pkg_author_email(const char *pkgid)
885 char *author_email = NULL;
886 pkgmgrinfo_pkginfo_h handle;
887 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
888 if (ret != PMINFO_R_OK)
890 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
891 if (ret != PMINFO_R_OK) {
892 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
895 printf("pkg author email: %s\n", author_email);
896 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
901 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
904 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
905 * @brief This API gets the package's author href from the package ID
907 * @par This API is for package-manager client application
908 * @par Sync (or) Async : Synchronous API
910 * @param[in] handle pointer to package info handle
911 * @param[out] author_href pointer to hold package author href
912 * @return 0 if success, error code(<0) if fail
913 * @retval PMINFO_R_OK success
914 * @retval PMINFO_R_EINVAL invalid argument
915 * @retval PMINFO_R_ERROR internal error
916 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
917 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
918 * @see pkgmgrinfo_pkginfo_get_pkgid()
919 * @see pkgmgrinfo_pkginfo_is_removable()
921 static int get_pkg_author_href(const char *pkgid)
924 char *author_href = NULL;
925 pkgmgrinfo_pkginfo_h handle;
926 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
927 if (ret != PMINFO_R_OK)
929 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
930 if (ret != PMINFO_R_OK) {
931 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
934 printf("pkg author href: %s\n", author_href);
935 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
940 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
943 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
944 * @brief This API gets the package installed storagae value from the package ID
946 * @par This API is for package-manager client application
947 * @par Sync (or) Async : Synchronous API
949 * @param[in] handle pointer to package info handle
950 * @param[out] storage pointer to hold package installed storage
951 * @return 0 if success, error code(<0) if fail
952 * @retval PMINFO_R_OK success
953 * @retval PMINFO_R_EINVAL invalid argument
954 * @retval PMINFO_R_ERROR internal error
955 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
956 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
957 * @see pkgmgrinfo_pkginfo_get_pkgid()
958 * @see pkgmgrinfo_pkginfo_is_removable()
960 static int get_pkg_installed_storage(const char *pkgid)
963 pkgmgrinfo_installed_storage storage;
964 pkgmgrinfo_pkginfo_h handle;
965 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
966 if (ret != PMINFO_R_OK)
968 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
969 if (ret != PMINFO_R_OK) {
970 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
973 printf("pkg installed storage: %d\n", storage);
974 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
979 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
982 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
983 * @brief This API gets the installed time of package from the package ID
985 * @par This API is for package-manager client application
986 * @par Sync (or) Async : Synchronous API
988 * @param[in] handle pointer to package info handle
989 * @param[out] installed_time pointer to hold installed time of package
990 * @return 0 if success, error code(<0) if fail
991 * @retval PMINFO_R_OK success
992 * @retval PMINFO_R_EINVAL invalid argument
993 * @retval PMINFO_R_ERROR internal error
994 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
995 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
996 * @see pkgmgrinfo_pkginfo_get_pkgid()
997 * @see pkgmgrinfo_pkginfo_is_removable()
999 static int get_pkg_installed_time(const char *pkgid)
1002 int installed_time = 0;
1003 pkgmgrinfo_pkginfo_h handle;
1004 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1005 if (ret != PMINFO_R_OK)
1007 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1008 if (ret != PMINFO_R_OK) {
1009 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1012 printf("installed_time: %d\n", installed_time);
1013 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1018 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1021 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1022 * @brief This API gets the launch mode of package from the package ID
1024 * @par This API is for package-manager client application
1025 * @par Sync (or) Async : Synchronous API
1027 * @param[in] handle pointer to package info handle
1028 * @param[out] mode pointer to hold launch mode of package
1029 * @return 0 if success, error code(<0) if fail
1030 * @retval PMINFO_R_OK success
1031 * @retval PMINFO_R_EINVAL invalid argument
1032 * @retval PMINFO_R_ERROR internal error
1033 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1034 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1035 * @see pkgmgrinfo_pkginfo_get_pkgid()
1036 * @see pkgmgrinfo_pkginfo_is_removable()
1038 static int get_pkg_launch_mode(const char *pkgid)
1041 char *launch_mode = NULL;
1042 pkgmgrinfo_pkginfo_h handle;
1043 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1044 if (ret != PMINFO_R_OK)
1046 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1047 if (ret != PMINFO_R_OK) {
1048 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1051 printf("launch mode: %s\n", mode);
1052 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1057 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1060 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1061 * @brief This API gets the store client id of package from the package ID
1063 * @par This API is for package-manager client application
1064 * @par Sync (or) Async : Synchronous API
1066 * @param[in] handle pointer to package info handle
1067 * @param[out] storeclientid pointer to hold store client id of package
1068 * @return 0 if success, error code(<0) if fail
1069 * @retval PMINFO_R_OK success
1070 * @retval PMINFO_R_EINVAL invalid argument
1071 * @retval PMINFO_R_ERROR internal error
1072 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1073 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1074 * @see pkgmgrinfo_pkginfo_get_pkgid()
1075 * @see pkgmgrinfo_pkginfo_is_removable()
1077 static int get_pkg_storeclientid(const char *pkgid)
1080 char *storeclientid = 0;
1081 pkgmgrinfo_pkginfo_h handle;
1082 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1083 if (ret != PMINFO_R_OK)
1085 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1086 if (ret != PMINFO_R_OK) {
1087 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1090 printf(store client id: %s\n", storeclientid);
1091 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1096 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1099 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1100 * @brief This API gets the main app id of package from the package ID
1102 * @par This API is for package-manager client application
1103 * @par Sync (or) Async : Synchronous API
1105 * @param[in] handle pointer to package info handle
1106 * @param[out] mainappid pointer to hold main app id of package
1107 * @return 0 if success, error code(<0) if fail
1108 * @retval PMINFO_R_OK success
1109 * @retval PMINFO_R_EINVAL invalid argument
1110 * @retval PMINFO_R_ERROR internal error
1111 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1112 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1113 * @see pkgmgrinfo_pkginfo_get_pkgid()
1114 * @see pkgmgrinfo_pkginfo_is_removable()
1116 static int get_pkg_mainappid(const char *pkgid)
1119 char *mainappid = 0;
1120 pkgmgrinfo_pkginfo_h handle;
1121 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1122 if (ret != PMINFO_R_OK)
1124 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1125 if (ret != PMINFO_R_OK) {
1126 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1129 printf(main app id: %s\n", mainappid);
1130 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1135 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1138 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1139 * @brief This API gets the url of package from the package ID
1141 * @par This API is for package-manager client application
1142 * @par Sync (or) Async : Synchronous API
1144 * @param[in] handle pointer to package info handle
1145 * @param[out] url pointer to hold url of package
1146 * @return 0 if success, error code(<0) if fail
1147 * @retval PMINFO_R_OK success
1148 * @retval PMINFO_R_EINVAL invalid argument
1149 * @retval PMINFO_R_ERROR internal error
1150 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1151 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1152 * @see pkgmgrinfo_pkginfo_get_pkgid()
1153 * @see pkgmgrinfo_pkginfo_is_removable()
1155 static int get_pkg_url(const char *pkgid)
1159 pkgmgrinfo_pkginfo_h handle;
1160 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1161 if (ret != PMINFO_R_OK)
1163 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1164 if (ret != PMINFO_R_OK) {
1165 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1168 printf("url : %s\n", url);
1169 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1174 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1177 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1178 * @brief This API gets the root path of package
1180 * @par Sync (or) Async : Synchronous API
1182 * @param[in] handle pointer to package info handle
1183 * @param[out] path pointer to hold root path of package
1184 * @return 0 if success, error code(<0) if fail
1185 * @retval PMINFO_R_OK success
1186 * @retval PMINFO_R_EINVAL invalid argument
1187 * @retval PMINFO_R_ERROR internal error
1189 static int get_root_path(const char *pkgid)
1193 pkgmgrinfo_pkginfo_h handle;
1194 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1195 if (ret != PMINFO_R_OK)
1198 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1199 if (ret != PMINFO_R_OK) {
1200 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1203 printf("path : %s\n", path);
1204 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1210 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1214 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1215 * @brief This API gets the csc path of package
1217 * @par Sync (or) Async : Synchronous API
1219 * @param[in] handle pointer to package info handle
1220 * @param[out] path pointer to hold csc path of package
1221 * @return 0 if success, error code(<0) if fail
1222 * @retval PMINFO_R_OK success
1223 * @retval PMINFO_R_EINVAL invalid argument
1224 * @retval PMINFO_R_ERROR internal error
1226 static int get_csc_path(const char *pkgid)
1230 pkgmgrinfo_pkginfo_h handle;
1231 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1232 if (ret != PMINFO_R_OK)
1235 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1236 if (ret != PMINFO_R_OK) {
1237 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1240 printf("path : %s\n", path);
1241 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1247 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1250 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1251 * @brief This API gets the support_mode of package
1253 * @par Sync (or) Async : Synchronous API
1255 * @param[in] handle pointer to package info handle
1256 * @param[out] support_mode pointer to hold support_mode of package
1257 * @return 0 if success, error code(<0) if fail
1258 * @retval PMINFO_R_OK success
1259 * @retval PMINFO_R_EINVAL invalid argument
1260 * @retval PMINFO_R_ERROR internal error
1262 static int get_support_mode(const char *pkgid)
1265 int support_mode = 0;
1266 pkgmgrinfo_pkginfo_h handle = NULL;
1267 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1268 if (ret != PMINFO_R_OK)
1271 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1272 if (ret != PMINFO_R_OK) {
1273 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1276 printf("support_mode : %s\n", support_mode);
1277 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1283 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1286 * @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)
1287 * @brief This API compare the cert information from given package id
1289 * @par This API is for package-manager client application
1290 * @par Sync (or) Async : Synchronous API
1292 * @param[in] lhs_package_id pointer to first package ID
1293 * @param[in] rhs_package_id pointer to second package ID
1294 * @param[out] compare_result pointer to the compare result.
1295 * @return 0 if success, error code(<0) if fail
1296 * @retval PMINFO_R_OK success
1297 * @retval PMINFO_R_EINVAL invalid argument
1298 * @retval PMINFO_R_ERROR internal error
1300 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1301 * @see pkgmgrinfo_pkginfo_get_pkgid()
1302 * @see pkgmgrinfo_pkginfo_is_removable()
1304 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1307 pkgmgrinfo_cert_compare_result_type_e result;
1309 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1310 if (ret != PMINFO_R_OK) {
1313 printf("result: %d\n", result);
1318 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);
1319 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);
1321 * @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)
1322 * @brief This API compare the cert information from given app id
1324 * @par This API is for package-manager client application
1325 * @par Sync (or) Async : Synchronous API
1327 * @param[in] lhs_app_id pointer to first app ID
1328 * @param[in] rhs_app_id pointer to second app 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_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1342 pkgmgrinfo_cert_compare_result_type_e result;
1344 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1345 if (ret != PMINFO_R_OK) {
1348 printf("result: %d\n", result);
1353 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);
1354 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);
1356 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1357 * @brief This API gets the package 'removable' value from the package ID
1359 * @par This API is for package-manager client application
1360 * @par Sync (or) Async : Synchronous API
1362 * @param[in] handle pointer to package info handle
1363 * @param[out] removable pointer to hold package removable value
1364 * @return 0 if success, error code(<0) if fail
1365 * @retval PMINFO_R_OK success
1366 * @retval PMINFO_R_EINVAL invalid argument
1367 * @retval PMINFO_R_ERROR internal error
1368 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1369 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1370 * @see pkgmgrinfo_pkginfo_get_pkgid()
1371 * @see pkgmgrinfo_pkginfo_is_readonly()
1373 static int get_pkg_removable(const char *pkgid)
1377 pkgmgrinfo_pkginfo_h handle;
1378 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1379 if (ret != PMINFO_R_OK)
1381 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1382 if (ret != PMINFO_R_OK) {
1383 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1386 printf("pkg removable: %d\n", removable);
1387 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1392 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1395 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1396 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1398 * @par This API is for package-manager client application
1399 * @par Sync (or) Async : Synchronous API
1401 * @param[in] handle pointer to package info handle
1402 * @param[out] movable pointer to hold package movable state
1403 * @return 0 if success, error code(<0) if fail
1404 * @retval PMINFO_R_OK success
1405 * @retval PMINFO_R_EINVAL invalid argument
1406 * @retval PMINFO_R_ERROR internal error
1407 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1408 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1409 * @see pkgmgrinfo_pkginfo_get_pkgid()
1411 static int get_pkg_movable(const char *pkgid)
1415 pkgmgrinfo_pkginfo_h handle;
1416 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1417 if (ret != PMINFO_R_OK)
1419 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1420 if (ret != PMINFO_R_OK) {
1421 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1424 printf("pkg movable: %d\n", movable);
1425 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1430 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1433 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1434 * @brief This API gets the package 'preload' value from the package ID
1436 * @par This API is for package-manager client application
1437 * @par Sync (or) Async : Synchronous API
1439 * @param[in] handle pointer to package info handle
1440 * @param[out] preload pointer to hold package preload value
1441 * @return 0 if success, error code(<0) if fail
1442 * @retval PMINFO_R_OK success
1443 * @retval PMINFO_R_EINVAL invalid argument
1444 * @retval PMINFO_R_ERROR internal error
1445 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1446 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1447 * @see pkgmgrinfo_pkginfo_get_pkgid()
1448 * @see pkgmgrinfo_pkginfo_is_readonly()
1450 static int get_pkg_preload(const char *pkgid)
1454 pkgmgrinfo_pkginfo_h handle;
1455 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1456 if (ret != PMINFO_R_OK)
1458 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1459 if (ret != PMINFO_R_OK) {
1460 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1463 printf("pkg preload: %d\n", preload);
1464 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1469 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1472 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1473 * @brief This API gets the value for given handle is system or not
1475 * @par This API is for package-manager client application
1476 * @par Sync (or) Async : Synchronous API
1478 * @param[in] handle pointer to package info handle
1479 * @param[out] system pointer to hold system is or not
1480 * @return 0 if success, error code(<0) if fail
1481 * @retval PMINFO_R_OK success
1482 * @retval PMINFO_R_EINVAL invalid argument
1483 * @retval PMINFO_R_ERROR internal error
1484 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1485 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1486 * @see pkgmgrinfo_pkginfo_get_pkgid()
1487 * @see pkgmgrinfo_pkginfo_is_readonly()
1489 static int get_pkg_system(const char *pkgid)
1492 bool system = false;
1493 pkgmgrinfo_pkginfo_h handle = NULL;
1494 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1495 if (ret != PMINFO_R_OK)
1497 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1498 if (ret != PMINFO_R_OK) {
1499 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1502 printf("pkg system: %d\n", system);
1503 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1508 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1511 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1512 * @brief This API gets the package 'readonly' value from the package ID
1514 * @par This API is for package-manager client application
1515 * @par Sync (or) Async : Synchronous API
1517 * @param[in] handle pointer to package info handle
1518 * @param[out] readonly pointer to hold package readonly value
1519 * @return 0 if success, error code(<0) if fail
1520 * @retval PMINFO_R_OK success
1521 * @retval PMINFO_R_EINVAL invalid argument
1522 * @retval PMINFO_R_ERROR internal error
1523 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1524 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1525 * @see pkgmgrinfo_pkginfo_get_pkgid()
1526 * @see pkgmgrinfo_pkginfo_is_removable()
1528 static int get_pkg_readonly(const char *pkgid)
1532 pkgmgrinfo_pkginfo_h handle;
1533 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1534 if (ret != PMINFO_R_OK)
1536 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1537 if (ret != PMINFO_R_OK) {
1538 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1541 printf("pkg readonly: %d\n", readonly);
1542 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1547 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1551 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1552 * @brief This API gets the package 'upate' value from the package ID
1554 * @par This API is for package-manager client application
1555 * @par Sync (or) Async : Synchronous API
1557 * @param[in] handle pointer to package info handle
1558 * @param[out] update pointer to hold package update value
1559 * @return 0 if success, error code(<0) if fail
1560 * @retval PMINFO_R_OK success
1561 * @retval PMINFO_R_EINVAL invalid argument
1562 * @retval PMINFO_R_ERROR internal error
1563 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1564 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1565 * @see pkgmgrinfo_pkginfo_get_pkgid()
1567 static int get_pkg_update(const char *pkgid)
1571 pkgmgrinfo_pkginfo_h handle;
1572 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1573 if (ret != PMINFO_R_OK)
1575 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1576 if (ret != PMINFO_R_OK) {
1577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1580 printf("pkg update: %d\n", update);
1581 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1586 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1589 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1590 * @brief This API gets the package 'support_disable' value from the package ID
1592 * @par This API is for package-manager client application
1593 * @par Sync (or) Async : Synchronous API
1595 * @param[in] handle pointer to package info handle
1596 * @param[out] support_disable pointer to hold package support_disable value
1597 * @return 0 if success, error code(<0) if fail
1598 * @retval PMINFO_R_OK success
1599 * @retval PMINFO_R_EINVAL invalid argument
1600 * @retval PMINFO_R_ERROR internal error
1601 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1602 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1603 * @see pkgmgrinfo_pkginfo_get_pkgid()
1605 static int get_pkg_support_disable(const char *pkgid)
1608 bool support_disable;
1609 pkgmgrinfo_pkginfo_h handle = NULL;
1610 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1611 if (ret != PMINFO_R_OK)
1613 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1614 if (ret != PMINFO_R_OK) {
1615 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1618 printf("pkg support_disable: %d\n", support_disable);
1619 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1624 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1627 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1628 * @brief This API gets whethere the given package is global package or user package
1630 * @par This API is for package-manager client application
1631 * @par Sync (or) Async : Synchronous API
1633 * @param[in] handle pointer to package info handle
1634 * @param[in] global pointer to hold package global value
1635 * @return 0 if success, error code(<0) if fail
1636 * @retval PMINFO_R_OK success
1637 * @retval PMINFO_R_EINVAL invalid argument
1638 * @retval PMINFO_R_ERROR internal error
1639 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1640 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1641 * @see pkgmgrinfo_pkginfo_get_pkgid()
1642 static int get_pkg_support_disable(const char *pkgid)
1646 pkgmgrinfo_pkginfo_h handle = NULL;
1647 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1648 if (ret != PMINFO_R_OK)
1650 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1651 if (ret != PMINFO_R_OK) {
1652 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1655 printf("pkg is_global: %d\n", global);
1656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1661 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1664 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1665 * @brief This API gets the package 'accessible' value from the package ID
1667 * @par This API is for package-manager client application
1668 * @par Sync (or) Async : Synchronous API
1670 * @param[in] handle pointer to package info handle
1671 * @param[out] accessible pointer to hold package accessible value
1672 * @return 0 if success, error code(<0) if fail
1673 * @retval PMINFO_R_OK success
1674 * @retval PMINFO_R_EINVAL invalid argument
1675 * @retval PMINFO_R_ERROR internal error
1676 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1677 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1678 * @see pkgmgrinfo_pkginfo_get_pkgid()
1679 * @see pkgmgrinfo_pkginfo_is_readonly()
1681 static int get_pkg_accessible(const char *pkgid)
1685 pkgmgrinfo_pkginfo_h handle;
1686 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1687 if (ret != PMINFO_R_OK)
1689 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1690 if (ret != PMINFO_R_OK) {
1691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1694 printf("pkg accessible: %d\n", accessible);
1695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1700 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1703 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1704 * @brief This API destroys the package information handle freeing up all the resources
1706 * @par This API is for package-manager client application
1707 * @par Sync (or) Async : Synchronous API
1709 * @param[in] handle pointer to the package info handle
1710 * @return 0 if success, error code(<0) if fail
1711 * @retval PMINFO_R_OK success
1712 * @retval PMINFO_R_EINVAL invalid argument
1713 * @retval PMINFO_R_ERROR internal error
1714 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1716 * @see pkgmgrinfo_pkginfo_get_pkgid()
1717 * @see pkgmgrinfo_pkginfo_is_removable()
1719 static int get_pkg_type(const char *pkgid)
1723 pkgmgrinfo_pkginfo_h handle;
1724 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1725 if (ret != PMINFO_R_OK)
1727 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1728 if (ret != PMINFO_R_OK) {
1729 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1732 printf("pkgtype: %s\n", type);
1733 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1738 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1741 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1742 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1743 The query will search the entire package information collected from the manifest file of all the installed packages
1745 * @par This API is for package-manager client application
1746 * @par Sync (or) Async : Synchronous API
1748 * @param[out] handle pointer to the package info filter handle.
1749 * @return 0 if success, error code(<0) if fail
1750 * @retval PMINFO_R_OK success
1751 * @retval PMINFO_R_EINVAL invalid argument
1752 * @retval PMINFO_R_ERROR internal error
1754 * @post pkgmgrinfo_pkginfo_filter_destroy()
1755 * @see pkgmgrinfo_pkginfo_filter_count()
1756 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1758 static int get_tpk_pkg_count()
1762 pkgmgrinfo_pkginfo_filter_h handle;
1763 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1764 if (ret != PMINFO_R_OK)
1766 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1767 if (ret != PMINFO_R_OK) {
1768 pkgmgrinfo_pkginfo_filter_destroy(handle);
1771 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1772 if (ret != PMINFO_R_OK) {
1773 pkgmgrinfo_pkginfo_filter_destroy(handle);
1776 printf("No of tpk pkgs: %d\n", count);
1777 pkgmgrinfo_pkginfo_filter_destroy(handle);
1782 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1785 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1786 * @brief This API destroys the package information filter handle freeing up all the resources
1788 * @par This API is for package-manager client application
1789 * @par Sync (or) Async : Synchronous API
1791 * @param[in] handle pointer to the package info filter handle.
1792 * @return 0 if success, error code(<0) if fail
1793 * @retval PMINFO_R_OK success
1794 * @retval PMINFO_R_EINVAL invalid argument
1795 * @retval PMINFO_R_ERROR internal error
1796 * @pre pkgmgrinfo_pkginfo_filter_create()
1798 * @see pkgmgrinfo_pkginfo_filter_count()
1799 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1801 static int get_tpk_pkg_count()
1805 pkgmgrinfo_pkginfo_filter_h handle;
1806 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1807 if (ret != PMINFO_R_OK)
1809 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1810 if (ret != PMINFO_R_OK) {
1811 pkgmgrinfo_pkginfo_filter_destroy(handle);
1814 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1815 if (ret != PMINFO_R_OK) {
1816 pkgmgrinfo_pkginfo_filter_destroy(handle);
1819 printf("No of tpk pkgs: %d\n", count);
1820 pkgmgrinfo_pkginfo_filter_destroy(handle);
1825 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1828 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1829 * @brief This API adds a boolean filter property to the filter handle
1831 * @par This API is for package-manager client application
1832 * @par Sync (or) Async : Synchronous API
1834 * @param[in] handle pointer to the package info filter handle.
1835 * @param[in] property boolean property name.
1836 * @param[in] value value corresponding to the property.
1837 * @return 0 if success, error code(<0) if fail
1838 * @retval PMINFO_R_OK success
1839 * @retval PMINFO_R_EINVAL invalid argument
1840 * @retval PMINFO_R_ERROR internal error
1841 * @pre pkgmgrinfo_pkginfo_filter_create()
1842 * @post pkgmgrinfo_pkginfo_filter_destroy()
1843 * @see pkgmgrinfo_pkginfo_filter_count()
1844 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1846 static int get_preload_pkg_count()
1850 pkgmgrinfo_pkginfo_filter_h handle;
1851 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1852 if (ret != PMINFO_R_OK)
1854 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1855 if (ret != PMINFO_R_OK) {
1856 pkgmgrinfo_pkginfo_filter_destroy(handle);
1859 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1860 if (ret != PMINFO_R_OK) {
1861 pkgmgrinfo_pkginfo_filter_destroy(handle);
1864 printf("No of preload pkgs: %d\n", count);
1865 pkgmgrinfo_pkginfo_filter_destroy(handle);
1870 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1871 const char *property, const bool value);
1874 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1875 * @brief This API adds an integer filter property to the filter handle
1877 * @par This API is for package-manager client application
1878 * @par Sync (or) Async : Synchronous API
1880 * @param[in] handle pointer to the package info filter handle.
1881 * @param[in] property integer property name.
1882 * @param[in] value value corresponding to the property.
1883 * @return 0 if success, error code(<0) if fail
1884 * @retval PMINFO_R_OK success
1885 * @retval PMINFO_R_EINVAL invalid argument
1886 * @retval PMINFO_R_ERROR internal error
1887 * @pre pkgmgrinfo_pkginfo_filter_create()
1888 * @post pkgmgrinfo_pkginfo_filter_destroy()
1889 * @see pkgmgrinfo_pkginfo_filter_count()
1890 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1892 static int get_pkg_count()
1896 pkgmgrinfo_pkginfo_filter_h handle;
1897 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1898 if (ret != PMINFO_R_OK)
1900 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1901 if (ret != PMINFO_R_OK) {
1902 pkgmgrinfo_pkginfo_filter_destroy(handle);
1905 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1906 if (ret != PMINFO_R_OK) {
1907 pkgmgrinfo_pkginfo_filter_destroy(handle);
1910 printf("No of preload pkgs: %d\n", count);
1911 pkgmgrinfo_pkginfo_filter_destroy(handle);
1916 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1917 const char *property, const int value);
1920 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1921 * @brief This API adds a string filter property to the filter handle
1923 * @par This API is for package-manager client application
1924 * @par Sync (or) Async : Synchronous API
1926 * @param[in] handle pointer to the package info filter handle.
1927 * @param[in] property string property name.
1928 * @param[in] value value corresponding to the property.
1929 * @return 0 if success, error code(<0) if fail
1930 * @retval PMINFO_R_OK success
1931 * @retval PMINFO_R_EINVAL invalid argument
1932 * @retval PMINFO_R_ERROR internal error
1933 * @pre pkgmgrinfo_pkginfo_filter_create()
1934 * @post pkgmgrinfo_pkginfo_filter_destroy()
1935 * @see pkgmgrinfo_pkginfo_filter_count()
1936 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1938 static int get_tpk_pkg_count()
1942 pkgmgrinfo_pkginfo_filter_h handle;
1943 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1944 if (ret != PMINFO_R_OK)
1946 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1947 if (ret != PMINFO_R_OK) {
1948 pkgmgrinfo_pkginfo_filter_destroy(handle);
1951 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1952 if (ret != PMINFO_R_OK) {
1953 pkgmgrinfo_pkginfo_filter_destroy(handle);
1956 printf("No of tpk pkgs: %d\n", count);
1957 pkgmgrinfo_pkginfo_filter_destroy(handle);
1962 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1963 const char *property, const char *value);
1966 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1967 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1969 * @par This API is for package-manager client application
1970 * @par Sync (or) Async : Synchronous API
1972 * @param[in] handle pointer to the package info filter handle.
1973 * @param[in] pkg_cb callback function.
1974 * @param[in] user_data user data to be passed to the callback function
1975 * @return 0 if success, error code(<0) if fail
1976 * @retval PMINFO_R_OK success
1977 * @retval PMINFO_R_EINVAL invalid argument
1978 * @retval PMINFO_R_ERROR internal error
1979 * @pre pkgmgrinfo_pkginfo_filter_create()
1980 * @post pkgmgrinfo_pkginfo_filter_destroy()
1981 * @see pkgmgrinfo_pkginfo_filter_count()
1983 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1986 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1987 printf("pkg id : %s\n", pkgid);
1991 static int get_tpk_pkg_list()
1994 pkgmgrinfo_pkginfo_filter_h handle;
1995 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1996 if (ret != PMINFO_R_OK)
1998 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1999 if (ret != PMINFO_R_OK) {
2000 pkgmgrinfo_pkginfo_filter_destroy(handle);
2003 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2004 if (ret != PMINFO_R_OK) {
2005 pkgmgrinfo_pkginfo_filter_destroy(handle);
2008 pkgmgrinfo_pkginfo_filter_destroy(handle);
2013 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2014 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2015 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2016 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2019 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2020 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2021 * @brief This API counts the package that satisfy the filter conditions
2023 * @par This API is for package-manager client application
2024 * @par Sync (or) Async : Synchronous API
2026 * @param[in] handle pointer to the package info filter handle.
2027 * @param[in] count pointer to store the count value.
2028 * @param[in] uid the addressee user id of the instruction
2029 * @return 0 if success, error code(<0) if fail
2030 * @retval PMINFO_R_OK success
2031 * @retval PMINFO_R_EINVAL invalid argument
2032 * @retval PMINFO_R_ERROR internal error
2033 * @pre pkgmgrinfo_pkginfo_filter_create()
2034 * @post pkgmgrinfo_pkginfo_filter_destroy()
2035 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2037 static int get_tpk_pkg_count()
2041 pkgmgrinfo_pkginfo_filter_h handle;
2042 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2043 if (ret != PMINFO_R_OK)
2045 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2046 if (ret != PMINFO_R_OK) {
2047 pkgmgrinfo_pkginfo_filter_destroy(handle);
2050 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2051 if (ret != PMINFO_R_OK) {
2052 pkgmgrinfo_pkginfo_filter_destroy(handle);
2055 printf("No of tpk pkgs: %d\n", count);
2056 pkgmgrinfo_pkginfo_filter_destroy(handle);
2061 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2062 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2064 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2065 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2066 * @brief This API gets the list of privilege for a particular package
2068 * @par This API is for package-manager client application
2069 * @par Sync (or) Async : Synchronous API
2070 * @param[in] handle pointer to the package info handle.
2071 * @param[in] privilege_func callback function for list
2072 * @param[in] user_data user data to be passed to callback function
2073 * @return 0 if success, error code(<0) if fail
2074 * @retval PMINFO_R_OK success
2075 * @retval PMINFO_R_EINVAL invalid argument
2076 * @retval PMINFO_R_ERROR internal error
2077 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2078 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2080 int privilege_func(const char *name, void *user_data)
2082 if (strcmp(name, (char *)user_data) == 0)
2088 static int list_privilege(const char *package, char *privilege)
2091 pkgmgrinfo_pkginfo_h handle;
2092 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2093 if (ret != PMINFO_R_OK)
2095 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2096 if (ret != PMINFO_R_OK) {
2097 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2100 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2105 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2106 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2108 /* TODO: add doxygen comment here */
2109 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2112 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2113 * @brief This API copy the application information handle
2115 * @par This API is for package-manager client application
2116 * @par Sync (or) Async : Synchronous API
2118 * @param[in] handle pointer to the package info handle.
2119 * @param[out] handle pointer to the package info handle.
2120 * @return 0 if success, error code(<0) if fail
2121 * @retval PMINFO_R_OK success
2122 * @retval PMINFO_R_EINVAL invalid argument
2123 * @retval PMINFO_R_ERROR internal error
2125 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2127 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2131 pkgmgrinfo_pkginfo_h clone;
2133 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2134 if (ret != PMINFO_R_OK)
2138 printf("package: %s\n", clone->package);
2139 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2144 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2148 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2149 pkgmgrinfo_app_list_cb app_func, void *user_data)
2150 * @brief This API gets list of installed applications for a particular package
2152 * @par This API is for package-manager client application
2153 * @par Sync (or) Async : Synchronous API
2154 * @param[in] handle package info handle
2155 * @param[in] component application component
2156 * @param[in] app_func iteration function for list
2157 * @param[in] user_data user data to be passed to callback function
2158 * @return 0 if success, error code(<0) if fail
2159 * @retval PMINFO_R_OK success
2160 * @retval PMINFO_R_EINVAL invalid argument
2161 * @retval PMINFO_R_ERROR internal error
2162 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2163 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2165 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2168 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2169 printf("appid : %s\n", appid);
2173 static int list_apps(const char *pkgid)
2176 pkgmgrinfo_pkginfo_h handle;
2177 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2178 if (ret != PMINFO_R_OK)
2180 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2181 if (ret != PMINFO_R_OK) {
2182 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2185 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2190 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2191 pkgmgrinfo_app_list_cb app_func, void *user_data);
2192 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2193 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2196 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2197 * @brief This API gets list of installed applications from all packages with minimum informaion.
2199 * @par This API is for package-manager client application
2200 * @par Sync (or) Async : Synchronous API
2201 * @param[in] app_func iteration function for list
2202 * @param[in] user_data user data to be passed to callback function
2203 * @return 0 if success, error code(<0) if fail
2204 * @retval PMINFO_R_OK success
2205 * @retval PMINFO_R_EINVAL invalid argument
2206 * @retval PMINFO_R_ERROR internal error
2210 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2212 char *pkgid1 = NULL;
2213 char *pkgid2 = NULL;
2214 pkgid1 = (char *)user_data;
2215 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2216 if (strcmp(pkgid1, pkgid2) == 0) {
2223 static int list_apps()
2226 char *name = "helloworld";
2227 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2228 if (ret != PMINFO_R_OK) {
2235 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2236 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2239 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2240 * @brief This API gets list of installed applications from all packages.
2242 * @par This API is for package-manager client application
2243 * @par Sync (or) Async : Synchronous API
2244 * @param[in] app_func iteration function for list
2245 * @param[in] user_data user data to be passed to callback function
2246 * @return 0 if success, error code(<0) if fail
2247 * @retval PMINFO_R_OK success
2248 * @retval PMINFO_R_EINVAL invalid argument
2249 * @retval PMINFO_R_ERROR internal error
2253 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2255 char *pkgid1 = NULL;
2256 char *pkgid2 = NULL;
2257 pkgid1 = (char *)user_data;
2258 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2259 if (strcmp(pkgid1, pkgid2) == 0) {
2266 static int list_apps()
2269 char *name = "helloworld";
2270 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2271 if (ret != PMINFO_R_OK) {
2278 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2279 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2282 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2283 * @brief This API creates the disabled application information handle from db
2285 * @par This API is for package-manager client application
2286 * @par Sync (or) Async : Synchronous API
2288 * @param[in] appid pointer to appid
2289 * @param[out] handle pointer to the application info handle.
2290 * @return 0 if success, error code(<0) if fail
2291 * @retval PMINFO_R_OK success
2292 * @retval PMINFO_R_EINVAL invalid argument
2293 * @retval PMINFO_R_ERROR internal error
2295 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2296 * @see pkgmgrinfo_appinfo_get_pkgid()
2297 * @see pkgmgrinfo_appinfo_is_multiple()
2299 static int get_disabled_app_type(const char *appid)
2303 pkgmgrinfo_appinfo_h handle;
2304 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2305 if (ret != PMINFO_R_OK)
2307 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2308 if (ret != PMINFO_R_OK) {
2309 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2312 printf("apptype: %s\n", type);
2313 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2318 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2319 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2322 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2323 * @brief This API creates the application information handle from db
2325 * @par This API is for package-manager client application
2326 * @par Sync (or) Async : Synchronous API
2328 * @param[in] appid pointer to appid
2329 * @param[out] handle pointer to the application info handle.
2330 * @return 0 if success, error code(<0) if fail
2331 * @retval PMINFO_R_OK success
2332 * @retval PMINFO_R_EINVAL invalid argument
2333 * @retval PMINFO_R_ERROR internal error
2335 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2336 * @see pkgmgrinfo_appinfo_get_pkgid()
2337 * @see pkgmgrinfo_appinfo_is_multiple()
2339 static int get_app_type(const char *appid)
2343 pkgmgrinfo_appinfo_h handle;
2344 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2345 if (ret != PMINFO_R_OK)
2347 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2348 if (ret != PMINFO_R_OK) {
2349 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2352 printf("apptype: %s\n", type);
2353 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2358 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2359 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2362 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2363 * @brief This API creates the application information handle from db regardless of its disable or storage status
2365 * @par This API is for package-manager client application
2366 * @par Sync (or) Async : Synchronous API
2368 * @param[in] appid pointer to appid
2369 * @param[out] handle pointer to the application info handle.
2370 * @return 0 if success, error code(<0) if fail
2371 * @retval PMINFO_R_OK success
2372 * @retval PMINFO_R_EINVAL invalid argument
2373 * @retval PMINFO_R_ERROR internal error
2375 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2376 * @see pkgmgrinfo_appinfo_get_pkgid()
2377 * @see pkgmgrinfo_appinfo_is_multiple()
2379 static int get_app_type(const char *appid)
2383 pkgmgrinfo_appinfo_h handle;
2384 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2385 if (ret != PMINFO_R_OK)
2387 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2388 if (ret != PMINFO_R_OK) {
2389 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2392 printf("apptype: %s\n", type);
2393 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2398 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2399 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2402 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2403 * @brief This API gets the application ID
2405 * @par This API is for package-manager client application
2406 * @par Sync (or) Async : Synchronous API
2408 * @param[in] handle pointer to the application info handle.
2409 * @param[out] appid pointer to hold appid
2410 * @return 0 if success, error code(<0) if fail
2411 * @retval PMINFO_R_OK success
2412 * @retval PMINFO_R_EINVAL invalid argument
2413 * @retval PMINFO_R_ERROR internal error
2414 * @pre pkgmgrinfo_appinfo_get_appinfo()
2415 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2416 * @see pkgmgrinfo_appinfo_get_pkgid()
2417 * @see pkgmgrinfo_appinfo_is_multiple()
2419 static int get_app_id(const char *appid)
2422 char *app_id = NULL;
2423 pkgmgrinfo_appinfo_h handle;
2424 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2425 if (ret != PMINFO_R_OK)
2427 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2428 if (ret != PMINFO_R_OK) {
2429 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2432 printf("app id: %s\n", app_id);
2433 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2438 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2441 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2442 * @brief This API gets the package name of the application
2444 * @par This API is for package-manager client application
2445 * @par Sync (or) Async : Synchronous API
2447 * @param[in] handle pointer to the application info handle.
2448 * @param[out] pkg_name pointer to hold package name
2449 * @return 0 if success, error code(<0) if fail
2450 * @retval PMINFO_R_OK success
2451 * @retval PMINFO_R_EINVAL invalid argument
2452 * @retval PMINFO_R_ERROR internal error
2453 * @pre pkgmgrinfo_appinfo_get_appinfo()
2454 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2455 * @see pkgmgrinfo_appinfo_get_appid()
2456 * @see pkgmgrinfo_appinfo_is_multiple()
2458 static int get_app_pkgname(const char *appid)
2461 char *pkgname = NULL;
2462 pkgmgrinfo_appinfo_h handle;
2463 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2464 if (ret != PMINFO_R_OK)
2466 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2467 if (ret != PMINFO_R_OK) {
2468 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2471 printf("pkg name: %s\n", pkgname);
2472 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2477 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2480 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2481 * @brief This API gets the package id of the application
2483 * @par This API is for package-manager client application
2484 * @par Sync (or) Async : Synchronous API
2486 * @param[in] handle pointer to the application info handle.
2487 * @param[out] pkgid pointer to hold package id
2488 * @return 0 if success, error code(<0) if fail
2489 * @retval PMINFO_R_OK success
2490 * @retval PMINFO_R_EINVAL invalid argument
2491 * @retval PMINFO_R_ERROR internal error
2492 * @pre pkgmgrinfo_appinfo_get_appinfo()
2493 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2494 * @see pkgmgrinfo_appinfo_get_appid()
2495 * @see pkgmgrinfo_appinfo_is_multiple()
2497 static int get_app_pkgid(const char *appid)
2501 pkgmgrinfo_appinfo_h handle;
2502 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2503 if (ret != PMINFO_R_OK)
2505 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2506 if (ret != PMINFO_R_OK) {
2507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2510 printf("pkg id: %s\n", pkgid);
2511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2516 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2519 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2520 * @brief This API gets the package type of the application
2522 * @par This API is for package-manager client application
2523 * @par Sync (or) Async : Synchronous API
2525 * @param[in] handle pointer to the application info handle.
2526 * @param[out] pkgtype pointer to hold package type
2527 * @return 0 if success, error code(<0) if fail
2528 * @retval PMINFO_R_OK success
2529 * @retval PMINFO_R_EINVAL invalid argument
2530 * @retval PMINFO_R_ERROR internal error
2531 * @pre pkgmgrinfo_appinfo_get_appinfo()
2532 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2533 * @see pkgmgrinfo_appinfo_get_appid()
2534 * @see pkgmgrinfo_appinfo_is_multiple()
2536 static int get_app_pkgtype(const char *appid)
2539 char *pkgtype = NULL;
2540 pkgmgrinfo_appinfo_h handle = NULL;
2541 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2542 if (ret != PMINFO_R_OK)
2544 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2545 if (ret != PMINFO_R_OK) {
2546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2549 printf("pkgtype: %s\n", pkgtype);
2550 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2555 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2558 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2559 * @brief This API gets the executable name of the application
2561 * @par This API is for package-manager client application
2562 * @par Sync (or) Async : Synchronous API
2564 * @param[in] handle pointer to the application info handle.
2565 * @param[out] exec pointer to hold app exec name
2566 * @return 0 if success, error code(<0) if fail
2567 * @retval PMINFO_R_OK success
2568 * @retval PMINFO_R_EINVAL invalid argument
2569 * @retval PMINFO_R_ERROR internal error
2570 * @pre pkgmgrinfo_appinfo_get_appinfo()
2571 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2572 * @see pkgmgrinfo_appinfo_get_appid()
2573 * @see pkgmgrinfo_appinfo_is_multiple()
2575 static int get_app_exec(const char *appid)
2579 pkgmgrinfo_appinfo_h handle;
2580 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2581 if (ret != PMINFO_R_OK)
2583 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2584 if (ret != PMINFO_R_OK) {
2585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2588 printf("exec name: %s\n", exec);
2589 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2594 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2597 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2598 * @brief This API gets the icon name of the application
2600 * @par This API is for package-manager client application
2601 * @par Sync (or) Async : Synchronous API
2603 * @param[in] handle pointer to the application info handle.
2604 * @param[out] icon pointer to hold app icon name
2605 * @return 0 if success, error code(<0) if fail
2606 * @retval PMINFO_R_OK success
2607 * @retval PMINFO_R_EINVAL invalid argument
2608 * @retval PMINFO_R_ERROR internal error
2609 * @pre pkgmgrinfo_appinfo_get_appinfo()
2610 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2611 * @see pkgmgrinfo_appinfo_get_appid()
2612 * @see pkgmgrinfo_appinfo_is_multiple()
2614 static int get_app_icon(const char *appid)
2618 pkgmgrinfo_appinfo_h handle;
2619 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2620 if (ret != PMINFO_R_OK)
2622 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2623 if (ret != PMINFO_R_OK) {
2624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2627 printf("icon name: %s\n", icon);
2628 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2633 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2636 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2637 * @brief This API gets the label of the application
2639 * @par This API is for package-manager client application
2640 * @par Sync (or) Async : Synchronous API
2642 * @param[in] handle pointer to the application info handle.
2643 * @param[out] label pointer to hold app label
2644 * @return 0 if success, error code(<0) if fail
2645 * @retval PMINFO_R_OK success
2646 * @retval PMINFO_R_EINVAL invalid argument
2647 * @retval PMINFO_R_ERROR internal error
2648 * @pre pkgmgrinfo_appinfo_get_appinfo()
2649 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2650 * @see pkgmgrinfo_appinfo_get_appid()
2651 * @see pkgmgrinfo_appinfo_is_multiple()
2653 static int get_app_label(const char *appid)
2657 pkgmgrinfo_appinfo_h handle;
2658 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2659 if (ret != PMINFO_R_OK)
2661 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2662 if (ret != PMINFO_R_OK) {
2663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2666 printf("label : %s\n", label);
2667 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2672 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2675 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2676 * @brief This API gets exactly matched label by given appid and locale
2678 * @par This API is for package-manager client application
2679 * @par Sync (or) Async : Synchronous API
2681 * @param[in] appid pointer to appid
2682 * @param[in] locale pointer to locale
2683 * @param[out] label pointer to hold app label
2684 * @return 0 if success, error code(<0) if fail
2685 * @retval PMINFO_R_OK success
2686 * @retval PMINFO_R_EINVAL invalid argument
2687 * @retval PMINFO_R_ERROR internal error
2689 static int get_localed_label(const char *appid, const char *locale)
2694 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2695 if (ret != PMINFO_R_OK)
2698 printf("localed label: %s\n", label);
2706 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2707 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2710 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2711 * @brief This API gets metadata value by given metadata key
2713 * @par This API is for package-manager client application
2714 * @par Sync (or) Async : Synchronous API
2716 * @param[in] handle pointer to the application info handle
2717 * @param[in] metadata_key metadata key
2718 * @param[out] metadata_value pointer to hold metadata value
2719 * @return 0 if success, error code(<0) if fail
2720 * @retval PMINFO_R_OK success
2721 * @retval PMINFO_R_EINVAL invalid argument
2723 static int get_metadata_value(const char *appid, const char *metadata_key)
2726 pkgmgrinfo_appinfo_h handle = NULL;
2727 char *metadata_value = NULL;
2729 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2730 if (ret != PMINFO_R_OK)
2733 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2734 if (ret != PMINFO_R_OK) {
2735 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2739 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2744 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2747 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2748 * @brief This API gets the component of the application
2750 * @par This API is for package-manager client application
2751 * @par Sync (or) Async : Synchronous API
2753 * @param[in] handle pointer to the application info handle.
2754 * @param[out] component pointer to hold app component
2755 * @return 0 if success, error code(<0) if fail
2756 * @retval PMINFO_R_OK success
2757 * @retval PMINFO_R_EINVAL invalid argument
2758 * @retval PMINFO_R_ERROR internal error
2759 * @pre pkgmgrinfo_appinfo_get_appinfo()
2760 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2761 * @see pkgmgrinfo_appinfo_get_appid()
2762 * @see pkgmgrinfo_appinfo_is_multiple()
2764 static int get_app_component(const char *appid)
2767 pkgmgrinfo_app_component component;
2768 pkgmgrinfo_appinfo_h handle;
2769 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2770 if (ret != PMINFO_R_OK)
2772 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2773 if (ret != PMINFO_R_OK) {
2774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2777 printf("component : %s\n", component);
2778 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2783 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2786 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2787 * @brief This API gets the apptype of the application
2789 * @par This API is for package-manager client application
2790 * @par Sync (or) Async : Synchronous API
2792 * @param[in] handle pointer to the application info handle.
2793 * @param[out] app_type pointer to hold apptype
2794 * @return 0 if success, error code(<0) if fail
2795 * @retval PMINFO_R_OK success
2796 * @retval PMINFO_R_EINVAL invalid argument
2797 * @retval PMINFO_R_ERROR internal error
2798 * @pre pkgmgrinfo_appinfo_get_appinfo()
2799 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2800 * @see pkgmgrinfo_appinfo_get_appid()
2801 * @see pkgmgrinfo_appinfo_is_multiple()
2803 static int get_app_type(const char *appid)
2806 char *apptype = NULL;
2807 pkgmgrinfo_appinfo_h handle;
2808 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2809 if (ret != PMINFO_R_OK)
2811 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2812 if (ret != PMINFO_R_OK) {
2813 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2816 printf("apptype : %s\n", apptype);
2817 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2822 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2825 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2826 int *operation_count, char ***operation)
2827 * @brief This API gets the list of operation of the application
2829 * @par This API is for package-manager client application
2830 * @par Sync (or) Async : Synchronous API
2832 * @param[in] handle pointer to the appcontrol handle.
2833 * @param[out] operation_count pointer to hold number of operations
2834 * @param[out] operation pointer to hold list of operations
2835 * @return 0 if success, error code(<0) if fail
2836 * @retval PMINFO_R_OK success
2837 * @retval PMINFO_R_EINVAL invalid argument
2838 * @retval PMINFO_R_ERROR internal error
2839 * @pre pkgmgrinfo_appinfo_get_appinfo()
2840 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2841 * @see pkgmgrinfo_appinfo_get_uri()
2842 * @see pkgmgrinfo_appinfo_get_mime()
2844 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2849 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2850 for (i = 0; i < oc; i++) {
2851 if (strcmp(operation[i], (char *)user_data) == 0)
2858 static int check_operation(const char *appid, char *operation)
2861 pkgmgrinfo_appinfo_h handle;
2862 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2863 if (ret != PMINFO_R_OK)
2865 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2866 if (ret != PMINFO_R_OK) {
2867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2870 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2875 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2876 int *operation_count, char ***operation);
2879 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2880 int *uri_count, char ***uri)
2881 * @brief This API gets the list of uri of the application
2883 * @par This API is for package-manager client application
2884 * @par Sync (or) Async : Synchronous API
2886 * @param[in] handle pointer to the appcontrol handle.
2887 * @param[out] uri_count pointer to hold number of uris
2888 * @param[out] uri pointer to hold list of uris
2889 * @return 0 if success, error code(<0) if fail
2890 * @retval PMINFO_R_OK success
2891 * @retval PMINFO_R_EINVAL invalid argument
2892 * @retval PMINFO_R_ERROR internal error
2893 * @pre pkgmgrinfo_appinfo_get_appinfo()
2894 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2895 * @see pkgmgrinfo_appinfo_get_operation()
2896 * @see pkgmgrinfo_appinfo_get_mime()
2898 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2903 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2904 for (i = 0; i < uc; i++) {
2905 if (strcmp(uri[i], (char *)user_data) == 0)
2912 static int check_uri(const char *appid, char *uri)
2915 pkgmgrinfo_appinfo_h handle;
2916 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2917 if (ret != PMINFO_R_OK)
2919 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2920 if (ret != PMINFO_R_OK) {
2921 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2924 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2929 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2930 int *uri_count, char ***uri);
2933 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2934 int *mime_count, char ***mime)
2935 * @brief This API gets the list of mime of the application
2937 * @par This API is for package-manager client application
2938 * @par Sync (or) Async : Synchronous API
2940 * @param[in] handle pointer to the appcontrol handle.
2941 * @param[out] mime_count pointer to hold number of mimes
2942 * @param[out] mime pointer to hold list of mimes
2943 * @return 0 if success, error code(<0) if fail
2944 * @retval PMINFO_R_OK success
2945 * @retval PMINFO_R_EINVAL invalid argument
2946 * @retval PMINFO_R_ERROR internal error
2947 * @pre pkgmgrinfo_appinfo_get_appinfo()
2948 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2949 * @see pkgmgrinfo_appinfo_get_uri()
2950 * @see pkgmgrinfo_appinfo_get_operation()
2952 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2957 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2958 for (i = 0; i < mc; i++) {
2959 if (strcmp(mime[i], (char *)user_data) == 0)
2966 static int check_mime(const char *appid, char *mime)
2969 pkgmgrinfo_appinfo_h handle;
2970 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2971 if (ret != PMINFO_R_OK)
2973 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2974 if (ret != PMINFO_R_OK) {
2975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2978 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2983 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2984 int *mime_count, char ***mime);
2987 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2988 int *subapp_count, char ***subapp)
2989 * @brief This API gets the list of subapp of the application
2991 * @par This API is for package-manager client application
2992 * @par Sync (or) Async : Synchronous API
2994 * @param[in] handle pointer to the appcontrol handle.
2995 * @param[out] subapp_count pointer to hold number of subapp
2996 * @param[out] subapp pointer to hold list of subapp
2997 * @return 0 if success, error code(<0) if fail
2998 * @retval PMINFO_R_OK success
2999 * @retval PMINFO_R_EINVAL invalid argument
3000 * @retval PMINFO_R_ERROR internal error
3001 * @pre pkgmgrinfo_appinfo_get_appinfo()
3002 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3003 * @see pkgmgrinfo_appinfo_get_uri()
3004 * @see pkgmgrinfo_appinfo_get_operation()
3006 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3010 char **subapp = NULL;
3011 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3012 for (i = 0; i < sc; i++) {
3013 if (strcmp(subapp[i], (char *)user_data) == 0)
3020 static int check_subapp(const char *appid, char *subapp)
3023 pkgmgrinfo_appinfo_h handle = NULL;
3024 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3025 if (ret != PMINFO_R_OK)
3027 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3028 if (ret != PMINFO_R_OK) {
3029 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3037 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3038 int *subapp_count, char ***subapp);
3041 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3042 * @brief This API gets the notification icon of the application
3044 * @par This API is for package-manager client application
3045 * @par Sync (or) Async : Synchronous API
3047 * @param[in] handle pointer to the application info handle.
3048 * @param[out] path pointer to hold notification icon
3049 * @return 0 if success, error code(<0) if fail
3050 * @retval PMINFO_R_OK success
3051 * @retval PMINFO_R_EINVAL invalid argument
3052 * @retval PMINFO_R_ERROR internal error
3053 * @pre pkgmgrinfo_appinfo_get_appinfo()
3054 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3055 * @see pkgmgrinfo_appinfo_get_appid()
3056 * @see pkgmgrinfo_appinfo_is_multiple()
3058 static int get_app_notification_icon(const char *appid)
3061 char *notification_icon = NULL;
3062 pkgmgrinfo_appinfo_h handle;
3063 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3064 if (ret != PMINFO_R_OK)
3066 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3067 if (ret != PMINFO_R_OK) {
3068 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3071 printf("notification icon : %s\n", notification_icon);
3072 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3077 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3080 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3081 * @brief This API gets the setting icon of the application
3083 * @par This API is for package-manager client application
3084 * @par Sync (or) Async : Synchronous API
3086 * @param[in] handle pointer to the application info handle.
3087 * @param[out] path pointer to hold setting icon
3088 * @return 0 if success, error code(<0) if fail
3089 * @retval PMINFO_R_OK success
3090 * @retval PMINFO_R_EINVAL invalid argument
3091 * @retval PMINFO_R_ERROR internal error
3092 * @pre pkgmgrinfo_appinfo_get_appinfo()
3093 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3094 * @see pkgmgrinfo_appinfo_get_appid()
3095 * @see pkgmgrinfo_appinfo_is_multiple()
3097 static int get_app_setting_icon(const char *appid)
3100 char *setting_icon = NULL;
3101 pkgmgrinfo_appinfo_h handle;
3102 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3103 if (ret != PMINFO_R_OK)
3105 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3106 if (ret != PMINFO_R_OK) {
3107 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3110 printf("setting icon : %s\n", setting_icon);
3111 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3116 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3119 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3120 * @brief This API gets the type of recent image on app-tray
3122 * @par This API is for package-manager client application
3123 * @par Sync (or) Async : Synchronous API
3125 * @param[in] handle pointer to the application info handle.
3126 * @param[out] type pointer to hold image type
3127 * @return 0 if success, error code(<0) if fail
3128 * @retval PMINFO_R_OK success
3129 * @retval PMINFO_R_EINVAL invalid argument
3130 * @retval PMINFO_R_ERROR internal error
3131 * @pre pkgmgrinfo_appinfo_get_appinfo()
3132 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3133 * @see pkgmgrinfo_appinfo_get_appid()
3134 * @see pkgmgrinfo_appinfo_is_multiple()
3136 static int get_app_recent_image_type(const char *appid)
3139 pkgmgrinfo_app_recentimage type;
3140 pkgmgrinfo_appinfo_h handle;
3141 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3142 if (ret != PMINFO_R_OK)
3144 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3145 if (ret != PMINFO_R_OK) {
3146 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3149 printf("recent image type: %d\n", type);
3150 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3155 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3159 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3160 * @brief This API gets the preview image of application
3162 * @par Sync (or) Async : Synchronous API
3164 * @param[in] handle pointer to the application info handle.
3165 * @param[out] preview_img pointer to hold preview image path
3166 * @return 0 if success, error code(<0) if fail
3167 * @retval PMINFO_R_OK success
3168 * @retval PMINFO_R_EINVAL invalid argument
3169 * @retval PMINFO_R_ERROR internal error
3170 * @pre pkgmgrinfo_appinfo_get_appinfo()
3171 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3172 * @see pkgmgrinfo_appinfo_get_appid()
3174 static int get_app_previewimage(const char *appid)
3177 char *preview = NULL;
3178 pkgmgrinfo_appinfo_h handle = NULL;
3179 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3180 if (ret != PMINFO_R_OK)
3182 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3183 if (ret != PMINFO_R_OK) {
3184 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3187 printf("preview image path : %s\n", preview);
3188 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3193 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3197 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3198 * @brief This API gets the package permission type of the application
3200 * @par This API is for package-manager client application
3201 * @par Sync (or) Async : Synchronous API
3203 * @param[in] handle pointer to the application info handle.
3204 * @param[out] permission pointer to hold package permission
3205 * @return 0 if success, error code(<0) if fail
3206 * @retval PMINFO_R_OK success
3207 * @retval PMINFO_R_EINVAL invalid argument
3208 * @retval PMINFO_R_ERROR internal error
3209 * @pre pkgmgrinfo_appinfo_get_appinfo()
3210 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3211 * @see pkgmgrinfo_appinfo_get_appid()
3213 static int get_app_permission(const char *appid)
3216 pkgmgrinfo_permission_type permission = 0;
3217 pkgmgrinfo_appinfo_h handle;
3219 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3220 if (ret != PMINFO_R_OK)
3222 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3223 if (ret != PMINFO_R_OK) {
3224 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3227 printf("permission type: %d\n", permission);
3228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3233 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3236 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3237 * @brief This API gets the component_type
3239 * @par This API is for package-manager client application
3240 * @par Sync (or) Async : Synchronous API
3242 * @param[in] handle pointer to the application info handle.
3243 * @param[out] component_type pointer to hold component_type
3244 * @return 0 if success, error code(<0) if fail
3245 * @retval PMINFO_R_OK success
3246 * @retval PMINFO_R_EINVAL invalid argument
3247 * @retval PMINFO_R_ERROR internal error
3248 * @pre pkgmgrinfo_appinfo_get_appinfo()
3249 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3250 * @see pkgmgrinfo_appinfo_get_pkgid()
3251 * @see pkgmgrinfo_appinfo_is_multiple()
3253 static int get_component_type(const char *appid)
3256 char *component_type = NULL;
3257 pkgmgrinfo_appinfo_h handle;
3258 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3259 if (ret != PMINFO_R_OK)
3261 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3262 if (ret != PMINFO_R_OK) {
3263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3266 printf("component_type: %s\n", component_type);
3267 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3272 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3275 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3276 * @brief This API gets the application 'hwacceleration' value from the app ID
3278 * @par This API is for package-manager client application
3279 * @par Sync (or) Async : Synchronous API
3281 * @param[in] handle pointer to application info handle
3282 * @param[out] hwacceleration pointer to hold package hwacceleration value
3283 * @return 0 if success, error code(<0) if fail
3284 * @retval PMINFO_R_OK success
3285 * @retval PMINFO_R_EINVAL invalid argument
3286 * @retval PMINFO_R_ERROR internal error
3287 * @pre pkgmgrinfo_appinfo_get_appinfo()
3288 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3289 * @see pkgmgrinfo_appinfo_get_appid()
3290 * @see pkgmgrinfo_appinfo_is_multiple()
3292 static int get_app_hwacceleration(const char *appid)
3295 pkgmgrinfo_app_hwacceleration hwacceleration;
3296 pkgmgrinfo_appinfo_h handle;
3297 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3298 if (ret != PMINFO_R_OK)
3300 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3301 if (ret != PMINFO_R_OK) {
3302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3305 printf("app hwacceleration: %d\n", hwacceleration);
3306 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3311 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3314 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3315 * @brief This API gets the application 'screenreader' value from the app ID
3317 * @par This API is for package-manager client application
3318 * @par Sync (or) Async : Synchronous API
3320 * @param[in] handle pointer to application info handle
3321 * @param[out] screenreader pointer to hold package accessibility value
3322 * @return 0 if success, error code(<0) if fail
3323 * @retval PMINFO_R_OK success
3324 * @retval PMINFO_R_EINVAL invalid argument
3325 * @retval PMINFO_R_ERROR internal error
3326 * @pre pkgmgrinfo_appinfo_get_appinfo()
3327 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3328 * @see pkgmgrinfo_appinfo_get_appid()
3329 * @see pkgmgrinfo_appinfo_is_multiple()
3331 static int get_app_screenreader(const char *appid)
3334 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3335 pkgmgrinfo_appinfo_h handle = NULL;
3336 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3337 if (ret != PMINFO_R_OK)
3339 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3340 if (ret != PMINFO_R_OK) {
3341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3344 printf("app screenreader: %d\n", screenreader);
3345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3350 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3353 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3354 * @brief This API gets the application's landscape & portrait effect images
3356 * @par This API is for package-manager client application
3357 * @par Sync (or) Async : Synchronous API
3359 * @param[in] handle pointer to application info handle
3360 * @param[out] portrait_img contains portrait mode effect image
3361 * @param[out] landscape_img contains landscape mode effect image
3362 * @return 0 if success, error code(<0) if fail
3363 * @retval PMINFO_R_OK success
3364 * @retval PMINFO_R_EINVAL invalid argument
3365 * @retval PMINFO_R_ERROR internal error
3366 * @pre pkgmgrinfo_appinfo_get_appinfo()
3367 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3368 * @see pkgmgrinfo_appinfo_get_appid()
3369 * @see pkgmgrinfo_appinfo_is_nodisplay()
3371 static int get_app_effectimages(const char *appid)
3374 char *portraitimg = NULL;
3375 char *landscapeimg = NULL;
3376 pkgmgrinfo_appinfo_h handle;
3377 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3378 if (ret != PMINFO_R_OK)
3380 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3381 if (ret != PMINFO_R_OK) {
3382 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3385 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3386 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3391 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3394 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3395 * @brief This API gets the application's effect image type
3397 * @par This API is for package-manager client application
3398 * @par Sync (or) Async : Synchronous API
3400 * @param[in] handle pointer to application info handle
3401 * @param[out] effectimg_type contains effect image type
3402 * @return 0 if success, error code(<0) if fail
3403 * @retval PMINFO_R_OK success
3404 * @retval PMINFO_R_EINVAL invalid argument
3405 * @retval PMINFO_R_ERROR internal error
3406 * @pre pkgmgrinfo_appinfo_get_appinfo()
3407 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3408 * @see pkgmgrinfo_appinfo_get_appid()
3409 * @see pkgmgrinfo_appinfo_is_nodisplay()
3411 static int get_app_effectimage_type(const char *appid)
3414 char *effectimg_type = NULL;
3415 pkgmgrinfo_appinfo_h handle = NULL;
3416 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3417 if (ret != PMINFO_R_OK)
3419 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3420 if (ret != PMINFO_R_OK) {
3421 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3424 printf("app effect image type: %s\n", effectimg_type);
3425 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3430 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3433 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3434 * @brief This API gets the submode_mainid of the application
3436 * @par This API is for package-manager client application
3437 * @par Sync (or) Async : Synchronous API
3439 * @param[in] handle pointer to the application info handle.
3440 * @param[out] submode_mainid pointer to hold package name
3441 * @return 0 if success, error code(<0) if fail
3442 * @retval PMINFO_R_OK success
3443 * @retval PMINFO_R_EINVAL invalid argument
3444 * @retval PMINFO_R_ERROR internal error
3445 * @pre pkgmgrinfo_appinfo_get_appinfo()
3446 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3447 * @see pkgmgrinfo_appinfo_get_appid()
3448 * @see pkgmgrinfo_appinfo_is_multiple()
3450 static int get_app_submode_mainid(const char *appid)
3453 char *submode_mainid = NULL;
3454 pkgmgrinfo_appinfo_h handle = NULL;
3455 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3456 if (ret != PMINFO_R_OK)
3458 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3459 if (ret != PMINFO_R_OK) {
3460 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3463 printf("submode_mainid: %s\n", submode_mainid);
3464 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3469 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3472 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3473 * @brief This API gets the datacontrol info
3475 * @par This API is for package-manager client application
3476 * @par Sync (or) Async : Synchronous API
3478 * @param[in] providerid pointer to the providerid of dataconltrol.
3479 * @param[in] type pointer to the type of dataconltrol.
3480 * @param[out] appid pointer to hold appid, need to free after using
3481 * @param[out] access pointer to hold access, need to free after using
3482 * @return 0 if success, error code(<0) if fail
3483 * @retval PMINFO_R_OK success
3484 * @retval PMINFO_R_EINVAL invalid argument
3485 * @retval PMINFO_R_ERROR internal error
3488 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3489 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3492 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3493 * @brief This API gets the appid of datacontrol
3495 * @par This API is for package-manager client application
3496 * @par Sync (or) Async : Synchronous API
3498 * @param[in] providerid pointer to the providerid of dataconltrol.
3499 * @param[out] appid pointer to hold appid, need to free after using
3500 * @return 0 if success, error code(<0) if fail
3501 * @retval PMINFO_R_OK success
3502 * @retval PMINFO_R_EINVAL invalid argument
3503 * @retval PMINFO_R_ERROR internal error
3506 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3507 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3510 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3511 * @brief This API gets the alias_appid of the application
3513 * @par This API is for package-manager client application
3514 * @par Sync (or) Async : Synchronous API
3516 * @param[in] handle pointer to the application info handle.
3517 * @param[out] alias_appid pointer to hold app alias_appid
3518 * @return 0 if success, error code(<0) if fail
3519 * @retval PMINFO_R_OK success
3520 * @retval PMINFO_R_EINVAL invalid argument
3521 * @retval PMINFO_R_ERROR internal error
3522 * @pre pkgmgrinfo_appinfo_get_appinfo()
3523 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3524 * @see pkgmgrinfo_appinfo_get_appid()
3526 static int get_alias_appid(const char *appid)
3529 char *alias_appid= 0;
3530 pkgmgrinfo_appinfo_h handle = NULL;
3531 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3532 if (ret != PMINFO_R_OK)
3534 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3535 if (ret != PMINFO_R_OK) {
3536 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3539 printf("alias_appid: %s\n", alias_appid);
3540 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3545 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3548 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3549 * @brief This API gets the effective_appid of the application
3551 * @par This API is for package-manager client application
3552 * @par Sync (or) Async : Synchronous API
3554 * @param[in] handle pointer to the application info handle.
3555 * @param[out] effective_appid pointer to hold app effective_appid
3556 * @return 0 if success, error code(<0) if fail
3557 * @retval PMINFO_R_OK success
3558 * @retval PMINFO_R_EINVAL invalid argument
3559 * @retval PMINFO_R_ERROR internal error
3560 * @pre pkgmgrinfo_appinfo_get_appinfo()
3561 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3562 * @see pkgmgrinfo_appinfo_get_appid()
3564 static int get_effective_appid(const char *appid)
3567 char *effective_appid= 0;
3568 pkgmgrinfo_appinfo_h handle = NULL;
3569 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3570 if (ret != PMINFO_R_OK)
3572 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3573 if (ret != PMINFO_R_OK) {
3574 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3577 printf("effective_appid: %s\n", effective_appid);
3578 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3583 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3586 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3587 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3589 * @par This API is for package-manager client application
3590 * @par Sync (or) Async : Synchronous API
3592 * @param[in] handle pointer to the appinfo handle.
3593 * @param[out] tep_name pointer to hold tep name
3594 * @return 0 if success, error code(<0) if fail
3595 * @retval PMINFO_R_OK success
3596 * @retval PMINFO_R_EINVAL invalid argument
3597 * @retval PMINFO_R_ERROR internal error
3598 * @pre pkgmgrinfo_appinfo_get_appinfo()
3599 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3600 * @see pkgmgrinfo_appinfo_get_appid()
3602 static int get_tep_name(const char *appid)
3605 char *tep_name = NULL;
3606 pkgmgrinfo_appinfo_h handle = NULL;
3607 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3608 if (ret != PMINFO_R_OK)
3610 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3611 if (ret != PMINFO_R_OK) {
3612 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3615 printf("TEP name is: %s\n", tep_name);
3616 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3621 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3624 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3625 * @brief This API gets zip mount file name associated with the package which contain given application
3626 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3628 * @par This API is for package-manager client application
3629 * @par Sync (or) Async : Synchronous API
3631 * @param[in] handle pointer to the appinfo handle.
3632 * @param[out] zip_mount_file pointer to hold zip mount file name
3633 * @return 0 if success, error code(<0) if fail
3634 * @retval PMINFO_R_OK success
3635 * @retval PMINFO_R_EINVAL invalid argument
3636 * @retval PMINFO_R_ERROR internal error
3637 * @pre pkgmgrinfo_appinfo_get_appinfo()
3638 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3639 * @see pkgmgrinfo_appinfo_get_appid()
3641 static int get_zip_mount_file(const char *appid)
3644 char *zip_mount_file = NULL;
3645 pkgmgrinfo_appinfo_h handle = NULL;
3646 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3647 if (ret != PMINFO_R_OK)
3649 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3650 if (ret != PMINFO_R_OK) {
3651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3654 printf("Mount file name is: %s\n", zip_mount_file);
3655 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3660 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3663 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3664 * @brief This API gets the root path of application
3666 * @par Sync (or) Async : Synchronous API
3668 * @param[in] handle pointer to appinfo handle
3669 * @param[out] path pointer to hold root path of application
3670 * @return 0 if success, error code(<0) if fail
3671 * @retval PMINFO_R_OK success
3672 * @retval PMINFO_R_EINVAL invalid argument
3673 * @retval PMINFO_R_ERROR internal error
3675 static int get_root_path(const char *appid)
3679 pkgmgrinfo_appinfo_h handle;
3680 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3681 if (ret != PMINFO_R_OK)
3684 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3685 if (ret != PMINFO_R_OK) {
3686 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3689 printf("path : %s\n", path);
3690 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3696 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3699 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3700 * @brief This API gets the application api_version from the application ID
3702 * @par This API is for package-manager client application
3703 * @par Sync (or) Async : Synchronous API
3705 * @param[in] handle pointer to appinfo handle
3706 * @param[out] api_version pointer to hold application api_version
3707 * @return 0 if success, error code(<0) if fail
3708 * @retval PMINFO_R_OK success
3709 * @retval PMINFO_R_EINVAL invalid argument
3710 * @retval PMINFO_R_ERROR internal error
3711 * @pre pkgmgrinfo_appinfo_get_appinfo()
3712 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3713 * @see pkgmgrinfo_appinfo_get_appid()
3715 static int get_app_api_version(const char *appid)
3718 char *api_version = NULL;
3719 pkgmgrinfo_appinfo_h handle = NULL;
3720 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3721 if (ret != PMINFO_R_OK)
3723 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3724 if (ret != PMINFO_R_OK) {
3725 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3728 printf("app api_version: %s\n", api_version);
3729 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3734 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3737 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3738 * @brief This API gets the installed_time of the application
3740 * @par This API is for package-manager client application
3741 * @par Sync (or) Async : Synchronous API
3743 * @param[in] handle pointer to the application info handle.
3744 * @param[out] installed_time pointer to hold installed_time
3745 * @return 0 if success, error code(<0) if fail
3746 * @retval PMINFO_R_OK success
3747 * @retval PMINFO_R_EINVAL invalid argument
3748 * @retval PMINFO_R_ERROR internal error
3749 * @pre pkgmgrinfo_appinfo_get_appinfo()
3750 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3751 * @see pkgmgrinfo_appinfo_get_appid()
3752 * @see pkgmgrinfo_appinfo_is_multiple()
3754 static int get_app_installed_time(const char *appid)
3757 int installed_time = 0;
3758 pkgmgrinfo_appinfo_h handle = NULL;
3759 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3760 if (ret != PMINFO_R_OK)
3762 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
3763 if (ret != PMINFO_R_OK) {
3764 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3767 printf("installed_time: %d\n", installed_time);
3768 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3773 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
3776 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
3777 * @brief This API gets the support_mode of the application
3779 * @par This API is for package-manager client application
3780 * @par Sync (or) Async : Synchronous API
3782 * @param[in] handle pointer to the application info handle.
3783 * @param[out] support_mode pointer to hold app support_mode
3784 * @return 0 if success, error code(<0) if fail
3785 * @retval PMINFO_R_OK success
3786 * @retval PMINFO_R_EINVAL invalid argument
3787 * @retval PMINFO_R_ERROR internal error
3788 * @pre pkgmgrinfo_appinfo_get_appinfo()
3789 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3790 * @see pkgmgrinfo_appinfo_get_appid()
3792 static int get_app_support_mode(const char *appid)
3795 int support_mode = 0;
3796 pkgmgrinfo_appinfo_h handle = NULL;
3797 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3798 if (ret != PMINFO_R_OK)
3800 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
3801 if (ret != PMINFO_R_OK) {
3802 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3805 printf("support_mode: %s\n", support_mode);
3806 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3811 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
3814 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3815 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3816 * @brief This API gets the list of permission for a particular application
3818 * @par This API is for package-manager client application
3819 * @par Sync (or) Async : Synchronous API
3820 * @param[in] handle pointer to the application info handle.
3821 * @param[in] permission_func callback function for list
3822 * @param[in] user_data user data to be passed to callback function
3823 * @return 0 if success, error code(<0) if fail
3824 * @retval PMINFO_R_OK success
3825 * @retval PMINFO_R_EINVAL invalid argument
3826 * @retval PMINFO_R_ERROR internal error
3827 * @pre pkgmgrinfo_appinfo_get_appinfo()
3828 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3830 int permission_func(const char *name, void *user_data)
3832 if (strcmp(name, (char *)user_data) == 0)
3838 static int list_permission(const char *appid, char *permission)
3841 pkgmgrinfo_appinfo_h handle;
3842 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3843 if (ret != PMINFO_R_OK)
3845 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3846 if (ret != PMINFO_R_OK) {
3847 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3850 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3855 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3856 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3859 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3860 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3861 * @brief This API gets the list of category for a particular application
3863 * @par This API is for package-manager client application
3864 * @par Sync (or) Async : Synchronous API
3865 * @param[in] handle pointer to the application info handle.
3866 * @param[in] category_func callback function for list
3867 * @param[in] user_data user data to be passed to callback function
3868 * @return 0 if success, error code(<0) if fail
3869 * @retval PMINFO_R_OK success
3870 * @retval PMINFO_R_EINVAL invalid argument
3871 * @retval PMINFO_R_ERROR internal error
3872 * @pre pkgmgrinfo_appinfo_get_appinfo()
3873 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3875 int category_func(const char *name, void *user_data)
3877 if (strcmp(name, (char *)user_data) == 0)
3883 static int list_category(const char *appid, char *category)
3886 pkgmgrinfo_appinfo_h handle;
3887 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3888 if (ret != PMINFO_R_OK)
3890 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3891 if (ret != PMINFO_R_OK) {
3892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3895 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3900 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3901 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3904 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3905 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3906 * @brief This API gets the list of metadata for a particular application
3908 * @par This API is for package-manager client application
3909 * @par Sync (or) Async : Synchronous API
3910 * @param[in] handle pointer to the application info handle.
3911 * @param[in] metadata_func callback function for list
3912 * @param[in] user_data user data to be passed to callback function
3913 * @return 0 if success, error code(<0) if fail
3914 * @retval PMINFO_R_OK success
3915 * @retval PMINFO_R_EINVAL invalid argument
3916 * @retval PMINFO_R_ERROR internal error
3917 * @pre pkgmgrinfo_appinfo_get_appinfo()
3918 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3920 int metadata_func(const char *key, const char *value, void *user_data)
3922 if (strcmp(key, (char *)user_data) == 0) {
3923 printf("Value is %s\n", value);
3930 static int list_metadata(const char *appid, char *key)
3933 pkgmgrinfo_appinfo_h handle;
3934 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3935 if (ret != PMINFO_R_OK)
3937 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3938 if (ret != PMINFO_R_OK) {
3939 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3942 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3947 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3948 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3952 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3953 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3954 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3955 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3956 * @brief This API gets the list of app-control for a particular application
3958 * @par This API is for package-manager client application
3959 * @par Sync (or) Async : Synchronous API
3960 * @param[in] handle pointer to the application info handle.
3961 * @param[in] appcontrol_func callback function for list
3962 * @param[in] user_data user data to be passed to callback function
3963 * @param[in] uid the addressee user id of the instruction
3964 * @return 0 if success, error code(<0) if fail
3965 * @retval PMINFO_R_OK success
3966 * @retval PMINFO_R_EINVAL invalid argument
3967 * @retval PMINFO_R_ERROR internal error
3968 * @pre pkgmgrinfo_appinfo_get_appinfo()
3969 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3971 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3976 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3977 for (i = 0; i < oc; i++) {
3978 if (strcmp(operation[i], (char *)user_data) == 0)
3985 static int check_operation(const char *appid, char *operation)
3988 pkgmgrinfo_appinfo_h handle;
3989 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3990 if (ret != PMINFO_R_OK)
3992 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3993 if (ret != PMINFO_R_OK) {
3994 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3997 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4002 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4003 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4008 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4009 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4012 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4013 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4014 * @brief This API gets the list of splashscreen for a particular application
4016 * @par This API is for package-manager client application
4017 * @par Sync (or) Async : Synchronous API
4018 * @param[in] handle pointer to the application info handle.
4019 * @param[in] splash_screen_func callback function for list
4020 * @param[in] user_data user data to be passed to callback function
4021 * @return 0 if success, error code(<0) if fail
4022 * @retval PMINFO_R_OK success
4023 * @retval PMINFO_R_EINVAL invalid argument
4024 * @retval PMINFO_R_ERROR internal error
4025 * @pre pkgmgrinfo_appinfo_get_appinfo()
4026 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4029 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4030 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4033 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4034 * @brief This API gets the application 'nodisplay' value from the app ID
4036 * @par This API is for package-manager client application
4037 * @par Sync (or) Async : Synchronous API
4039 * @param[in] handle pointer to application info handle
4040 * @param[out] nodisplay pointer to hold package nodisplay value
4041 * @return 0 if success, error code(<0) if fail
4042 * @retval PMINFO_R_OK success
4043 * @retval PMINFO_R_EINVAL invalid argument
4044 * @retval PMINFO_R_ERROR internal error
4045 * @pre pkgmgrinfo_appinfo_get_appinfo()
4046 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4047 * @see pkgmgrinfo_appinfo_get_appid()
4048 * @see pkgmgrinfo_appinfo_is_multiple()
4050 static int get_app_nodisplay(const char *appid)
4054 pkgmgrinfo_appinfo_h handle;
4055 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4056 if (ret != PMINFO_R_OK)
4058 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4059 if (ret != PMINFO_R_OK) {
4060 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4063 printf("app nodisplay: %d\n", nodisplay);
4064 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4069 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4072 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4073 * @brief This API gets the application 'multiple' value from the app ID
4075 * @par This API is for package-manager client application
4076 * @par Sync (or) Async : Synchronous API
4078 * @param[in] handle pointer to application info handle
4079 * @param[out] multiple pointer to hold package multiple value
4080 * @return 0 if success, error code(<0) if fail
4081 * @retval PMINFO_R_OK success
4082 * @retval PMINFO_R_EINVAL invalid argument
4083 * @retval PMINFO_R_ERROR internal error
4084 * @pre pkgmgrinfo_appinfo_get_appinfo()
4085 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4086 * @see pkgmgrinfo_appinfo_get_appid()
4087 * @see pkgmgrinfo_appinfo_is_nodisplay()
4089 static int get_app_multiple(const char *appid)
4093 pkgmgrinfo_appinfo_h handle;
4094 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4095 if (ret != PMINFO_R_OK)
4097 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4098 if (ret != PMINFO_R_OK) {
4099 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4102 printf("app multiple: %d\n", multiple);
4103 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4108 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4111 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4112 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4113 * application launching effect. If fales, indicator will be hidden during application launching effect
4115 * @par This API is for package-manager client application
4116 * @par Sync (or) Async : Synchronous API
4118 * @param[in] handle pointer to application info handle
4119 * @param[out] indicator_disp contains indicator display status for application launching effect
4120 * @return 0 if success, error code(<0) if fail
4121 * @retval PMINFO_R_OK success
4122 * @retval PMINFO_R_EINVAL invalid argument
4123 * @retval PMINFO_R_ERROR internal error
4124 * @pre pkgmgrinfo_appinfo_get_appinfo()
4125 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4126 * @see pkgmgrinfo_appinfo_get_appid()
4127 * @see pkgmgrinfo_appinfo_is_nodisplay()
4129 static int get_app_indicator_display(const char *appid)
4132 bool indicator_disp;
4133 pkgmgrinfo_appinfo_h handle;
4134 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4135 if (ret != PMINFO_R_OK)
4137 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4138 if (ret != PMINFO_R_OK){
4139 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4142 printf("app indicator disp : %d\n", indicator_disp);
4143 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4148 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4151 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4152 * @brief This API gets the application 'taskmanage' value from the app ID
4154 * @par This API is for package-manager client application
4155 * @par Sync (or) Async : Synchronous API
4157 * @param[in] handle pointer to application info handle
4158 * @param[out] taskmanage pointer to hold package taskmanage value
4159 * @return 0 if success, error code(<0) if fail
4160 * @retval PMINFO_R_OK success
4161 * @retval PMINFO_R_EINVAL invalid argument
4162 * @retval PMINFO_R_ERROR internal error
4163 * @pre pkgmgrinfo_appinfo_get_appinfo()
4164 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4165 * @see pkgmgrinfo_appinfo_get_appid()
4166 * @see pkgmgrinfo_appinfo_is_multiple()
4168 static int get_app_taskmanage(const char *appid)
4172 pkgmgrinfo_appinfo_h handle;
4173 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4174 if (ret != PMINFO_R_OK)
4176 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4177 if (ret != PMINFO_R_OK) {
4178 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4181 printf("app taskmanage: %d\n", taskmanage);
4182 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4187 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4190 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4191 * @brief This API gets the application 'taskmanage' value from the app ID
4193 * @par This API is for package-manager client application
4194 * @par Sync (or) Async : Synchronous API
4196 * @param[in] handle pointer to application info handle
4197 * @param[out] enabled pointer to hold package enabled value
4198 * @return 0 if success, error code(<0) if fail
4199 * @retval PMINFO_R_OK success
4200 * @retval PMINFO_R_EINVAL invalid argument
4201 * @retval PMINFO_R_ERROR internal error
4202 * @pre pkgmgrinfo_appinfo_get_appinfo()
4203 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4204 * @see pkgmgrinfo_appinfo_get_appid()
4205 * @see pkgmgrinfo_appinfo_is_multiple()
4207 static int get_app_enabled(const char *appid)
4211 pkgmgrinfo_appinfo_h handle;
4212 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4213 if (ret != PMINFO_R_OK)
4215 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4216 if (ret != PMINFO_R_OK) {
4217 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4220 printf("app enabled: %d\n", enabled);
4221 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4226 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4229 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4230 * @brief This API gets the application 'onboot' value from the app ID
4232 * @par This API is for package-manager client application
4233 * @par Sync (or) Async : Synchronous API
4235 * @param[in] handle pointer to application info handle
4236 * @param[out] onboot pointer to hold package onboot value
4237 * @return 0 if success, error code(<0) if fail
4238 * @retval PMINFO_R_OK success
4239 * @retval PMINFO_R_EINVAL invalid argument
4240 * @retval PMINFO_R_ERROR internal error
4241 * @pre pkgmgrinfo_appinfo_get_appinfo()
4242 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4243 * @see pkgmgrinfo_appinfo_get_appid()
4244 * @see pkgmgrinfo_appinfo_is_multiple()
4246 static int get_app_onboot(const char *appid)
4250 pkgmgrinfo_appinfo_h handle;
4251 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4252 if (ret != PMINFO_R_OK)
4254 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4255 if (ret != PMINFO_R_OK) {
4256 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4259 printf("app onboot: %d\n", onboot);
4260 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4265 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4268 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4269 * @brief This API gets the application 'autorestart' value from the app ID
4271 * @par This API is for package-manager client application
4272 * @par Sync (or) Async : Synchronous API
4274 * @param[in] handle pointer to application info handle
4275 * @param[out] autorestart pointer to hold package autorestart value
4276 * @return 0 if success, error code(<0) if fail
4277 * @retval PMINFO_R_OK success
4278 * @retval PMINFO_R_EINVAL invalid argument
4279 * @retval PMINFO_R_ERROR internal error
4280 * @pre pkgmgrinfo_appinfo_get_appinfo()
4281 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4282 * @see pkgmgrinfo_appinfo_get_appid()
4283 * @see pkgmgrinfo_appinfo_is_multiple()
4285 static int get_app_autorestart(const char *appid)
4289 pkgmgrinfo_appinfo_h handle;
4290 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4291 if (ret != PMINFO_R_OK)
4293 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4294 if (ret != PMINFO_R_OK) {
4295 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4298 printf("app autorestart: %d\n", autorestart);
4299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4304 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4307 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4308 * @brief This API gets the value for given application is main app or not from handle
4310 * @par This API is for package-manager client application
4311 * @par Sync (or) Async : Synchronous API
4313 * @param[in] handle pointer to application info handle
4314 * @param[out] mainapp pointer to hold package mainapp is or not
4315 * @return 0 if success, error code(<0) if fail
4316 * @retval PMINFO_R_OK success
4317 * @retval PMINFO_R_EINVAL invalid argument
4318 * @retval PMINFO_R_ERROR internal error
4319 * @pre pkgmgrinfo_appinfo_get_appinfo()
4320 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4321 * @see pkgmgrinfo_appinfo_get_appid()
4322 * @see pkgmgrinfo_appinfo_is_multiple()
4324 static int get_app_mainapp(const char *appid)
4328 pkgmgrinfo_appinfo_h handle;
4329 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4330 if (ret != PMINFO_R_OK)
4332 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4333 if (ret != PMINFO_R_OK) {
4334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4337 printf("mainapp: %d\n", mainapp);
4338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4343 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4347 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4348 * @brief This API gets the value for given application is preload or not from handle
4350 * @par This API is for package-manager client application
4351 * @par Sync (or) Async : Synchronous API
4353 * @param[in] handle pointer to application info handle
4354 * @param[out] preload pointer to hold preload is or not
4355 * @return 0 if success, error code(<0) if fail
4356 * @retval PMINFO_R_OK success
4357 * @retval PMINFO_R_EINVAL invalid argument
4358 * @retval PMINFO_R_ERROR internal error
4359 * @pre pkgmgrinfo_appinfo_get_appinfo()
4360 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4361 * @see pkgmgrinfo_appinfo_get_appid()
4362 * @see pkgmgrinfo_appinfo_is_multiple()
4364 static int get_app_preload(const char *appid)
4368 pkgmgrinfo_appinfo_h handle = NULL;
4369 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4370 if (ret != PMINFO_R_OK)
4372 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4373 if (ret != PMINFO_R_OK) {
4374 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4377 printf("preload: %d\n", preload);
4378 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4383 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4386 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4387 * @brief This API gets the value for given application is submode or not from handle
4389 * @par This API is for package-manager client application
4390 * @par Sync (or) Async : Synchronous API
4392 * @param[in] handle pointer to application info handle
4393 * @param[out] submode pointer to hold submode is or not
4394 * @return 0 if success, error code(<0) if fail
4395 * @retval PMINFO_R_OK success
4396 * @retval PMINFO_R_EINVAL invalid argument
4397 * @retval PMINFO_R_ERROR internal error
4398 * @pre pkgmgrinfo_appinfo_get_appinfo()
4399 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4400 * @see pkgmgrinfo_appinfo_get_appid()
4401 * @see pkgmgrinfo_appinfo_is_multiple()
4403 static int get_app_submode(const char *appid)
4407 pkgmgrinfo_appinfo_h handle = NULL;
4408 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4409 if (ret != PMINFO_R_OK)
4411 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4412 if (ret != PMINFO_R_OK) {
4413 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4416 printf("submode: %d\n", submode);
4417 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4422 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4425 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4426 * @brief This API gets the value for given application is process_pool or not from handle
4428 * @par This API is for package-manager client application
4429 * @par Sync (or) Async : Synchronous API
4431 * @param[in] handle pointer to application info handle
4432 * @param[out] process_pool pointer to hold process_pool is or not
4433 * @return 0 if success, error code(<0) if fail
4434 * @retval PMINFO_R_OK success
4435 * @retval PMINFO_R_EINVAL invalid argument
4436 * @retval PMINFO_R_ERROR internal error
4437 * @pre pkgmgrinfo_appinfo_get_appinfo()
4438 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4439 * @see pkgmgrinfo_appinfo_get_appid()
4441 static int get_app_process_pool(const char *appid)
4444 bool process_pool = 0;
4445 pkgmgrinfo_appinfo_h handle = NULL;
4446 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4447 if (ret != PMINFO_R_OK)
4449 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4450 if (ret != PMINFO_R_OK) {
4451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4454 printf("process_pool: %d\n", process_pool);
4455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4460 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4463 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4464 * @brief This API gets the installed storage location of the application
4466 * @par This API is for package-manager client application
4467 * @par Sync (or) Async : Synchronous API
4469 * @param[in] handle pointer to the application info handle.
4470 * @param[out] app_type pointer to hold installed storage location
4471 * @return 0 if success, error code(<0) if fail
4472 * @retval PMINFO_R_OK success
4473 * @retval PMINFO_R_EINVAL invalid argument
4474 * @retval PMINFO_R_ERROR internal error
4475 * @pre pkgmgrinfo_appinfo_get_appinfo()
4476 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4477 * @see pkgmgrinfo_appinfo_get_appid()
4479 static int get_app_installed_location(const char *appid)
4482 pkgmgrinfo_installed_storage storage;
4483 pkgmgrinfo_appinfo_h handle = NULL;
4484 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4485 if (ret != PMINFO_R_OK)
4487 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4488 if (ret != PMINFO_R_OK) {
4489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4492 printf("Installed storage location : %d\n", storage);
4493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4498 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4502 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4503 * @brief This API checks if the application has the given category
4505 * @par This API is for package-manager client application
4506 * @par Sync (or) Async : Synchronous API
4508 * @param[in] handle pointer to the application info handle
4509 * @param[in] category category
4510 * @param[out] exist value Gets whether the application has the given category
4511 * @return 0 if success, error code(<0) if fail
4512 * @retval PMINFO_R_OK success
4513 * @retval PMINFO_R_EINVAL invalid argument
4514 * @retval PMINFO_R_ERROR internal error
4516 static int is_category_exist(const char *appid, const char *category)
4519 pkgmgrinfo_appinfo_h handle;
4522 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4523 if (ret != PMINFO_R_OK)
4526 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4527 if (ret != PMINFO_R_OK) {
4528 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4532 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4537 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4540 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4541 * @brief This API gets the application 'ui_gadget' value from the app ID
4543 * @par This API is for package-manager client application
4544 * @par Sync (or) Async : Synchronous API
4546 * @param[in] handle pointer to application info handle
4547 * @param[out] ui_gadget pointer to hold package ui_gadget value
4548 * @return 0 if success, error code(<0) if fail
4549 * @retval PMINFO_R_OK success
4550 * @retval PMINFO_R_EINVAL invalid argument
4551 * @pre pkgmgrinfo_appinfo_get_appinfo()
4552 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4554 static int get_app_ui_gadget(const char *appid)
4558 pkgmgrinfo_appinfo_h handle = NULL;
4559 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4560 if (ret != PMINFO_R_OK)
4562 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4563 if (ret != PMINFO_R_OK) {
4564 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4567 printf("app ui_gadget: %d\n", ui_gadget);
4568 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4573 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4576 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4577 * @brief This API gets the application 'support_disable' value from the app ID
4579 * @par This API is for package-manager client application
4580 * @par Sync (or) Async : Synchronous API
4582 * @param[in] handle pointer to application info handle
4583 * @param[out] support_disable pointer to hold package support_disable value
4584 * @return 0 if success, error code(<0) if fail
4585 * @retval PMINFO_R_OK success
4586 * @retval PMINFO_R_EINVAL invalid argument
4587 * @pre pkgmgrinfo_appinfo_get_appinfo()
4588 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4590 static int get_app_support_disable(const char *appid)
4593 bool support_disable;
4594 pkgmgrinfo_appinfo_h handle = NULL;
4595 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4596 if (ret != PMINFO_R_OK)
4598 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4599 if (ret != PMINFO_R_OK) {
4600 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4603 printf("app support_disable: %d\n", support_disable);
4604 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4609 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4612 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4613 * @brief This API gets the application 'removable' value from the app ID
4615 * @par This API is for package-manager client application
4616 * @par Sync (or) Async : Synchronous API
4618 * @param[in] handle pointer to application info handle
4619 * @param[out] removable pointer to hold package removable value
4620 * @return 0 if success, error code(<0) if fail
4621 * @retval PMINFO_R_OK success
4622 * @retval PMINFO_R_EINVAL invalid argument
4623 * @retval PMINFO_R_ERROR internal error
4624 * @pre pkgmgrinfo_appinfo_get_appinfo()
4625 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4626 * @see pkgmgrinfo_appinfo_get_appid()
4628 static int get_app_removable(const char *appid)
4632 pkgmgrinfo_appinfo_h handle = NULL;
4633 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4634 if (ret != PMINFO_R_OK)
4636 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4637 if (ret != PMINFO_R_OK) {
4638 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4641 printf("app removable: %d\n", removable);
4642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4647 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4650 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4651 * @brief This API gets the application 'system' value from the app ID
4653 * @par This API is for package-manager client application
4654 * @par Sync (or) Async : Synchronous API
4656 * @param[in] handle pointer to application info handle
4657 * @param[out] system pointer to hold package system value
4658 * @return 0 if success, error code(<0) if fail
4659 * @retval PMINFO_R_OK success
4660 * @retval PMINFO_R_EINVAL invalid argument
4661 * @retval PMINFO_R_ERROR internal error
4662 * @pre pkgmgrinfo_appinfo_get_appinfo()
4663 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4664 * @see pkgmgrinfo_appinfo_get_appid()
4666 static int get_app_system(const char *appid)
4669 bool system = false;
4670 pkgmgrinfo_appinfo_h handle = NULL;
4671 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4672 if (ret != PMINFO_R_OK)
4674 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4675 if (ret != PMINFO_R_OK) {
4676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4679 printf("app system: %d\n", system);
4680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4685 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4689 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4690 * @brief This API gets the application 'is_disable' value from the app ID
4692 * @par This API is for package-manager client application
4693 * @par Sync (or) Async : Synchronous API
4695 * @param[in] handle pointer to application info handle
4696 * @param[out] disabled pointer to hold application is_disabled value
4697 * @return 0 if success, error code(<0) if fail
4698 * @retval PMINFO_R_OK success
4699 * @retval PMINFO_R_EINVAL invalid argument
4700 * @pre pkgmgrinfo_appinfo_get_appinfo()
4701 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4703 static int get_app_is_disable(const char *appid)
4707 pkgmgrinfo_appinfo_h handle = NULL;
4708 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4709 if (ret != PMINFO_R_OK)
4711 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4712 if (ret != PMINFO_R_OK) {
4713 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4716 printf("app is_disable: %d\n", is_disable);
4717 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4722 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4725 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4726 * @brief This API gets whethere the given application is global application or user application
4728 * @par This API is for package-manager client application
4729 * @par Sync (or) Async : Synchronous API
4731 * @param[in] handle pointer to application info handle
4732 * @param[in] global pointer to hold application global value
4733 * @return 0 if success, error code(<0) if fail
4734 * @retval PMINFO_R_OK success
4735 * @retval PMINFO_R_EINVAL invalid argument
4736 * @retval PMINFO_R_ERROR internal error
4737 * @pre pkgmgrinfo_appinfo_get_appinfo()
4738 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4739 * @see pkgmgrinfo_appinfo_get_appid()
4740 static int get_app_is_global(const char *appid)
4744 pkgmgrinfo_appinfo_h handle = NULL;
4745 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4746 if (ret != PMINFO_R_OK)
4748 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4749 if (ret != PMINFO_R_OK) {
4750 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4753 printf("app is_global: %d\n", global);
4754 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4759 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4762 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4763 * @brief This API gets the application 'splash_screen_display' value from the app ID
4765 * @par This API is for package-manager client application
4766 * @par Sync (or) Async : Synchronous API
4768 * @param[in] handle pointer to application info handle
4769 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4770 * @return 0 if success, error code(<0) if fail
4771 * @retval PMINFO_R_OK success
4772 * @retval PMINFO_R_EINVAL invalid argument
4773 * @retval PMINFO_R_ERROR internal error
4775 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4778 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4779 * @brief This API destroys the application information handle freeing up all the resources
4781 * @par This API is for package-manager client application
4782 * @par Sync (or) Async : Synchronous API
4784 * @param[in] handle pointer to the application info handle.
4785 * @return 0 if success, error code(<0) if fail
4786 * @retval PMINFO_R_OK success
4787 * @retval PMINFO_R_EINVAL invalid argument
4788 * @retval PMINFO_R_ERROR internal error
4789 * @pre pkgmgrinfo_appinfo_get_appinfo()
4791 * @see pkgmgrinfo_appinfo_get_pkgid()
4792 * @see pkgmgrinfo_appinfo_is_multiple()
4794 static int get_app_type(const char *appid)
4798 pkgmgrinfo_appinfo_h handle;
4799 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4800 if (ret != PMINFO_R_OK)
4802 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4803 if (ret != PMINFO_R_OK) {
4804 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4807 printf("apptype: %s\n", type);
4808 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4813 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4816 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4817 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4818 The query will search the entire application information collected from the manifest file of all the installed packages
4820 * @par This API is for package-manager client application
4821 * @par Sync (or) Async : Synchronous API
4823 * @param[out] handle pointer to the application info filter handle.
4824 * @return 0 if success, error code(<0) if fail
4825 * @retval PMINFO_R_OK success
4826 * @retval PMINFO_R_EINVAL invalid argument
4827 * @retval PMINFO_R_ERROR internal error
4829 * @post pkgmgrinfo_appinfo_filter_destroy()
4830 * @see pkgmgrinfo_appinfo_filter_count()
4831 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4833 static int get_capp_count()
4837 pkgmgrinfo_appinfo_filter_h handle;
4838 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4839 if (ret != PMINFO_R_OK)
4841 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4842 if (ret != PMINFO_R_OK) {
4843 pkgmgrinfo_appinfo_filter_destroy(handle);
4846 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4847 if (ret != PMINFO_R_OK) {
4848 pkgmgrinfo_appinfo_filter_destroy(handle);
4851 printf("No of capp: %d\n", count);
4852 pkgmgrinfo_appinfo_filter_destroy(handle);
4857 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4860 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4861 * @brief This API destroys the application information filter handle freeing up all the resources
4863 * @par This API is for package-manager client application
4864 * @par Sync (or) Async : Synchronous API
4866 * @param[in] handle pointer to the application info filter handle.
4867 * @return 0 if success, error code(<0) if fail
4868 * @retval PMINFO_R_OK success
4869 * @retval PMINFO_R_EINVAL invalid argument
4870 * @retval PMINFO_R_ERROR internal error
4871 * @pre pkgmgrinfo_appinfo_filter_create()
4873 * @see pkgmgrinfo_appinfo_filter_count()
4874 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4876 static int get_capp_count()
4880 pkgmgrinfo_appinfo_filter_h handle;
4881 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4882 if (ret != PMINFO_R_OK)
4884 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4885 if (ret != PMINFO_R_OK) {
4886 pkgmgrinfo_appinfo_filter_destroy(handle);
4889 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4890 if (ret != PMINFO_R_OK) {
4891 pkgmgrinfo_appinfo_filter_destroy(handle);
4894 printf("No of capp: %d\n", count);
4895 pkgmgrinfo_appinfo_filter_destroy(handle);
4900 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4903 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4904 * @brief This API adds a boolean filter property to the filter handle
4906 * @par This API is for package-manager client application
4907 * @par Sync (or) Async : Synchronous API
4909 * @param[in] handle pointer to the application info filter handle.
4910 * @param[in] property boolean property name.
4911 * @param[in] value value corresponding to the property.
4912 * @return 0 if success, error code(<0) if fail
4913 * @retval PMINFO_R_OK success
4914 * @retval PMINFO_R_EINVAL invalid argument
4915 * @retval PMINFO_R_ERROR internal error
4916 * @pre pkgmgrinfo_appinfo_filter_create()
4917 * @post pkgmgrinfo_appinfo_filter_destroy()
4918 * @see pkgmgrinfo_appinfo_filter_count()
4919 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4921 static int get_taskmanageable_app_count()
4925 pkgmgrinfo_appinfo_filter_h handle;
4926 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4927 if (ret != PMINFO_R_OK)
4929 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4930 if (ret != PMINFO_R_OK) {
4931 pkgmgrinfo_appinfo_filter_destroy(handle);
4934 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4935 if (ret != PMINFO_R_OK) {
4936 pkgmgrinfo_appinfo_filter_destroy(handle);
4939 printf("No of taskmanageable apps: %d\n", count);
4940 pkgmgrinfo_appinfo_filter_destroy(handle);
4945 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4946 const char *property, const bool value);
4949 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4950 * @brief This API adds an integer filter property to the filter handle
4952 * @par This API is for package-manager client application
4953 * @par Sync (or) Async : Synchronous API
4955 * @param[in] handle pointer to the application info filter handle.
4956 * @param[in] property integer property name.
4957 * @param[in] value value corresponding to the property.
4958 * @return 0 if success, error code(<0) if fail
4959 * @retval PMINFO_R_OK success
4960 * @retval PMINFO_R_EINVAL invalid argument
4961 * @retval PMINFO_R_ERROR internal error
4962 * @pre pkgmgrinfo_appinfo_filter_create()
4963 * @post pkgmgrinfo_appinfo_filter_destroy()
4964 * @see pkgmgrinfo_appinfo_filter_count()
4965 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4967 static int get_taskmanageable_app_count()
4971 pkgmgrinfo_appinfo_filter_h handle;
4972 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4973 if (ret != PMINFO_R_OK)
4975 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4976 if (ret != PMINFO_R_OK) {
4977 pkgmgrinfo_appinfo_filter_destroy(handle);
4980 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4981 if (ret != PMINFO_R_OK) {
4982 pkgmgrinfo_appinfo_filter_destroy(handle);
4985 printf("No of apps: %d\n", count);
4986 pkgmgrinfo_appinfo_filter_destroy(handle);
4991 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4992 const char *property, const int value);
4995 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4996 * @brief This API adds a string filter property to the filter handle
4998 * @par This API is for package-manager client application
4999 * @par Sync (or) Async : Synchronous API
5001 * @param[in] handle pointer to the application info filter handle.
5002 * @param[in] property string property name.
5003 * @param[in] value value corresponding to the property.
5004 * @return 0 if success, error code(<0) if fail
5005 * @retval PMINFO_R_OK success
5006 * @retval PMINFO_R_EINVAL invalid argument
5007 * @retval PMINFO_R_ERROR internal error
5008 * @pre pkgmgrinfo_appinfo_filter_create()
5009 * @post pkgmgrinfo_appinfo_filter_destroy()
5010 * @see pkgmgrinfo_appinfo_filter_count()
5011 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5013 static int get_capp_count()
5017 pkgmgrinfo_appinfo_filter_h handle;
5018 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5019 if (ret != PMINFO_R_OK)
5021 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5022 if (ret != PMINFO_R_OK) {
5023 pkgmgrinfo_appinfo_filter_destroy(handle);
5026 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5027 if (ret != PMINFO_R_OK) {
5028 pkgmgrinfo_appinfo_filter_destroy(handle);
5031 printf("No of capp: %d\n", count);
5032 pkgmgrinfo_appinfo_filter_destroy(handle);
5037 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5038 const char *property, const char *value);
5041 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5042 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5044 * @par This API is for package-manager client application
5045 * @par Sync (or) Async : Synchronous API
5047 * @param[in] handle pointer to the application info filter handle.
5048 * @param[in] app_cb callback function.
5049 * @param[in] user_data user data to be passed to the callback function
5050 * @return 0 if success, error code(<0) if fail
5051 * @retval PMINFO_R_OK success
5052 * @retval PMINFO_R_EINVAL invalid argument
5053 * @retval PMINFO_R_ERROR internal error
5054 * @pre pkgmgrinfo_appinfo_filter_create()
5055 * @post pkgmgrinfo_appinfo_filter_destroy()
5056 * @see pkgmgrinfo_appinfo_filter_count()
5058 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5061 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5062 printf("appid : %s\n", appid);
5066 static int get_capp_list()
5069 pkgmgrinfo_appinfo_filter_h handle;
5070 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5071 if (ret != PMINFO_R_OK)
5073 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5074 if (ret != PMINFO_R_OK) {
5075 pkgmgrinfo_appinfo_filter_destroy(handle);
5078 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5079 if (ret != PMINFO_R_OK) {
5080 pkgmgrinfo_appinfo_filter_destroy(handle);
5083 pkgmgrinfo_appinfo_filter_destroy(handle);
5088 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5089 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5090 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5091 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5094 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5095 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5096 * @brief This API counts the application that satisfy the filter conditions
5098 * @par This API is for package-manager client application
5099 * @par Sync (or) Async : Synchronous API
5101 * @param[in] handle pointer to the application info filter handle.
5102 * @param[in] count pointer to store count value
5103 * @param[in] uid the addressee user id of the instruction
5104 * @return 0 if success, error code(<0) if fail
5105 * @retval PMINFO_R_OK success
5106 * @retval PMINFO_R_EINVAL invalid argument
5107 * @retval PMINFO_R_ERROR internal error
5108 * @pre pkgmgrinfo_appinfo_filter_create()
5109 * @post pkgmgrinfo_appinfo_filter_destroy()
5110 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5112 static int get_capp_count()
5116 pkgmgrinfo_appinfo_filter_h handle;
5117 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5118 if (ret != PMINFO_R_OK)
5120 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5121 if (ret != PMINFO_R_OK) {
5122 pkgmgrinfo_appinfo_filter_destroy(handle);
5125 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5126 if (ret != PMINFO_R_OK) {
5127 pkgmgrinfo_appinfo_filter_destroy(handle);
5130 printf("No of capp: %d\n", count);
5131 pkgmgrinfo_appinfo_filter_destroy(handle);
5136 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5137 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5139 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5140 * @brief This API creates the application's metadata information filter handle from db.
5142 * @par This API is for package-manager client application
5143 * @par Sync (or) Async : Synchronous API
5145 * @param[out] handle pointer to the application metadata info filter handle.
5146 * @return 0 if success, error code(<0) if fail
5147 * @retval PMINFO_R_OK success
5148 * @retval PMINFO_R_EINVAL invalid argument
5149 * @retval PMINFO_R_ERROR internal error
5151 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5152 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5154 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5157 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5158 printf("appid : %s\n", appid);
5162 static int get_app_list(const char *mkey, const char *mvalue)
5165 pkgmgrinfo_appinfo_metadata_filter_h handle;
5166 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5167 if (ret != PMINFO_R_OK)
5169 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5170 if (ret != PMINFO_R_OK) {
5171 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5174 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5175 if (ret != PMINFO_R_OK) {
5176 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5179 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5184 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5187 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5188 * @brief This API destroys the application's metadata information filter handle.
5190 * @par This API is for package-manager client application
5191 * @par Sync (or) Async : Synchronous API
5193 * @param[in] handle pointer to the application metadata info filter handle.
5194 * @return 0 if success, error code(<0) if fail
5195 * @retval PMINFO_R_OK success
5196 * @retval PMINFO_R_EINVAL invalid argument
5197 * @retval PMINFO_R_ERROR internal error
5198 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5200 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5202 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5205 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5206 printf("appid : %s\n", appid);
5210 static int get_app_list(const char *mkey, const char *mvalue)
5213 pkgmgrinfo_appinfo_metadata_filter_h handle;
5214 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5215 if (ret != PMINFO_R_OK)
5217 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5218 if (ret != PMINFO_R_OK) {
5219 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5222 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5223 if (ret != PMINFO_R_OK) {
5224 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5227 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5232 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5235 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5236 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5237 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5239 * @par This API is for package-manager client application
5240 * @par Sync (or) Async : Synchronous API
5242 * @param[in] handle pointer to the application metadata info filter handle.
5243 * @param[in] key pointer to metadata key
5244 * @param[in] value pointer to metadata value
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()
5250 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
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_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5284 const char *key, const char *value);
5287 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5288 * @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)
5289 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5290 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5291 * negative value, no more callbacks will be called and API will return.
5293 * @par This API is for package-manager client application
5294 * @par Sync (or) Async : Synchronous API
5296 * @param[in] handle pointer to the application metadata info filter handle.
5297 * @param[in] app_cb function pointer to callback
5298 * @param[in] user_data pointer to user data
5299 * @param[in] uid the addressee user id of the instruction
5300 * @return 0 if success, error code(<0) if fail
5301 * @retval PMINFO_R_OK success
5302 * @retval PMINFO_R_EINVAL invalid argument
5303 * @retval PMINFO_R_ERROR internal error
5304 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5305 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5307 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5310 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5311 printf("appid : %s\n", appid);
5315 static int get_app_list(const char *mkey, const char *mvalue)
5318 pkgmgrinfo_appinfo_metadata_filter_h handle;
5319 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5320 if (ret != PMINFO_R_OK)
5322 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5323 if (ret != PMINFO_R_OK) {
5324 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5327 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5328 if (ret != PMINFO_R_OK) {
5329 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5332 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5337 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5338 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5339 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5340 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5342 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5343 * @brief This API creates the package cert information handle to get data from db.
5345 * @par This API is for package-manager client application
5346 * @par Sync (or) Async : Synchronous API
5348 * @param[out] handle pointer to the package cert handle.
5349 * @return 0 if success, error code(<0) if fail
5350 * @retval PMINFO_R_OK success
5351 * @retval PMINFO_R_EINVAL invalid argument
5352 * @retval PMINFO_R_ERROR internal error
5354 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5355 * @see pkgmgrinfo_pkginfo_get_cert_value()
5356 * @see pkgmgrinfo_pkginfo_load_certinfo()
5358 static int get_cert_info(const char *pkgid)
5361 pkgmgrinfo_certinfo_h handle;
5362 char *auth_cert = NULL;
5363 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5364 if (ret != PMINFO_R_OK)
5366 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5367 if (ret != PMINFO_R_OK) {
5368 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5371 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5372 if (ret != PMINFO_R_OK) {
5373 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5376 printf("Author root certificate: %s\n", auth_root);
5377 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5382 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5385 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5386 * @brief This API loads the package cert information handle with data from db.
5388 * @par This API is for package-manager client application
5389 * @par Sync (or) Async : Synchronous API
5391 * @param[in] pkgid pointer to the package ID.
5392 * @param[in] handle pointer to the package cert handle.
5393 * @return 0 if success, error code(<0) if fail
5394 * @retval PMINFO_R_OK success
5395 * @retval PMINFO_R_EINVAL invalid argument
5396 * @retval PMINFO_R_ERROR internal error
5397 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5398 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5399 * @see pkgmgrinfo_pkginfo_get_cert_value()
5401 static int get_cert_info(const char *pkgid)
5404 pkgmgrinfo_certinfo_h handle;
5405 char *auth_cert = NULL;
5406 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5407 if (ret != PMINFO_R_OK)
5409 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5410 if (ret != PMINFO_R_OK) {
5411 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5414 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5415 if (ret != PMINFO_R_OK) {
5416 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5419 printf("Author root certificate: %s\n", auth_root);
5420 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5425 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5428 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5429 * @brief This API gets the package cert information from the handle
5431 * @par This API is for package-manager client application
5432 * @par Sync (or) Async : Synchronous API
5434 * @param[in] handle pointer to the package cert handle.
5435 * @param[in] cert_type certificate type
5436 * @param[out] cert_value pointer to hold certificate value
5437 * @return 0 if success, error code(<0) if fail
5438 * @retval PMINFO_R_OK success
5439 * @retval PMINFO_R_EINVAL invalid argument
5440 * @retval PMINFO_R_ERROR internal error
5441 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5442 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5443 * @see pkgmgrinfo_pkginfo_load_certinfo()
5445 static int get_cert_info(const char *pkgid)
5448 pkgmgrinfo_certinfo_h handle;
5449 char *auth_cert = NULL;
5450 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5451 if (ret != PMINFO_R_OK)
5453 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5454 if (ret != PMINFO_R_OK) {
5455 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5458 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5459 if (ret != PMINFO_R_OK) {
5460 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5463 printf("Author root certificate: %s\n", auth_root);
5464 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5469 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5472 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5473 * @brief This API destroys the package cert information handle freeing up all the resources
5475 * @par This API is for package-manager client application
5476 * @par Sync (or) Async : Synchronous API
5478 * @param[in] handle pointer to the package cert handle.
5479 * @return 0 if success, error code(<0) if fail
5480 * @retval PMINFO_R_OK success
5481 * @retval PMINFO_R_EINVAL invalid argument
5482 * @retval PMINFO_R_ERROR internal error
5483 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5485 * @see pkgmgrinfo_pkginfo_load_certinfo()
5487 static int get_cert_info(const char *pkgid)
5490 pkgmgrinfo_certinfo_h handle;
5491 char *auth_cert = NULL;
5492 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5493 if (ret != PMINFO_R_OK)
5495 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5496 if (ret != PMINFO_R_OK) {
5497 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5500 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5501 if (ret != PMINFO_R_OK) {
5502 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5505 printf("Author root certificate: %s\n", auth_root);
5506 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5511 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5514 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5515 * @brief This API deletes the package cert information from DB
5517 * @par This API is for package-manager client application
5518 * @par Sync (or) Async : Synchronous API
5520 * @param[in] pkgid pointer to the package ID.
5521 * @return 0 if success, error code(<0) if fail
5522 * @retval PMINFO_R_OK success
5523 * @retval PMINFO_R_EINVAL invalid argument
5524 * @retval PMINFO_R_ERROR internal error
5528 static int delete_cert_info(const char *pkgid)
5531 ret = pkgmgrinfo_delete_certinfo(pkgid);
5532 if (ret != PMINFO_R_OK)
5538 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5539 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5542 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5543 * @brief This API creates the package cert information handle to set data in db.
5545 * @par This API is for package-manager client application
5546 * @par Sync (or) Async : Synchronous API
5548 * @param[out] handle pointer to the package cert handle.
5549 * @return 0 if success, error code(<0) if fail
5550 * @retval PMINFO_R_OK success
5551 * @retval PMINFO_R_EINVAL invalid argument
5552 * @retval PMINFO_R_ERROR internal error
5554 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5555 * @see pkgmgrinfo_set_cert_value()
5556 * @see pkgmgrinfo_save_certinfo()
5558 static int set_cert_in_db(const char *pkgid)
5561 pkgmgrinfo_instcertinfo_h handle;
5562 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5563 if (ret != PMINFO_R_OK)
5565 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5566 if (ret != PMINFO_R_OK) {
5567 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5570 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5571 if (ret != PMINFO_R_OK) {
5572 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5575 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5580 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5583 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5584 * @brief This API sets the package cert information in the handle.
5586 * @par This API is for package-manager client application
5587 * @par Sync (or) Async : Synchronous API
5589 * @param[in] handle pointer to the package cert handle.
5590 * @param[in] cert_type certificate type.
5591 * @param[in] cert_value certificate value.
5592 * @return 0 if success, error code(<0) if fail
5593 * @retval PMINFO_R_OK success
5594 * @retval PMINFO_R_EINVAL invalid argument
5595 * @retval PMINFO_R_ERROR internal error
5596 * @pre pkgmgrinfo_create_certinfo_set_handle()
5597 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5598 * @see pkgmgrinfo_save_certinfo()
5600 static int set_cert_in_db(const char *pkgid)
5603 pkgmgrinfo_instcertinfo_h handle;
5604 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5605 if (ret != PMINFO_R_OK)
5607 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5608 if (ret != PMINFO_R_OK) {
5609 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5612 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5613 if (ret != PMINFO_R_OK) {
5614 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5617 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5622 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5625 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5626 * @brief This API saves the package cert information in the DB.
5628 * @par This API is for package-manager client application
5629 * @par Sync (or) Async : Synchronous API
5631 * @param[in] pkgid pointer to the package ID.
5632 * @param[in] handle pointer to the package cert handle.
5633 * @return 0 if success, error code(<0) if fail
5634 * @retval PMINFO_R_OK success
5635 * @retval PMINFO_R_EINVAL invalid argument
5636 * @retval PMINFO_R_ERROR internal error
5637 * @pre pkgmgrinfo_create_certinfo_set_handle()
5638 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5639 * @see pkgmgrinfo_save_certinfo()
5641 static int set_cert_in_db(const char *pkgid)
5644 pkgmgrinfo_instcertinfo_h handle;
5645 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5646 if (ret != PMINFO_R_OK)
5648 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5649 if (ret != PMINFO_R_OK) {
5650 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5653 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5654 if (ret != PMINFO_R_OK) {
5655 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5658 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5663 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5666 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5667 * @brief This API destroys the package cert information handle freeing up all the resources.
5669 * @par This API is for package-manager client application
5670 * @par Sync (or) Async : Synchronous API
5672 * @param[in] handle pointer to the package cert handle.
5673 * @return 0 if success, error code(<0) if fail
5674 * @retval PMINFO_R_OK success
5675 * @retval PMINFO_R_EINVAL invalid argument
5676 * @retval PMINFO_R_ERROR internal error
5677 * @pre pkgmgrinfo_create_certinfo_set_handle()
5679 * @see pkgmgrinfo_save_certinfo()
5681 static int set_cert_in_db(const char *pkgid)
5684 pkgmgrinfo_instcertinfo_h handle;
5685 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5686 if (ret != PMINFO_R_OK)
5688 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5689 if (ret != PMINFO_R_OK) {
5690 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5693 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5694 if (ret != PMINFO_R_OK) {
5695 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5698 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5703 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5706 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5707 * @brief This API gets the datacontrol info
5709 * @par This API is for package-manager client application
5710 * @par Sync (or) Async : Synchronous API
5712 * @param[in] providerid pointer to the providerid of dataconltrol.
5713 * @param[in] type pointer to the type of dataconltrol.
5714 * @param[out] appid pointer to hold appid, need to free after using
5715 * @param[out] access pointer to hold access, need to free after using
5716 * @return 0 if success, error code(<0) if fail
5717 * @retval PMINFO_R_OK success
5718 * @retval PMINFO_R_EINVAL invalid argument
5719 * @retval PMINFO_R_ERROR internal error
5722 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5725 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5726 * @brief This API gets the application 'guest mode visibility' value from the DB
5728 * @par This API is for package-manager client application
5729 * @par Sync (or) Async : Synchronous API
5731 * @param[in] handle pointer to application info handle
5732 * @param[out] status pointer to hold app guest mode visibility value
5733 * @return 0 if success, error code(<0) if fail
5734 * @retval PMINFO_R_OK success
5735 * @retval PMINFO_R_EINVAL invalid argument
5736 * @retval PMINFO_R_ERROR internal error
5737 * @pre pkgmgrinfo_appinfo_get_appinfo()
5738 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5739 * @see pkgmgrinfo_appinfo_get_appid()
5740 * @see pkgmgrinfo_appinfo_is_multiple()
5742 static int get_app_guestmode_visibility(const char *appid)
5746 pkgmgrinfo_appinfo_h handle;
5747 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5748 if (ret != PMINFO_R_OK)
5750 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5751 if (ret != PMINFO_R_OK) {
5752 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5755 printf("app guest mode visibility: %d\n", status);
5756 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5761 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5764 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5765 * @brief This API sets the package 'installed_storage' value in db
5767 * @par This API is for package-manager client application
5768 * @par Sync (or) Async : Synchronous API
5770 * @param[in] pkgid pointer to the package ID.
5771 * @param[in] location package install location
5772 * @param[in] external_pkg_path image path if pkg has installed at external storage
5773 * @return 0 if success, error code(<0) if fail
5774 * @retval PMINFO_R_OK success
5775 * @retval PMINFO_R_EINVAL invalid argument
5776 * @retval PMINFO_R_ERROR internal error
5778 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5782 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5783 if (ret != PMINFO_R_OK) {
5790 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
5791 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
5793 /* version compare */
5794 int pkgmgrinfo_compare_package_version(const char *current_version,
5795 const char *target_version, pkgmgrinfo_version_compare_type *res);
5802 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5803 int flag, void *user_data, uid_t uid);
5804 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5805 int flag, void *user_data);
5806 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5807 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5809 int pkgmgrinfo_appinfo_get_installed_list_full(
5810 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5813 * @pkgmgrinfo client API end
5821 #endif /* __PKG_INFO_H__ */