4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
115 /** Integer property for filtering based on package info*/
116 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
145 /** Integer property for filtering app support mode */
146 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
148 /** Boolean property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
169 /** will be updated*/
170 /** string property for filtering based on pkg info*/
171 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
173 /* For multiuser support */
174 const char *getIconPath(uid_t uid, bool readonly);
175 char *getUserPkgParserDBPath(void);
176 char *getUserPkgParserDBPathUID(uid_t uid);
177 char *getUserPkgCertDBPath(void);
178 char *getUserPkgCertDBPathUID(uid_t uid);
179 const char *getUserManifestPath(uid_t uid, bool readonly);
182 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
183 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
184 * @brief This API gets list of installed packages
186 * @par This API is for package-manager client application
187 * @par Sync (or) Async : Synchronous API
188 * @param[in] pkg_list_cb iteration function for list
189 * @param[in] user_data user data to be passed to callback function
190 * @param[in] uid the addressee user id of the instruction
191 * @return 0 if success, error code(<0) if fail
192 * @retval PMINFO_R_OK success
193 * @retval PMINFO_R_EINVAL invalid argument
194 * @retval PMINFO_R_ERROR internal error
198 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
202 pkgid1 = (char *)user_data;
203 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
204 if (strcmp(pkgid1, pkgid2) == 0) {
211 static int list_pkgs()
214 char *name = "helloworld";
215 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
216 if (ret != PMINFO_R_OK) {
223 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
224 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
227 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
228 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
229 * @brief This API gets list of disabled packages
231 * @par This API is for package-manager client application
232 * @par Sync (or) Async : Synchronous API
233 * @param[in] pkg_list_cb iteration function for list
234 * @param[in] user_data user data to be passed to callback function
235 * @param[in] uid the addressee user id of the instruction
236 * @return 0 if success, error code(<0) if fail
237 * @retval PMINFO_R_OK success
238 * @retval PMINFO_R_EINVAL invalid argument
239 * @retval PMINFO_R_ERROR internal error
243 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
244 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
247 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
248 * @brief This API creates the package information handle from db which is not disabled
250 * @par This API is for package-manager client application
251 * @par Sync (or) Async : Synchronous API
253 * @param[in] pkgid pointer to package ID
254 * @param[in] uid the addressee user id of the instruction
255 * @param[out] handle pointer to the package info handle.
256 * @return 0 if success, error code(<0) if fail
257 * @retval PMINFO_R_OK success
258 * @retval PMINFO_R_EINVAL invalid argument
259 * @retval PMINFO_R_ERROR internal error
261 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
262 * @see pkgmgrinfo_pkginfo_get_pkgid()
263 * @see pkgmgrinfo_pkginfo_is_removable()
265 static int get_pkg_type(const char *pkgid)
269 pkgmgrinfo_pkginfo_h handle;
270 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
271 if (ret != PMINFO_R_OK)
273 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
274 if (ret != PMINFO_R_OK) {
275 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
278 printf("pkgtype: %s\n", type);
279 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
284 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
285 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
288 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
289 * @brief This API creates the disabled package information handle from db
291 * @par This API is for package-manager client application
292 * @par Sync (or) Async : Synchronous API
294 * @param[in] pkgid pointer to package ID
295 * @param[in] uid the addressee user id of the instruction
296 * @param[out] handle pointer to the package info handle.
297 * @return 0 if success, error code(<0) if fail
298 * @retval PMINFO_R_OK success
299 * @retval PMINFO_R_EINVAL invalid argument
300 * @retval PMINFO_R_ERROR internal error
302 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
303 * @see pkgmgrinfo_pkginfo_get_pkginfo()
305 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
306 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
309 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
310 * @brief This API creates the package information handle from db regardless of its disable or storage status
312 * @par This API is for package-manager client application
313 * @par Sync (or) Async : Synchronous API
315 * @param[in] pkgid pointer to package ID
316 * @param[in] uid the addressee user id of the instruction
317 * @param[out] handle pointer to the package info handle.
318 * @return 0 if success, error code(<0) if fail
319 * @retval PMINFO_R_OK success
320 * @retval PMINFO_R_EINVAL invalid argument
321 * @retval PMINFO_R_ERROR internal error
323 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
324 * @see pkgmgrinfo_pkginfo_get_pkgid()
325 * @see pkgmgrinfo_pkginfo_is_removable()
327 static int get_pkg_type(const char *pkgid)
331 pkgmgrinfo_pkginfo_h handle;
332 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
333 if (ret != PMINFO_R_OK)
335 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
336 if (ret != PMINFO_R_OK) {
337 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
340 printf("pkgtype: %s\n", type);
341 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
346 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
347 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
350 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
351 * @brief This API gets the package name from the package ID
353 * @par This API is for package-manager client application
354 * @par Sync (or) Async : Synchronous API
356 * @param[in] handle pointer to package info handle
357 * @param[out] pkg_name pointer to hold package name
358 * @return 0 if success, error code(<0) if fail
359 * @retval PMINFO_R_OK success
360 * @retval PMINFO_R_EINVAL invalid argument
361 * @retval PMINFO_R_ERROR internal error
362 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
363 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
364 * @see pkgmgrinfo_pkginfo_get_type()
365 * @see pkgmgrinfo_pkginfo_is_removable()
367 static int get_pkg_name(const char *pkgid)
370 char *pkgname = NULL;
371 pkgmgrinfo_pkginfo_h handle;
372 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
373 if (ret != PMINFO_R_OK)
375 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
376 if (ret != PMINFO_R_OK) {
377 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
380 printf("pkgname: %s\n", pkgname);
381 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
386 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
389 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
390 * @brief This API gets the package id from the package ID
392 * @par This API is for package-manager client application
393 * @par Sync (or) Async : Synchronous API
395 * @param[in] handle pointer to package info handle
396 * @param[out] pkgid pointer to hold package id
397 * @return 0 if success, error code(<0) if fail
398 * @retval PMINFO_R_OK success
399 * @retval PMINFO_R_EINVAL invalid argument
400 * @retval PMINFO_R_ERROR internal error
401 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
402 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
403 * @see pkgmgrinfo_pkginfo_get_type()
404 * @see pkgmgrinfo_pkginfo_is_removable()
406 static int get_pkgid(const char *pkgid)
410 pkgmgrinfo_pkginfo_h handle;
411 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
412 if (ret != PMINFO_R_OK)
414 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
415 if (ret != PMINFO_R_OK) {
416 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
419 printf("pkg id: %s\n", pkg_id);
420 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
425 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
428 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
429 * @brief This API gets the package type from the package ID
431 * @par This API is for package-manager client application
432 * @par Sync (or) Async : Synchronous API
434 * @param[in] handle pointer to package info handle
435 * @param[out] type pointer to hold package type
436 * @return 0 if success, error code(<0) if fail
437 * @retval PMINFO_R_OK success
438 * @retval PMINFO_R_EINVAL invalid argument
439 * @retval PMINFO_R_ERROR internal error
440 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
441 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
442 * @see pkgmgrinfo_pkginfo_get_pkgid()
443 * @see pkgmgrinfo_pkginfo_is_removable()
445 static int get_pkg_type(const char *pkgid)
449 pkgmgrinfo_pkginfo_h handle;
450 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
451 if (ret != PMINFO_R_OK)
453 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
454 if (ret != PMINFO_R_OK) {
455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
458 printf("pkgtype: %s\n", type);
459 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
464 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
467 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
468 * @brief This API gets the package version from the package ID
470 * @par This API is for package-manager client application
471 * @par Sync (or) Async : Synchronous API
473 * @param[in] handle pointer to package info handle
474 * @param[out] version pointer to hold package version
475 * @return 0 if success, error code(<0) if fail
476 * @retval PMINFO_R_OK success
477 * @retval PMINFO_R_EINVAL invalid argument
478 * @retval PMINFO_R_ERROR internal error
479 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
480 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
481 * @see pkgmgrinfo_pkginfo_get_pkgid()
482 * @see pkgmgrinfo_pkginfo_is_removable()
484 static int get_pkg_version(const char *pkgid)
487 char *version = NULL;
488 pkgmgrinfo_pkginfo_h handle;
489 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
490 if (ret != PMINFO_R_OK)
492 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
493 if (ret != PMINFO_R_OK) {
494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
497 printf("pkg version: %s\n", version);
498 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
503 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
506 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
507 * @brief This API gets the package api_version from the package ID
509 * @par This API is for package-manager client application
510 * @par Sync (or) Async : Synchronous API
512 * @param[in] handle pointer to package info handle
513 * @param[out] api_version pointer to hold package api_version
514 * @return 0 if success, error code(<0) if fail
515 * @retval PMINFO_R_OK success
516 * @retval PMINFO_R_EINVAL invalid argument
517 * @retval PMINFO_R_ERROR internal error
518 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
519 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
520 * @see pkgmgrinfo_pkginfo_get_pkgid()
521 * @see pkgmgrinfo_pkginfo_is_removable()
523 static int get_pkg_api_version(const char *pkgid)
526 char *api_version = NULL;
527 pkgmgrinfo_pkginfo_h handle = NULL;
528 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
529 if (ret != PMINFO_R_OK)
531 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
532 if (ret != PMINFO_R_OK) {
533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
536 printf("pkg api_version: %s\n", api_version);
537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
542 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
545 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
546 * @brief This API gets tep(tizen expansion package) file name associated with the package
548 * @par This API is for package-manager client application
549 * @par Sync (or) Async : Synchronous API
551 * @param[in] handle pointer to the pkginfo handle.
552 * @param[out] tep_name pointer to hold tep name
553 * @return 0 if success, error code(<0) if fail
554 * @retval PMINFO_R_OK success
555 * @retval PMINFO_R_EINVAL invalid argument
556 * @retval PMINFO_R_ERROR internal error
557 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
558 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
559 * @see pkgmgrinfo_pkginfo_get_pkgid()
561 static int get_tep_name(const char *pkgid)
564 char *tep_name = NULL;
565 pkgmgrinfo_pkginfo_h handle = NULL;
566 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
567 if (ret != PMINFO_R_OK)
569 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
570 if (ret != PMINFO_R_OK) {
571 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
574 printf("TEP name is: %s\n", tep_name);
575 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
580 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
583 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
584 * @brief This API gets package mount point path associated with the package
585 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
587 * @par This API is for package-manager client application
588 * @par Sync (or) Async : Synchronous API
590 * @param[in] handle pointer to the pkginfo handle.
591 * @param[out] zip_mount_file pointer to hold zip mount file
592 * @return 0 if success, error code(<0) if fail
593 * @retval PMINFO_R_OK success
594 * @retval PMINFO_R_EINVAL invalid argument
595 * @retval PMINFO_R_ERROR internal error
596 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
597 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
598 * @see pkgmgrinfo_pkginfo_get_pkgid()
600 static int get_zip_mount_file(const char *pkgid)
603 char *zip_mount_file = NULL;
604 pkgmgrinfo_pkginfo_h handle = NULL;
605 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
606 if (ret != PMINFO_R_OK)
608 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
609 if (ret != PMINFO_R_OK) {
610 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
613 if (zip_mount_file != NULL)
614 printf("Zip mount path is: %s\n", zip_mount_file);
615 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
623 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
624 * @brief This API gets package external image path associated with the package
625 * if package is installed in external storage.
626 * Otherwise, the return value will be PMINFO_R_ENOENT.
628 * @par This API is for package-manager client application
629 * @par Sync (or) Async : Synchronous API
631 * @param[in] handle pointer to the pkginfo handle.
632 * @param[out] ext_image_path pointer to hold external image path
633 * @return 0 if success, error code(<0) if fail
634 * @retval PMINFO_R_OK success
635 * @retval PMINFO_R_EINVAL invalid argument
636 * @retval PMINFO_R_ERROR internal error
637 * @revall PMINFO_R_ENOENT no valid data
638 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
639 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
640 * @see pkgmgrinfo_pkginfo_get_pkgid()
642 static int get_external_image_path(const char *pkgid)
645 char *ext_image_path = NULL;
646 pkgmgrinfo_pkginfo_h handle = NULL;
647 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
648 if (ret != PMINFO_R_OK)
650 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
651 if (ret != PMINFO_R_OK) {
652 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
655 printf("external image path is: %s\n", ext_image_path);
656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
661 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
664 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
665 * @brief This API gets the package install location from the package ID
667 * @par This API is for package-manager client application
668 * @par Sync (or) Async : Synchronous API
670 * @param[in] handle pointer to package info handle
671 * @param[out] location pointer to hold package install location
672 * @return 0 if success, error code(<0) if fail
673 * @retval PMINFO_R_OK success
674 * @retval PMINFO_R_EINVAL invalid argument
675 * @retval PMINFO_R_ERROR internal error
676 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
677 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
678 * @see pkgmgrinfo_pkginfo_get_pkgid()
679 * @see pkgmgrinfo_pkginfo_is_removable()
681 static int get_pkg_install_location(const char *pkgid)
684 pkgmgrinfo_install_location location;
685 pkgmgrinfo_pkginfo_h handle;
686 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
687 if (ret != PMINFO_R_OK)
689 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
690 if (ret != PMINFO_R_OK) {
691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
694 printf("pkg install location: %d\n", location);
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
700 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
703 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
704 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
705 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
706 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
708 * @par This API is for package-manager client application
709 * @par Sync (or) Async : Synchronous API
711 * @param[in] handle pointer to package info handle
712 * @param[out] size pointer to hold package size
713 * @return 0 if success, error code(<0) if fail
714 * @retval PMINFO_R_OK success
715 * @retval PMINFO_R_EINVAL invalid argument
716 * @retval PMINFO_R_ERROR internal error
717 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
718 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
719 * @see pkgmgrinfo_pkginfo_get_pkgid()
720 * @see pkgmgrinfo_pkginfo_is_removable()
722 static int get_pkg_size(const char *pkgid)
726 pkgmgrinfo_pkginfo_h handle;
727 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
728 if (ret != PMINFO_R_OK)
730 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
731 if (ret != PMINFO_R_OK) {
732 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
735 printf("pkgsize: %d\n", size);
736 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
741 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
744 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
745 * @brief This API gets the package icon from the package ID
747 * @par This API is for package-manager client application
748 * @par Sync (or) Async : Synchronous API
750 * @param[in] handle pointer to package info handle
751 * @param[out] icon pointer to hold package icon
752 * @return 0 if success, error code(<0) if fail
753 * @retval PMINFO_R_OK success
754 * @retval PMINFO_R_EINVAL invalid argument
755 * @retval PMINFO_R_ERROR internal error
756 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
757 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
758 * @see pkgmgrinfo_pkginfo_get_pkgid()
759 * @see pkgmgrinfo_pkginfo_is_removable()
761 static int get_pkg_icon(const char *pkgid)
765 pkgmgrinfo_pkginfo_h handle;
766 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
767 if (ret != PMINFO_R_OK)
769 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
770 if (ret != PMINFO_R_OK) {
771 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
774 printf("pkg icon: %s\n", icon);
775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
780 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
783 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
784 * @brief This API gets the package label from the package ID
786 * @par This API is for package-manager client application
787 * @par Sync (or) Async : Synchronous API
789 * @param[in] handle pointer to package info handle
790 * @param[out] label pointer to hold package label
791 * @return 0 if success, error code(<0) if fail
792 * @retval PMINFO_R_OK success
793 * @retval PMINFO_R_EINVAL invalid argument
794 * @retval PMINFO_R_ERROR internal error
795 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
796 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
797 * @see pkgmgrinfo_pkginfo_get_pkgid()
798 * @see pkgmgrinfo_pkginfo_is_removable()
800 static int get_pkg_label(const char *pkgid)
804 pkgmgrinfo_pkginfo_h handle;
805 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
806 if (ret != PMINFO_R_OK)
808 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
809 if (ret != PMINFO_R_OK) {
810 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
813 printf("pkg label: %s\n", label);
814 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
819 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
822 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
823 * @brief This API gets the package description from the package ID
825 * @par This API is for package-manager client application
826 * @par Sync (or) Async : Synchronous API
828 * @param[in] handle pointer to package info handle
829 * @param[out] description pointer to hold package description
830 * @return 0 if success, error code(<0) if fail
831 * @retval PMINFO_R_OK success
832 * @retval PMINFO_R_EINVAL invalid argument
833 * @retval PMINFO_R_ERROR internal error
834 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
835 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
836 * @see pkgmgrinfo_pkginfo_get_pkgid()
837 * @see pkgmgrinfo_pkginfo_is_removable()
839 static int get_pkg_description(const char *pkgid)
842 char *description = NULL;
843 pkgmgrinfo_pkginfo_h handle;
844 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
845 if (ret != PMINFO_R_OK)
847 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
848 if (ret != PMINFO_R_OK) {
849 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
852 printf("pkg description: %s\n", description);
853 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
858 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
861 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
862 * @brief This API gets the package's author name from the package ID
864 * @par This API is for package-manager client application
865 * @par Sync (or) Async : Synchronous API
867 * @param[in] handle pointer to package info handle
868 * @param[out] author_name pointer to hold package author name
869 * @return 0 if success, error code(<0) if fail
870 * @retval PMINFO_R_OK success
871 * @retval PMINFO_R_EINVAL invalid argument
872 * @retval PMINFO_R_ERROR internal error
873 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
874 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
875 * @see pkgmgrinfo_pkginfo_get_pkgid()
876 * @see pkgmgrinfo_pkginfo_is_removable()
878 static int get_pkg_author_name(const char *pkgid)
881 char *author_name = NULL;
882 pkgmgrinfo_pkginfo_h handle;
883 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
884 if (ret != PMINFO_R_OK)
886 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
887 if (ret != PMINFO_R_OK) {
888 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
891 printf("pkg author name: %s\n", author_name);
892 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
897 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
900 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
901 * @brief This API gets the package's author email from the package ID
903 * @par This API is for package-manager client application
904 * @par Sync (or) Async : Synchronous API
906 * @param[in] handle pointer to package info handle
907 * @param[out] author_email pointer to hold package author email
908 * @return 0 if success, error code(<0) if fail
909 * @retval PMINFO_R_OK success
910 * @retval PMINFO_R_EINVAL invalid argument
911 * @retval PMINFO_R_ERROR internal error
912 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
913 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
914 * @see pkgmgrinfo_pkginfo_get_pkgid()
915 * @see pkgmgrinfo_pkginfo_is_removable()
917 static int get_pkg_author_email(const char *pkgid)
920 char *author_email = NULL;
921 pkgmgrinfo_pkginfo_h handle;
922 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
923 if (ret != PMINFO_R_OK)
925 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
926 if (ret != PMINFO_R_OK) {
927 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
930 printf("pkg author email: %s\n", author_email);
931 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
936 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
939 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
940 * @brief This API gets the package's author href from the package ID
942 * @par This API is for package-manager client application
943 * @par Sync (or) Async : Synchronous API
945 * @param[in] handle pointer to package info handle
946 * @param[out] author_href pointer to hold package author href
947 * @return 0 if success, error code(<0) if fail
948 * @retval PMINFO_R_OK success
949 * @retval PMINFO_R_EINVAL invalid argument
950 * @retval PMINFO_R_ERROR internal error
951 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
952 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
953 * @see pkgmgrinfo_pkginfo_get_pkgid()
954 * @see pkgmgrinfo_pkginfo_is_removable()
956 static int get_pkg_author_href(const char *pkgid)
959 char *author_href = NULL;
960 pkgmgrinfo_pkginfo_h handle;
961 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
962 if (ret != PMINFO_R_OK)
964 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
965 if (ret != PMINFO_R_OK) {
966 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
969 printf("pkg author href: %s\n", author_href);
970 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
975 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
978 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
979 * @brief This API gets the package installed storagae value from the package ID
981 * @par This API is for package-manager client application
982 * @par Sync (or) Async : Synchronous API
984 * @param[in] handle pointer to package info handle
985 * @param[out] storage pointer to hold package installed storage
986 * @return 0 if success, error code(<0) if fail
987 * @retval PMINFO_R_OK success
988 * @retval PMINFO_R_EINVAL invalid argument
989 * @retval PMINFO_R_ERROR internal error
990 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
991 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
992 * @see pkgmgrinfo_pkginfo_get_pkgid()
993 * @see pkgmgrinfo_pkginfo_is_removable()
995 static int get_pkg_installed_storage(const char *pkgid)
998 pkgmgrinfo_installed_storage storage;
999 pkgmgrinfo_pkginfo_h handle;
1000 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1001 if (ret != PMINFO_R_OK)
1003 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1004 if (ret != PMINFO_R_OK) {
1005 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1008 printf("pkg installed storage: %d\n", storage);
1009 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1014 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1017 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1018 * @brief This API gets the installed time of package from the package ID
1020 * @par This API is for package-manager client application
1021 * @par Sync (or) Async : Synchronous API
1023 * @param[in] handle pointer to package info handle
1024 * @param[out] installed_time pointer to hold installed time of package
1025 * @return 0 if success, error code(<0) if fail
1026 * @retval PMINFO_R_OK success
1027 * @retval PMINFO_R_EINVAL invalid argument
1028 * @retval PMINFO_R_ERROR internal error
1029 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1030 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1031 * @see pkgmgrinfo_pkginfo_get_pkgid()
1032 * @see pkgmgrinfo_pkginfo_is_removable()
1034 static int get_pkg_installed_time(const char *pkgid)
1037 int installed_time = 0;
1038 pkgmgrinfo_pkginfo_h handle;
1039 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1040 if (ret != PMINFO_R_OK)
1042 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1043 if (ret != PMINFO_R_OK) {
1044 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1047 printf("installed_time: %d\n", installed_time);
1048 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1053 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1056 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1057 * @brief This API gets the launch mode of package from the package ID
1059 * @par This API is for package-manager client application
1060 * @par Sync (or) Async : Synchronous API
1062 * @param[in] handle pointer to package info handle
1063 * @param[out] mode pointer to hold launch mode of package
1064 * @return 0 if success, error code(<0) if fail
1065 * @retval PMINFO_R_OK success
1066 * @retval PMINFO_R_EINVAL invalid argument
1067 * @retval PMINFO_R_ERROR internal error
1068 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1069 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1070 * @see pkgmgrinfo_pkginfo_get_pkgid()
1071 * @see pkgmgrinfo_pkginfo_is_removable()
1073 static int get_pkg_launch_mode(const char *pkgid)
1076 char *launch_mode = NULL;
1077 pkgmgrinfo_pkginfo_h handle;
1078 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1079 if (ret != PMINFO_R_OK)
1081 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1082 if (ret != PMINFO_R_OK) {
1083 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1086 printf("launch mode: %s\n", mode);
1087 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1092 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1095 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1096 * @brief This API gets the store client id of package from the package ID
1098 * @par This API is for package-manager client application
1099 * @par Sync (or) Async : Synchronous API
1101 * @param[in] handle pointer to package info handle
1102 * @param[out] storeclientid pointer to hold store client id of package
1103 * @return 0 if success, error code(<0) if fail
1104 * @retval PMINFO_R_OK success
1105 * @retval PMINFO_R_EINVAL invalid argument
1106 * @retval PMINFO_R_ERROR internal error
1107 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1108 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1109 * @see pkgmgrinfo_pkginfo_get_pkgid()
1110 * @see pkgmgrinfo_pkginfo_is_removable()
1112 static int get_pkg_storeclientid(const char *pkgid)
1115 char *storeclientid = 0;
1116 pkgmgrinfo_pkginfo_h handle;
1117 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1118 if (ret != PMINFO_R_OK)
1120 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1121 if (ret != PMINFO_R_OK) {
1122 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1125 printf(store client id: %s\n", storeclientid);
1126 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1131 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1134 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1135 * @brief This API gets the main app id of package from the package ID
1137 * @par This API is for package-manager client application
1138 * @par Sync (or) Async : Synchronous API
1140 * @param[in] handle pointer to package info handle
1141 * @param[out] mainappid pointer to hold main app id of package
1142 * @return 0 if success, error code(<0) if fail
1143 * @retval PMINFO_R_OK success
1144 * @retval PMINFO_R_EINVAL invalid argument
1145 * @retval PMINFO_R_ERROR internal error
1146 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1147 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1148 * @see pkgmgrinfo_pkginfo_get_pkgid()
1149 * @see pkgmgrinfo_pkginfo_is_removable()
1151 static int get_pkg_mainappid(const char *pkgid)
1154 char *mainappid = 0;
1155 pkgmgrinfo_pkginfo_h handle;
1156 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1157 if (ret != PMINFO_R_OK)
1159 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1160 if (ret != PMINFO_R_OK) {
1161 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1164 printf(main app id: %s\n", mainappid);
1165 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1170 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1173 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1174 * @brief This API gets the url of package from the package ID
1176 * @par This API is for package-manager client application
1177 * @par Sync (or) Async : Synchronous API
1179 * @param[in] handle pointer to package info handle
1180 * @param[out] url pointer to hold url of package
1181 * @return 0 if success, error code(<0) if fail
1182 * @retval PMINFO_R_OK success
1183 * @retval PMINFO_R_EINVAL invalid argument
1184 * @retval PMINFO_R_ERROR internal error
1185 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1186 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1187 * @see pkgmgrinfo_pkginfo_get_pkgid()
1188 * @see pkgmgrinfo_pkginfo_is_removable()
1190 static int get_pkg_url(const char *pkgid)
1194 pkgmgrinfo_pkginfo_h handle;
1195 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1196 if (ret != PMINFO_R_OK)
1198 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1199 if (ret != PMINFO_R_OK) {
1200 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1203 printf("url : %s\n", url);
1204 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1209 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1212 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1213 * @brief This API gets the root path of package
1215 * @par Sync (or) Async : Synchronous API
1217 * @param[in] handle pointer to package info handle
1218 * @param[out] path pointer to hold root path of package
1219 * @return 0 if success, error code(<0) if fail
1220 * @retval PMINFO_R_OK success
1221 * @retval PMINFO_R_EINVAL invalid argument
1222 * @retval PMINFO_R_ERROR internal error
1224 static int get_root_path(const char *pkgid)
1228 pkgmgrinfo_pkginfo_h handle;
1229 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1230 if (ret != PMINFO_R_OK)
1233 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1234 if (ret != PMINFO_R_OK) {
1235 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1238 printf("path : %s\n", path);
1239 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1245 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1249 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1250 * @brief This API gets the csc path of package
1252 * @par Sync (or) Async : Synchronous API
1254 * @param[in] handle pointer to package info handle
1255 * @param[out] path pointer to hold csc path of package
1256 * @return 0 if success, error code(<0) if fail
1257 * @retval PMINFO_R_OK success
1258 * @retval PMINFO_R_EINVAL invalid argument
1259 * @retval PMINFO_R_ERROR internal error
1261 static int get_csc_path(const char *pkgid)
1265 pkgmgrinfo_pkginfo_h handle;
1266 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1267 if (ret != PMINFO_R_OK)
1270 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1271 if (ret != PMINFO_R_OK) {
1272 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1275 printf("path : %s\n", path);
1276 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1282 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1285 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1286 * @brief This API gets the support_mode of package
1288 * @par Sync (or) Async : Synchronous API
1290 * @param[in] handle pointer to package info handle
1291 * @param[out] support_mode pointer to hold support_mode of package
1292 * @return 0 if success, error code(<0) if fail
1293 * @retval PMINFO_R_OK success
1294 * @retval PMINFO_R_EINVAL invalid argument
1295 * @retval PMINFO_R_ERROR internal error
1297 static int get_support_mode(const char *pkgid)
1300 int support_mode = 0;
1301 pkgmgrinfo_pkginfo_h handle = NULL;
1302 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1303 if (ret != PMINFO_R_OK)
1306 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1307 if (ret != PMINFO_R_OK) {
1308 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1311 printf("support_mode : %s\n", support_mode);
1312 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1318 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1321 * @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1322 * @brief This API compare the cert information from given package id
1324 * @par This API is for package-manager client application
1325 * @par Sync (or) Async : Synchronous API
1327 * @param[in] lhs_package_id pointer to first package ID
1328 * @param[in] rhs_package_id pointer to second package ID
1329 * @param[out] compare_result pointer to the compare result.
1330 * @return 0 if success, error code(<0) if fail
1331 * @retval PMINFO_R_OK success
1332 * @retval PMINFO_R_EINVAL invalid argument
1333 * @retval PMINFO_R_ERROR internal error
1335 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1336 * @see pkgmgrinfo_pkginfo_get_pkgid()
1337 * @see pkgmgrinfo_pkginfo_is_removable()
1339 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1342 pkgmgrinfo_cert_compare_result_type_e result;
1344 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1345 if (ret != PMINFO_R_OK) {
1348 printf("result: %d\n", result);
1353 int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1354 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1356 * @fn int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1357 * @brief This API compare the cert information from given app id
1359 * @par This API is for package-manager client application
1360 * @par Sync (or) Async : Synchronous API
1362 * @param[in] lhs_app_id pointer to first app ID
1363 * @param[in] rhs_app_id pointer to second app ID
1364 * @param[out] compare_result pointer to the compare result.
1365 * @return 0 if success, error code(<0) if fail
1366 * @retval PMINFO_R_OK success
1367 * @retval PMINFO_R_EINVAL invalid argument
1368 * @retval PMINFO_R_ERROR internal error
1370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1371 * @see pkgmgrinfo_pkginfo_get_pkgid()
1372 * @see pkgmgrinfo_pkginfo_is_removable()
1374 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1377 pkgmgrinfo_cert_compare_result_type_e result;
1379 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1380 if (ret != PMINFO_R_OK) {
1383 printf("result: %d\n", result);
1388 int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1389 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1391 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1392 * @brief This API gets the package 'removable' value from the package ID
1394 * @par This API is for package-manager client application
1395 * @par Sync (or) Async : Synchronous API
1397 * @param[in] handle pointer to package info handle
1398 * @param[out] removable pointer to hold package removable value
1399 * @return 0 if success, error code(<0) if fail
1400 * @retval PMINFO_R_OK success
1401 * @retval PMINFO_R_EINVAL invalid argument
1402 * @retval PMINFO_R_ERROR internal error
1403 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1404 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1405 * @see pkgmgrinfo_pkginfo_get_pkgid()
1406 * @see pkgmgrinfo_pkginfo_is_readonly()
1408 static int get_pkg_removable(const char *pkgid)
1412 pkgmgrinfo_pkginfo_h handle;
1413 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1414 if (ret != PMINFO_R_OK)
1416 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1417 if (ret != PMINFO_R_OK) {
1418 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1421 printf("pkg removable: %d\n", removable);
1422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1427 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1430 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1431 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1433 * @par This API is for package-manager client application
1434 * @par Sync (or) Async : Synchronous API
1436 * @param[in] handle pointer to package info handle
1437 * @param[out] movable pointer to hold package movable state
1438 * @return 0 if success, error code(<0) if fail
1439 * @retval PMINFO_R_OK success
1440 * @retval PMINFO_R_EINVAL invalid argument
1441 * @retval PMINFO_R_ERROR internal error
1442 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1443 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1444 * @see pkgmgrinfo_pkginfo_get_pkgid()
1446 static int get_pkg_movable(const char *pkgid)
1450 pkgmgrinfo_pkginfo_h handle;
1451 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1452 if (ret != PMINFO_R_OK)
1454 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1455 if (ret != PMINFO_R_OK) {
1456 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1459 printf("pkg movable: %d\n", movable);
1460 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1465 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1468 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1469 * @brief This API gets the package 'preload' value from the package ID
1471 * @par This API is for package-manager client application
1472 * @par Sync (or) Async : Synchronous API
1474 * @param[in] handle pointer to package info handle
1475 * @param[out] preload pointer to hold package preload value
1476 * @return 0 if success, error code(<0) if fail
1477 * @retval PMINFO_R_OK success
1478 * @retval PMINFO_R_EINVAL invalid argument
1479 * @retval PMINFO_R_ERROR internal error
1480 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1481 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1482 * @see pkgmgrinfo_pkginfo_get_pkgid()
1483 * @see pkgmgrinfo_pkginfo_is_readonly()
1485 static int get_pkg_preload(const char *pkgid)
1489 pkgmgrinfo_pkginfo_h handle;
1490 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1491 if (ret != PMINFO_R_OK)
1493 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1494 if (ret != PMINFO_R_OK) {
1495 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1498 printf("pkg preload: %d\n", preload);
1499 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1504 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1507 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1508 * @brief This API gets the value for given handle is system or not
1510 * @par This API is for package-manager client application
1511 * @par Sync (or) Async : Synchronous API
1513 * @param[in] handle pointer to package info handle
1514 * @param[out] system pointer to hold system is or not
1515 * @return 0 if success, error code(<0) if fail
1516 * @retval PMINFO_R_OK success
1517 * @retval PMINFO_R_EINVAL invalid argument
1518 * @retval PMINFO_R_ERROR internal error
1519 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1520 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1521 * @see pkgmgrinfo_pkginfo_get_pkgid()
1522 * @see pkgmgrinfo_pkginfo_is_readonly()
1524 static int get_pkg_system(const char *pkgid)
1527 bool system = false;
1528 pkgmgrinfo_pkginfo_h handle = NULL;
1529 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1530 if (ret != PMINFO_R_OK)
1532 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1533 if (ret != PMINFO_R_OK) {
1534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1537 printf("pkg system: %d\n", system);
1538 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1543 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1546 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1547 * @brief This API gets the package 'readonly' value from the package ID
1549 * @par This API is for package-manager client application
1550 * @par Sync (or) Async : Synchronous API
1552 * @param[in] handle pointer to package info handle
1553 * @param[out] readonly pointer to hold package readonly value
1554 * @return 0 if success, error code(<0) if fail
1555 * @retval PMINFO_R_OK success
1556 * @retval PMINFO_R_EINVAL invalid argument
1557 * @retval PMINFO_R_ERROR internal error
1558 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1559 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1560 * @see pkgmgrinfo_pkginfo_get_pkgid()
1561 * @see pkgmgrinfo_pkginfo_is_removable()
1563 static int get_pkg_readonly(const char *pkgid)
1567 pkgmgrinfo_pkginfo_h handle;
1568 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1569 if (ret != PMINFO_R_OK)
1571 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1572 if (ret != PMINFO_R_OK) {
1573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1576 printf("pkg readonly: %d\n", readonly);
1577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1582 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1586 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1587 * @brief This API gets the package 'upate' value from the package ID
1589 * @par This API is for package-manager client application
1590 * @par Sync (or) Async : Synchronous API
1592 * @param[in] handle pointer to package info handle
1593 * @param[out] update pointer to hold package update value
1594 * @return 0 if success, error code(<0) if fail
1595 * @retval PMINFO_R_OK success
1596 * @retval PMINFO_R_EINVAL invalid argument
1597 * @retval PMINFO_R_ERROR internal error
1598 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1599 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1600 * @see pkgmgrinfo_pkginfo_get_pkgid()
1602 static int get_pkg_update(const char *pkgid)
1606 pkgmgrinfo_pkginfo_h handle;
1607 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1608 if (ret != PMINFO_R_OK)
1610 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1611 if (ret != PMINFO_R_OK) {
1612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1615 printf("pkg update: %d\n", update);
1616 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1621 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1624 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1625 * @brief This API gets the package 'support_disable' value from the package ID
1627 * @par This API is for package-manager client application
1628 * @par Sync (or) Async : Synchronous API
1630 * @param[in] handle pointer to package info handle
1631 * @param[out] support_disable pointer to hold package support_disable value
1632 * @return 0 if success, error code(<0) if fail
1633 * @retval PMINFO_R_OK success
1634 * @retval PMINFO_R_EINVAL invalid argument
1635 * @retval PMINFO_R_ERROR internal error
1636 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1637 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1638 * @see pkgmgrinfo_pkginfo_get_pkgid()
1640 static int get_pkg_support_disable(const char *pkgid)
1643 bool support_disable;
1644 pkgmgrinfo_pkginfo_h handle = NULL;
1645 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1646 if (ret != PMINFO_R_OK)
1648 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1649 if (ret != PMINFO_R_OK) {
1650 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1653 printf("pkg support_disable: %d\n", support_disable);
1654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1659 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1662 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1663 * @brief This API gets whethere the given package is global package or user package
1665 * @par This API is for package-manager client application
1666 * @par Sync (or) Async : Synchronous API
1668 * @param[in] handle pointer to package info handle
1669 * @param[in] global pointer to hold package global value
1670 * @return 0 if success, error code(<0) if fail
1671 * @retval PMINFO_R_OK success
1672 * @retval PMINFO_R_EINVAL invalid argument
1673 * @retval PMINFO_R_ERROR internal error
1674 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1675 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1676 * @see pkgmgrinfo_pkginfo_get_pkgid()
1677 static int get_pkg_support_disable(const char *pkgid)
1681 pkgmgrinfo_pkginfo_h handle = NULL;
1682 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1683 if (ret != PMINFO_R_OK)
1685 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1686 if (ret != PMINFO_R_OK) {
1687 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1690 printf("pkg is_global: %d\n", global);
1691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1696 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1699 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1700 * @brief This API gets the package 'accessible' value from the package ID
1702 * @par This API is for package-manager client application
1703 * @par Sync (or) Async : Synchronous API
1705 * @param[in] handle pointer to package info handle
1706 * @param[out] accessible pointer to hold package accessible value
1707 * @return 0 if success, error code(<0) if fail
1708 * @retval PMINFO_R_OK success
1709 * @retval PMINFO_R_EINVAL invalid argument
1710 * @retval PMINFO_R_ERROR internal error
1711 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1712 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1713 * @see pkgmgrinfo_pkginfo_get_pkgid()
1714 * @see pkgmgrinfo_pkginfo_is_readonly()
1716 static int get_pkg_accessible(const char *pkgid)
1720 pkgmgrinfo_pkginfo_h handle;
1721 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1722 if (ret != PMINFO_R_OK)
1724 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1725 if (ret != PMINFO_R_OK) {
1726 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1729 printf("pkg accessible: %d\n", accessible);
1730 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1735 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1738 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1739 * @brief This API destroys the package information handle freeing up all the resources
1741 * @par This API is for package-manager client application
1742 * @par Sync (or) Async : Synchronous API
1744 * @param[in] handle pointer to the package info handle
1745 * @return 0 if success, error code(<0) if fail
1746 * @retval PMINFO_R_OK success
1747 * @retval PMINFO_R_EINVAL invalid argument
1748 * @retval PMINFO_R_ERROR internal error
1749 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1751 * @see pkgmgrinfo_pkginfo_get_pkgid()
1752 * @see pkgmgrinfo_pkginfo_is_removable()
1754 static int get_pkg_type(const char *pkgid)
1758 pkgmgrinfo_pkginfo_h handle;
1759 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1760 if (ret != PMINFO_R_OK)
1762 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1763 if (ret != PMINFO_R_OK) {
1764 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1767 printf("pkgtype: %s\n", type);
1768 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1773 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1776 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1777 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1778 The query will search the entire package information collected from the manifest file of all the installed packages
1780 * @par This API is for package-manager client application
1781 * @par Sync (or) Async : Synchronous API
1783 * @param[out] handle pointer to the package info filter handle.
1784 * @return 0 if success, error code(<0) if fail
1785 * @retval PMINFO_R_OK success
1786 * @retval PMINFO_R_EINVAL invalid argument
1787 * @retval PMINFO_R_ERROR internal error
1789 * @post pkgmgrinfo_pkginfo_filter_destroy()
1790 * @see pkgmgrinfo_pkginfo_filter_count()
1791 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1793 static int get_tpk_pkg_count()
1797 pkgmgrinfo_pkginfo_filter_h handle;
1798 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1799 if (ret != PMINFO_R_OK)
1801 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1802 if (ret != PMINFO_R_OK) {
1803 pkgmgrinfo_pkginfo_filter_destroy(handle);
1806 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1807 if (ret != PMINFO_R_OK) {
1808 pkgmgrinfo_pkginfo_filter_destroy(handle);
1811 printf("No of tpk pkgs: %d\n", count);
1812 pkgmgrinfo_pkginfo_filter_destroy(handle);
1817 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1820 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1821 * @brief This API destroys the package information filter handle freeing up all the resources
1823 * @par This API is for package-manager client application
1824 * @par Sync (or) Async : Synchronous API
1826 * @param[in] handle pointer to the package info filter handle.
1827 * @return 0 if success, error code(<0) if fail
1828 * @retval PMINFO_R_OK success
1829 * @retval PMINFO_R_EINVAL invalid argument
1830 * @retval PMINFO_R_ERROR internal error
1831 * @pre pkgmgrinfo_pkginfo_filter_create()
1833 * @see pkgmgrinfo_pkginfo_filter_count()
1834 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1836 static int get_tpk_pkg_count()
1840 pkgmgrinfo_pkginfo_filter_h handle;
1841 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1842 if (ret != PMINFO_R_OK)
1844 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1845 if (ret != PMINFO_R_OK) {
1846 pkgmgrinfo_pkginfo_filter_destroy(handle);
1849 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1850 if (ret != PMINFO_R_OK) {
1851 pkgmgrinfo_pkginfo_filter_destroy(handle);
1854 printf("No of tpk pkgs: %d\n", count);
1855 pkgmgrinfo_pkginfo_filter_destroy(handle);
1860 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1863 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1864 * @brief This API adds a boolean filter property to the filter handle
1866 * @par This API is for package-manager client application
1867 * @par Sync (or) Async : Synchronous API
1869 * @param[in] handle pointer to the package info filter handle.
1870 * @param[in] property boolean property name.
1871 * @param[in] value value corresponding to the property.
1872 * @return 0 if success, error code(<0) if fail
1873 * @retval PMINFO_R_OK success
1874 * @retval PMINFO_R_EINVAL invalid argument
1875 * @retval PMINFO_R_ERROR internal error
1876 * @pre pkgmgrinfo_pkginfo_filter_create()
1877 * @post pkgmgrinfo_pkginfo_filter_destroy()
1878 * @see pkgmgrinfo_pkginfo_filter_count()
1879 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1881 static int get_preload_pkg_count()
1885 pkgmgrinfo_pkginfo_filter_h handle;
1886 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1887 if (ret != PMINFO_R_OK)
1889 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1890 if (ret != PMINFO_R_OK) {
1891 pkgmgrinfo_pkginfo_filter_destroy(handle);
1894 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1895 if (ret != PMINFO_R_OK) {
1896 pkgmgrinfo_pkginfo_filter_destroy(handle);
1899 printf("No of preload pkgs: %d\n", count);
1900 pkgmgrinfo_pkginfo_filter_destroy(handle);
1905 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1906 const char *property, const bool value);
1909 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1910 * @brief This API adds an integer filter property to the filter handle
1912 * @par This API is for package-manager client application
1913 * @par Sync (or) Async : Synchronous API
1915 * @param[in] handle pointer to the package info filter handle.
1916 * @param[in] property integer property name.
1917 * @param[in] value value corresponding to the property.
1918 * @return 0 if success, error code(<0) if fail
1919 * @retval PMINFO_R_OK success
1920 * @retval PMINFO_R_EINVAL invalid argument
1921 * @retval PMINFO_R_ERROR internal error
1922 * @pre pkgmgrinfo_pkginfo_filter_create()
1923 * @post pkgmgrinfo_pkginfo_filter_destroy()
1924 * @see pkgmgrinfo_pkginfo_filter_count()
1925 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1927 static int get_pkg_count()
1931 pkgmgrinfo_pkginfo_filter_h handle;
1932 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1933 if (ret != PMINFO_R_OK)
1935 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1936 if (ret != PMINFO_R_OK) {
1937 pkgmgrinfo_pkginfo_filter_destroy(handle);
1940 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1941 if (ret != PMINFO_R_OK) {
1942 pkgmgrinfo_pkginfo_filter_destroy(handle);
1945 printf("No of preload pkgs: %d\n", count);
1946 pkgmgrinfo_pkginfo_filter_destroy(handle);
1951 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1952 const char *property, const int value);
1955 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1956 * @brief This API adds a string filter property to the filter handle
1958 * @par This API is for package-manager client application
1959 * @par Sync (or) Async : Synchronous API
1961 * @param[in] handle pointer to the package info filter handle.
1962 * @param[in] property string property name.
1963 * @param[in] value value corresponding to the property.
1964 * @return 0 if success, error code(<0) if fail
1965 * @retval PMINFO_R_OK success
1966 * @retval PMINFO_R_EINVAL invalid argument
1967 * @retval PMINFO_R_ERROR internal error
1968 * @pre pkgmgrinfo_pkginfo_filter_create()
1969 * @post pkgmgrinfo_pkginfo_filter_destroy()
1970 * @see pkgmgrinfo_pkginfo_filter_count()
1971 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1973 static int get_tpk_pkg_count()
1977 pkgmgrinfo_pkginfo_filter_h handle;
1978 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1979 if (ret != PMINFO_R_OK)
1981 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1982 if (ret != PMINFO_R_OK) {
1983 pkgmgrinfo_pkginfo_filter_destroy(handle);
1986 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1987 if (ret != PMINFO_R_OK) {
1988 pkgmgrinfo_pkginfo_filter_destroy(handle);
1991 printf("No of tpk pkgs: %d\n", count);
1992 pkgmgrinfo_pkginfo_filter_destroy(handle);
1997 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1998 const char *property, const char *value);
2001 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2002 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2004 * @par This API is for package-manager client application
2005 * @par Sync (or) Async : Synchronous API
2007 * @param[in] handle pointer to the package info filter handle.
2008 * @param[in] pkg_cb callback function.
2009 * @param[in] user_data user data to be passed to the callback function
2010 * @return 0 if success, error code(<0) if fail
2011 * @retval PMINFO_R_OK success
2012 * @retval PMINFO_R_EINVAL invalid argument
2013 * @retval PMINFO_R_ERROR internal error
2014 * @pre pkgmgrinfo_pkginfo_filter_create()
2015 * @post pkgmgrinfo_pkginfo_filter_destroy()
2016 * @see pkgmgrinfo_pkginfo_filter_count()
2018 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2021 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2022 printf("pkg id : %s\n", pkgid);
2026 static int get_tpk_pkg_list()
2029 pkgmgrinfo_pkginfo_filter_h handle;
2030 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2031 if (ret != PMINFO_R_OK)
2033 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2034 if (ret != PMINFO_R_OK) {
2035 pkgmgrinfo_pkginfo_filter_destroy(handle);
2038 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2039 if (ret != PMINFO_R_OK) {
2040 pkgmgrinfo_pkginfo_filter_destroy(handle);
2043 pkgmgrinfo_pkginfo_filter_destroy(handle);
2048 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2049 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2050 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2051 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2054 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2055 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2056 * @brief This API counts the package that satisfy the filter conditions
2058 * @par This API is for package-manager client application
2059 * @par Sync (or) Async : Synchronous API
2061 * @param[in] handle pointer to the package info filter handle.
2062 * @param[in] count pointer to store the count value.
2063 * @param[in] uid the addressee user id of the instruction
2064 * @return 0 if success, error code(<0) if fail
2065 * @retval PMINFO_R_OK success
2066 * @retval PMINFO_R_EINVAL invalid argument
2067 * @retval PMINFO_R_ERROR internal error
2068 * @pre pkgmgrinfo_pkginfo_filter_create()
2069 * @post pkgmgrinfo_pkginfo_filter_destroy()
2070 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2072 static int get_tpk_pkg_count()
2076 pkgmgrinfo_pkginfo_filter_h handle;
2077 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2078 if (ret != PMINFO_R_OK)
2080 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2081 if (ret != PMINFO_R_OK) {
2082 pkgmgrinfo_pkginfo_filter_destroy(handle);
2085 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2086 if (ret != PMINFO_R_OK) {
2087 pkgmgrinfo_pkginfo_filter_destroy(handle);
2090 printf("No of tpk pkgs: %d\n", count);
2091 pkgmgrinfo_pkginfo_filter_destroy(handle);
2096 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2097 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2099 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2100 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2101 * @brief This API gets the list of privilege for a particular package
2103 * @par This API is for package-manager client application
2104 * @par Sync (or) Async : Synchronous API
2105 * @param[in] handle pointer to the package info handle.
2106 * @param[in] privilege_func callback function for list
2107 * @param[in] user_data user data to be passed to callback function
2108 * @return 0 if success, error code(<0) if fail
2109 * @retval PMINFO_R_OK success
2110 * @retval PMINFO_R_EINVAL invalid argument
2111 * @retval PMINFO_R_ERROR internal error
2112 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2113 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2115 int privilege_func(const char *name, void *user_data)
2117 if (strcmp(name, (char *)user_data) == 0)
2123 static int list_privilege(const char *package, char *privilege)
2126 pkgmgrinfo_pkginfo_h handle;
2127 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2128 if (ret != PMINFO_R_OK)
2130 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2131 if (ret != PMINFO_R_OK) {
2132 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2135 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2140 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2141 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2143 /* TODO: add doxygen comment here */
2144 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2147 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2148 * @brief This API copy the application information handle
2150 * @par This API is for package-manager client application
2151 * @par Sync (or) Async : Synchronous API
2153 * @param[in] handle pointer to the package info handle.
2154 * @param[out] handle pointer to the package info handle.
2155 * @return 0 if success, error code(<0) if fail
2156 * @retval PMINFO_R_OK success
2157 * @retval PMINFO_R_EINVAL invalid argument
2158 * @retval PMINFO_R_ERROR internal error
2160 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2162 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2166 pkgmgrinfo_pkginfo_h clone;
2168 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2169 if (ret != PMINFO_R_OK)
2173 printf("package: %s\n", clone->package);
2174 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2179 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2183 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2184 pkgmgrinfo_app_list_cb app_func, void *user_data)
2185 * @brief This API gets list of installed applications for a particular package
2187 * @par This API is for package-manager client application
2188 * @par Sync (or) Async : Synchronous API
2189 * @param[in] handle package info handle
2190 * @param[in] component application component
2191 * @param[in] app_func iteration function for list
2192 * @param[in] user_data user data to be passed to callback function
2193 * @return 0 if success, error code(<0) if fail
2194 * @retval PMINFO_R_OK success
2195 * @retval PMINFO_R_EINVAL invalid argument
2196 * @retval PMINFO_R_ERROR internal error
2197 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2198 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2200 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2203 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2204 printf("appid : %s\n", appid);
2208 static int list_apps(const char *pkgid)
2211 pkgmgrinfo_pkginfo_h handle;
2212 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2213 if (ret != PMINFO_R_OK)
2215 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2216 if (ret != PMINFO_R_OK) {
2217 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2220 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2225 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2226 pkgmgrinfo_app_list_cb app_func, void *user_data);
2227 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2228 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2231 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2232 * @brief This API gets list of installed applications from all packages with minimum informaion.
2234 * @par This API is for package-manager client application
2235 * @par Sync (or) Async : Synchronous API
2236 * @param[in] app_func iteration function for list
2237 * @param[in] user_data user data to be passed to callback function
2238 * @return 0 if success, error code(<0) if fail
2239 * @retval PMINFO_R_OK success
2240 * @retval PMINFO_R_EINVAL invalid argument
2241 * @retval PMINFO_R_ERROR internal error
2245 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2247 char *pkgid1 = NULL;
2248 char *pkgid2 = NULL;
2249 pkgid1 = (char *)user_data;
2250 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2251 if (strcmp(pkgid1, pkgid2) == 0) {
2258 static int list_apps()
2261 char *name = "helloworld";
2262 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2263 if (ret != PMINFO_R_OK) {
2270 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2271 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2274 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2275 * @brief This API gets list of installed applications from all packages.
2277 * @par This API is for package-manager client application
2278 * @par Sync (or) Async : Synchronous API
2279 * @param[in] app_func iteration function for list
2280 * @param[in] user_data user data to be passed to callback function
2281 * @return 0 if success, error code(<0) if fail
2282 * @retval PMINFO_R_OK success
2283 * @retval PMINFO_R_EINVAL invalid argument
2284 * @retval PMINFO_R_ERROR internal error
2288 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2290 char *pkgid1 = NULL;
2291 char *pkgid2 = NULL;
2292 pkgid1 = (char *)user_data;
2293 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2294 if (strcmp(pkgid1, pkgid2) == 0) {
2301 static int list_apps()
2304 char *name = "helloworld";
2305 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2306 if (ret != PMINFO_R_OK) {
2313 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2314 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2317 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2318 * @brief This API creates the disabled application information handle from db
2320 * @par This API is for package-manager client application
2321 * @par Sync (or) Async : Synchronous API
2323 * @param[in] appid pointer to appid
2324 * @param[out] handle pointer to the application info handle.
2325 * @return 0 if success, error code(<0) if fail
2326 * @retval PMINFO_R_OK success
2327 * @retval PMINFO_R_EINVAL invalid argument
2328 * @retval PMINFO_R_ERROR internal error
2330 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2331 * @see pkgmgrinfo_appinfo_get_pkgid()
2332 * @see pkgmgrinfo_appinfo_is_multiple()
2334 static int get_disabled_app_type(const char *appid)
2338 pkgmgrinfo_appinfo_h handle;
2339 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2340 if (ret != PMINFO_R_OK)
2342 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2343 if (ret != PMINFO_R_OK) {
2344 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2347 printf("apptype: %s\n", type);
2348 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2353 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2354 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2357 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2358 * @brief This API creates the application information handle from db
2360 * @par This API is for package-manager client application
2361 * @par Sync (or) Async : Synchronous API
2363 * @param[in] appid pointer to appid
2364 * @param[out] handle pointer to the application info handle.
2365 * @return 0 if success, error code(<0) if fail
2366 * @retval PMINFO_R_OK success
2367 * @retval PMINFO_R_EINVAL invalid argument
2368 * @retval PMINFO_R_ERROR internal error
2370 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2371 * @see pkgmgrinfo_appinfo_get_pkgid()
2372 * @see pkgmgrinfo_appinfo_is_multiple()
2374 static int get_app_type(const char *appid)
2378 pkgmgrinfo_appinfo_h handle;
2379 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2380 if (ret != PMINFO_R_OK)
2382 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2383 if (ret != PMINFO_R_OK) {
2384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2387 printf("apptype: %s\n", type);
2388 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2393 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2394 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2397 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2398 * @brief This API creates the application information handle from db regardless of its disable or storage status
2400 * @par This API is for package-manager client application
2401 * @par Sync (or) Async : Synchronous API
2403 * @param[in] appid pointer to appid
2404 * @param[out] handle pointer to the application info handle.
2405 * @return 0 if success, error code(<0) if fail
2406 * @retval PMINFO_R_OK success
2407 * @retval PMINFO_R_EINVAL invalid argument
2408 * @retval PMINFO_R_ERROR internal error
2410 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2411 * @see pkgmgrinfo_appinfo_get_pkgid()
2412 * @see pkgmgrinfo_appinfo_is_multiple()
2414 static int get_app_type(const char *appid)
2418 pkgmgrinfo_appinfo_h handle;
2419 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2420 if (ret != PMINFO_R_OK)
2422 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2423 if (ret != PMINFO_R_OK) {
2424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2427 printf("apptype: %s\n", type);
2428 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2433 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2434 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2437 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2438 * @brief This API gets the application ID
2440 * @par This API is for package-manager client application
2441 * @par Sync (or) Async : Synchronous API
2443 * @param[in] handle pointer to the application info handle.
2444 * @param[out] appid pointer to hold appid
2445 * @return 0 if success, error code(<0) if fail
2446 * @retval PMINFO_R_OK success
2447 * @retval PMINFO_R_EINVAL invalid argument
2448 * @retval PMINFO_R_ERROR internal error
2449 * @pre pkgmgrinfo_appinfo_get_appinfo()
2450 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2451 * @see pkgmgrinfo_appinfo_get_pkgid()
2452 * @see pkgmgrinfo_appinfo_is_multiple()
2454 static int get_app_id(const char *appid)
2457 char *app_id = NULL;
2458 pkgmgrinfo_appinfo_h handle;
2459 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2460 if (ret != PMINFO_R_OK)
2462 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2463 if (ret != PMINFO_R_OK) {
2464 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2467 printf("app id: %s\n", app_id);
2468 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2473 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2476 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2477 * @brief This API gets the package name of the application
2479 * @par This API is for package-manager client application
2480 * @par Sync (or) Async : Synchronous API
2482 * @param[in] handle pointer to the application info handle.
2483 * @param[out] pkg_name pointer to hold package name
2484 * @return 0 if success, error code(<0) if fail
2485 * @retval PMINFO_R_OK success
2486 * @retval PMINFO_R_EINVAL invalid argument
2487 * @retval PMINFO_R_ERROR internal error
2488 * @pre pkgmgrinfo_appinfo_get_appinfo()
2489 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2490 * @see pkgmgrinfo_appinfo_get_appid()
2491 * @see pkgmgrinfo_appinfo_is_multiple()
2493 static int get_app_pkgname(const char *appid)
2496 char *pkgname = NULL;
2497 pkgmgrinfo_appinfo_h handle;
2498 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2499 if (ret != PMINFO_R_OK)
2501 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2502 if (ret != PMINFO_R_OK) {
2503 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2506 printf("pkg name: %s\n", pkgname);
2507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2512 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2515 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2516 * @brief This API gets the package id of the application
2518 * @par This API is for package-manager client application
2519 * @par Sync (or) Async : Synchronous API
2521 * @param[in] handle pointer to the application info handle.
2522 * @param[out] pkgid pointer to hold package id
2523 * @return 0 if success, error code(<0) if fail
2524 * @retval PMINFO_R_OK success
2525 * @retval PMINFO_R_EINVAL invalid argument
2526 * @retval PMINFO_R_ERROR internal error
2527 * @pre pkgmgrinfo_appinfo_get_appinfo()
2528 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2529 * @see pkgmgrinfo_appinfo_get_appid()
2530 * @see pkgmgrinfo_appinfo_is_multiple()
2532 static int get_app_pkgid(const char *appid)
2536 pkgmgrinfo_appinfo_h handle;
2537 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2538 if (ret != PMINFO_R_OK)
2540 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2541 if (ret != PMINFO_R_OK) {
2542 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2545 printf("pkg id: %s\n", pkgid);
2546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2551 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2554 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2555 * @brief This API gets the package type of the application
2557 * @par This API is for package-manager client application
2558 * @par Sync (or) Async : Synchronous API
2560 * @param[in] handle pointer to the application info handle.
2561 * @param[out] pkgtype pointer to hold package type
2562 * @return 0 if success, error code(<0) if fail
2563 * @retval PMINFO_R_OK success
2564 * @retval PMINFO_R_EINVAL invalid argument
2565 * @retval PMINFO_R_ERROR internal error
2566 * @pre pkgmgrinfo_appinfo_get_appinfo()
2567 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2568 * @see pkgmgrinfo_appinfo_get_appid()
2569 * @see pkgmgrinfo_appinfo_is_multiple()
2571 static int get_app_pkgtype(const char *appid)
2574 char *pkgtype = NULL;
2575 pkgmgrinfo_appinfo_h handle = NULL;
2576 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2577 if (ret != PMINFO_R_OK)
2579 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2580 if (ret != PMINFO_R_OK) {
2581 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2584 printf("pkgtype: %s\n", pkgtype);
2585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2590 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2593 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2594 * @brief This API gets the executable name of the application
2596 * @par This API is for package-manager client application
2597 * @par Sync (or) Async : Synchronous API
2599 * @param[in] handle pointer to the application info handle.
2600 * @param[out] exec pointer to hold app exec name
2601 * @return 0 if success, error code(<0) if fail
2602 * @retval PMINFO_R_OK success
2603 * @retval PMINFO_R_EINVAL invalid argument
2604 * @retval PMINFO_R_ERROR internal error
2605 * @pre pkgmgrinfo_appinfo_get_appinfo()
2606 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2607 * @see pkgmgrinfo_appinfo_get_appid()
2608 * @see pkgmgrinfo_appinfo_is_multiple()
2610 static int get_app_exec(const char *appid)
2614 pkgmgrinfo_appinfo_h handle;
2615 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2616 if (ret != PMINFO_R_OK)
2618 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2619 if (ret != PMINFO_R_OK) {
2620 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2623 printf("exec name: %s\n", exec);
2624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2629 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2632 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2633 * @brief This API gets the icon name of the application
2635 * @par This API is for package-manager client application
2636 * @par Sync (or) Async : Synchronous API
2638 * @param[in] handle pointer to the application info handle.
2639 * @param[out] icon pointer to hold app icon name
2640 * @return 0 if success, error code(<0) if fail
2641 * @retval PMINFO_R_OK success
2642 * @retval PMINFO_R_EINVAL invalid argument
2643 * @retval PMINFO_R_ERROR internal error
2644 * @pre pkgmgrinfo_appinfo_get_appinfo()
2645 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2646 * @see pkgmgrinfo_appinfo_get_appid()
2647 * @see pkgmgrinfo_appinfo_is_multiple()
2649 static int get_app_icon(const char *appid)
2653 pkgmgrinfo_appinfo_h handle;
2654 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2655 if (ret != PMINFO_R_OK)
2657 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2658 if (ret != PMINFO_R_OK) {
2659 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2662 printf("icon name: %s\n", icon);
2663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2668 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2671 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2672 * @brief This API gets the label of the application
2674 * @par This API is for package-manager client application
2675 * @par Sync (or) Async : Synchronous API
2677 * @param[in] handle pointer to the application info handle.
2678 * @param[out] label pointer to hold app label
2679 * @return 0 if success, error code(<0) if fail
2680 * @retval PMINFO_R_OK success
2681 * @retval PMINFO_R_EINVAL invalid argument
2682 * @retval PMINFO_R_ERROR internal error
2683 * @pre pkgmgrinfo_appinfo_get_appinfo()
2684 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2685 * @see pkgmgrinfo_appinfo_get_appid()
2686 * @see pkgmgrinfo_appinfo_is_multiple()
2688 static int get_app_label(const char *appid)
2692 pkgmgrinfo_appinfo_h handle;
2693 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2694 if (ret != PMINFO_R_OK)
2696 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2697 if (ret != PMINFO_R_OK) {
2698 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2701 printf("label : %s\n", label);
2702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2707 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2710 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2711 * @brief This API gets exactly matched label by given appid and locale
2713 * @par This API is for package-manager client application
2714 * @par Sync (or) Async : Synchronous API
2716 * @param[in] appid pointer to appid
2717 * @param[in] locale pointer to locale
2718 * @param[out] label pointer to hold app label
2719 * @return 0 if success, error code(<0) if fail
2720 * @retval PMINFO_R_OK success
2721 * @retval PMINFO_R_EINVAL invalid argument
2722 * @retval PMINFO_R_ERROR internal error
2724 static int get_localed_label(const char *appid, const char *locale)
2729 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2730 if (ret != PMINFO_R_OK)
2733 printf("localed label: %s\n", label);
2741 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2742 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2745 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2746 * @brief This API gets metadata value by given metadata key
2748 * @par This API is for package-manager client application
2749 * @par Sync (or) Async : Synchronous API
2751 * @param[in] handle pointer to the application info handle
2752 * @param[in] metadata_key metadata key
2753 * @param[out] metadata_value pointer to hold metadata value
2754 * @return 0 if success, error code(<0) if fail
2755 * @retval PMINFO_R_OK success
2756 * @retval PMINFO_R_EINVAL invalid argument
2758 static int get_metadata_value(const char *appid, const char *metadata_key)
2761 pkgmgrinfo_appinfo_h handle = NULL;
2762 char *metadata_value = NULL;
2764 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2765 if (ret != PMINFO_R_OK)
2768 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2769 if (ret != PMINFO_R_OK) {
2770 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2779 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2782 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2783 * @brief This API gets the component of the application
2785 * @par This API is for package-manager client application
2786 * @par Sync (or) Async : Synchronous API
2788 * @param[in] handle pointer to the application info handle.
2789 * @param[out] component pointer to hold app component
2790 * @return 0 if success, error code(<0) if fail
2791 * @retval PMINFO_R_OK success
2792 * @retval PMINFO_R_EINVAL invalid argument
2793 * @retval PMINFO_R_ERROR internal error
2794 * @pre pkgmgrinfo_appinfo_get_appinfo()
2795 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2796 * @see pkgmgrinfo_appinfo_get_appid()
2797 * @see pkgmgrinfo_appinfo_is_multiple()
2799 static int get_app_component(const char *appid)
2802 pkgmgrinfo_app_component component;
2803 pkgmgrinfo_appinfo_h handle;
2804 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2805 if (ret != PMINFO_R_OK)
2807 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2808 if (ret != PMINFO_R_OK) {
2809 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2812 printf("component : %s\n", component);
2813 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2818 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2821 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2822 * @brief This API gets the apptype of the application
2824 * @par This API is for package-manager client application
2825 * @par Sync (or) Async : Synchronous API
2827 * @param[in] handle pointer to the application info handle.
2828 * @param[out] app_type pointer to hold apptype
2829 * @return 0 if success, error code(<0) if fail
2830 * @retval PMINFO_R_OK success
2831 * @retval PMINFO_R_EINVAL invalid argument
2832 * @retval PMINFO_R_ERROR internal error
2833 * @pre pkgmgrinfo_appinfo_get_appinfo()
2834 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2835 * @see pkgmgrinfo_appinfo_get_appid()
2836 * @see pkgmgrinfo_appinfo_is_multiple()
2838 static int get_app_type(const char *appid)
2841 char *apptype = NULL;
2842 pkgmgrinfo_appinfo_h handle;
2843 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2844 if (ret != PMINFO_R_OK)
2846 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2847 if (ret != PMINFO_R_OK) {
2848 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2851 printf("apptype : %s\n", apptype);
2852 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2857 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2860 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2861 int *operation_count, char ***operation)
2862 * @brief This API gets the list of operation of the application
2864 * @par This API is for package-manager client application
2865 * @par Sync (or) Async : Synchronous API
2867 * @param[in] handle pointer to the appcontrol handle.
2868 * @param[out] operation_count pointer to hold number of operations
2869 * @param[out] operation pointer to hold list of operations
2870 * @return 0 if success, error code(<0) if fail
2871 * @retval PMINFO_R_OK success
2872 * @retval PMINFO_R_EINVAL invalid argument
2873 * @retval PMINFO_R_ERROR internal error
2874 * @pre pkgmgrinfo_appinfo_get_appinfo()
2875 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2876 * @see pkgmgrinfo_appinfo_get_uri()
2877 * @see pkgmgrinfo_appinfo_get_mime()
2879 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2884 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2885 for (i = 0; i < oc; i++) {
2886 if (strcmp(operation[i], (char *)user_data) == 0)
2893 static int check_operation(const char *appid, char *operation)
2896 pkgmgrinfo_appinfo_h handle;
2897 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2898 if (ret != PMINFO_R_OK)
2900 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2901 if (ret != PMINFO_R_OK) {
2902 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2910 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2911 int *operation_count, char ***operation);
2914 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2915 int *uri_count, char ***uri)
2916 * @brief This API gets the list of uri of the application
2918 * @par This API is for package-manager client application
2919 * @par Sync (or) Async : Synchronous API
2921 * @param[in] handle pointer to the appcontrol handle.
2922 * @param[out] uri_count pointer to hold number of uris
2923 * @param[out] uri pointer to hold list of uris
2924 * @return 0 if success, error code(<0) if fail
2925 * @retval PMINFO_R_OK success
2926 * @retval PMINFO_R_EINVAL invalid argument
2927 * @retval PMINFO_R_ERROR internal error
2928 * @pre pkgmgrinfo_appinfo_get_appinfo()
2929 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2930 * @see pkgmgrinfo_appinfo_get_operation()
2931 * @see pkgmgrinfo_appinfo_get_mime()
2933 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2938 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2939 for (i = 0; i < uc; i++) {
2940 if (strcmp(uri[i], (char *)user_data) == 0)
2947 static int check_uri(const char *appid, char *uri)
2950 pkgmgrinfo_appinfo_h handle;
2951 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2952 if (ret != PMINFO_R_OK)
2954 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2955 if (ret != PMINFO_R_OK) {
2956 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2959 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2964 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2965 int *uri_count, char ***uri);
2968 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2969 int *mime_count, char ***mime)
2970 * @brief This API gets the list of mime of the application
2972 * @par This API is for package-manager client application
2973 * @par Sync (or) Async : Synchronous API
2975 * @param[in] handle pointer to the appcontrol handle.
2976 * @param[out] mime_count pointer to hold number of mimes
2977 * @param[out] mime pointer to hold list of mimes
2978 * @return 0 if success, error code(<0) if fail
2979 * @retval PMINFO_R_OK success
2980 * @retval PMINFO_R_EINVAL invalid argument
2981 * @retval PMINFO_R_ERROR internal error
2982 * @pre pkgmgrinfo_appinfo_get_appinfo()
2983 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2984 * @see pkgmgrinfo_appinfo_get_uri()
2985 * @see pkgmgrinfo_appinfo_get_operation()
2987 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2992 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2993 for (i = 0; i < mc; i++) {
2994 if (strcmp(mime[i], (char *)user_data) == 0)
3001 static int check_mime(const char *appid, char *mime)
3004 pkgmgrinfo_appinfo_h handle;
3005 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3006 if (ret != PMINFO_R_OK)
3008 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3009 if (ret != PMINFO_R_OK) {
3010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3013 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3018 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3019 int *mime_count, char ***mime);
3022 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3023 int *subapp_count, char ***subapp)
3024 * @brief This API gets the list of subapp of the application
3026 * @par This API is for package-manager client application
3027 * @par Sync (or) Async : Synchronous API
3029 * @param[in] handle pointer to the appcontrol handle.
3030 * @param[out] subapp_count pointer to hold number of subapp
3031 * @param[out] subapp pointer to hold list of subapp
3032 * @return 0 if success, error code(<0) if fail
3033 * @retval PMINFO_R_OK success
3034 * @retval PMINFO_R_EINVAL invalid argument
3035 * @retval PMINFO_R_ERROR internal error
3036 * @pre pkgmgrinfo_appinfo_get_appinfo()
3037 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3038 * @see pkgmgrinfo_appinfo_get_uri()
3039 * @see pkgmgrinfo_appinfo_get_operation()
3041 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3045 char **subapp = NULL;
3046 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3047 for (i = 0; i < sc; i++) {
3048 if (strcmp(subapp[i], (char *)user_data) == 0)
3055 static int check_subapp(const char *appid, char *subapp)
3058 pkgmgrinfo_appinfo_h handle = NULL;
3059 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3060 if (ret != PMINFO_R_OK)
3062 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3063 if (ret != PMINFO_R_OK) {
3064 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3067 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3072 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3073 int *subapp_count, char ***subapp);
3076 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3077 * @brief This API gets the notification icon of the application
3079 * @par This API is for package-manager client application
3080 * @par Sync (or) Async : Synchronous API
3082 * @param[in] handle pointer to the application info handle.
3083 * @param[out] path pointer to hold notification icon
3084 * @return 0 if success, error code(<0) if fail
3085 * @retval PMINFO_R_OK success
3086 * @retval PMINFO_R_EINVAL invalid argument
3087 * @retval PMINFO_R_ERROR internal error
3088 * @pre pkgmgrinfo_appinfo_get_appinfo()
3089 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3090 * @see pkgmgrinfo_appinfo_get_appid()
3091 * @see pkgmgrinfo_appinfo_is_multiple()
3093 static int get_app_notification_icon(const char *appid)
3096 char *notification_icon = NULL;
3097 pkgmgrinfo_appinfo_h handle;
3098 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3099 if (ret != PMINFO_R_OK)
3101 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3102 if (ret != PMINFO_R_OK) {
3103 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3106 printf("notification icon : %s\n", notification_icon);
3107 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3112 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3115 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3116 * @brief This API gets the setting icon of the application
3118 * @par This API is for package-manager client application
3119 * @par Sync (or) Async : Synchronous API
3121 * @param[in] handle pointer to the application info handle.
3122 * @param[out] path pointer to hold setting icon
3123 * @return 0 if success, error code(<0) if fail
3124 * @retval PMINFO_R_OK success
3125 * @retval PMINFO_R_EINVAL invalid argument
3126 * @retval PMINFO_R_ERROR internal error
3127 * @pre pkgmgrinfo_appinfo_get_appinfo()
3128 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3129 * @see pkgmgrinfo_appinfo_get_appid()
3130 * @see pkgmgrinfo_appinfo_is_multiple()
3132 static int get_app_setting_icon(const char *appid)
3135 char *setting_icon = NULL;
3136 pkgmgrinfo_appinfo_h handle;
3137 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3138 if (ret != PMINFO_R_OK)
3140 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3141 if (ret != PMINFO_R_OK) {
3142 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3145 printf("setting icon : %s\n", setting_icon);
3146 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3151 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3154 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3155 * @brief This API gets the type of recent image on app-tray
3157 * @par This API is for package-manager client application
3158 * @par Sync (or) Async : Synchronous API
3160 * @param[in] handle pointer to the application info handle.
3161 * @param[out] type pointer to hold image type
3162 * @return 0 if success, error code(<0) if fail
3163 * @retval PMINFO_R_OK success
3164 * @retval PMINFO_R_EINVAL invalid argument
3165 * @retval PMINFO_R_ERROR internal error
3166 * @pre pkgmgrinfo_appinfo_get_appinfo()
3167 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3168 * @see pkgmgrinfo_appinfo_get_appid()
3169 * @see pkgmgrinfo_appinfo_is_multiple()
3171 static int get_app_recent_image_type(const char *appid)
3174 pkgmgrinfo_app_recentimage type;
3175 pkgmgrinfo_appinfo_h handle;
3176 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3177 if (ret != PMINFO_R_OK)
3179 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3180 if (ret != PMINFO_R_OK) {
3181 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3184 printf("recent image type: %d\n", type);
3185 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3190 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3194 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3195 * @brief This API gets the preview image of application
3197 * @par Sync (or) Async : Synchronous API
3199 * @param[in] handle pointer to the application info handle.
3200 * @param[out] preview_img pointer to hold preview image path
3201 * @return 0 if success, error code(<0) if fail
3202 * @retval PMINFO_R_OK success
3203 * @retval PMINFO_R_EINVAL invalid argument
3204 * @retval PMINFO_R_ERROR internal error
3205 * @pre pkgmgrinfo_appinfo_get_appinfo()
3206 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3207 * @see pkgmgrinfo_appinfo_get_appid()
3209 static int get_app_previewimage(const char *appid)
3212 char *preview = NULL;
3213 pkgmgrinfo_appinfo_h handle = NULL;
3214 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3215 if (ret != PMINFO_R_OK)
3217 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3218 if (ret != PMINFO_R_OK) {
3219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3222 printf("preview image path : %s\n", preview);
3223 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3228 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3232 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3233 * @brief This API gets the package permission type of the application
3235 * @par This API is for package-manager client application
3236 * @par Sync (or) Async : Synchronous API
3238 * @param[in] handle pointer to the application info handle.
3239 * @param[out] permission pointer to hold package permission
3240 * @return 0 if success, error code(<0) if fail
3241 * @retval PMINFO_R_OK success
3242 * @retval PMINFO_R_EINVAL invalid argument
3243 * @retval PMINFO_R_ERROR internal error
3244 * @pre pkgmgrinfo_appinfo_get_appinfo()
3245 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3246 * @see pkgmgrinfo_appinfo_get_appid()
3248 static int get_app_permission(const char *appid)
3251 pkgmgrinfo_permission_type permission = 0;
3252 pkgmgrinfo_appinfo_h handle;
3254 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3255 if (ret != PMINFO_R_OK)
3257 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3258 if (ret != PMINFO_R_OK) {
3259 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3262 printf("permission type: %d\n", permission);
3263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3268 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3271 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3272 * @brief This API gets the component_type
3274 * @par This API is for package-manager client application
3275 * @par Sync (or) Async : Synchronous API
3277 * @param[in] handle pointer to the application info handle.
3278 * @param[out] component_type pointer to hold component_type
3279 * @return 0 if success, error code(<0) if fail
3280 * @retval PMINFO_R_OK success
3281 * @retval PMINFO_R_EINVAL invalid argument
3282 * @retval PMINFO_R_ERROR internal error
3283 * @pre pkgmgrinfo_appinfo_get_appinfo()
3284 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3285 * @see pkgmgrinfo_appinfo_get_pkgid()
3286 * @see pkgmgrinfo_appinfo_is_multiple()
3288 static int get_component_type(const char *appid)
3291 char *component_type = NULL;
3292 pkgmgrinfo_appinfo_h handle;
3293 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3294 if (ret != PMINFO_R_OK)
3296 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3297 if (ret != PMINFO_R_OK) {
3298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3301 printf("component_type: %s\n", component_type);
3302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3307 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3310 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3311 * @brief This API gets the application 'hwacceleration' value from the app ID
3313 * @par This API is for package-manager client application
3314 * @par Sync (or) Async : Synchronous API
3316 * @param[in] handle pointer to application info handle
3317 * @param[out] hwacceleration pointer to hold package hwacceleration value
3318 * @return 0 if success, error code(<0) if fail
3319 * @retval PMINFO_R_OK success
3320 * @retval PMINFO_R_EINVAL invalid argument
3321 * @retval PMINFO_R_ERROR internal error
3322 * @pre pkgmgrinfo_appinfo_get_appinfo()
3323 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3324 * @see pkgmgrinfo_appinfo_get_appid()
3325 * @see pkgmgrinfo_appinfo_is_multiple()
3327 static int get_app_hwacceleration(const char *appid)
3330 pkgmgrinfo_app_hwacceleration hwacceleration;
3331 pkgmgrinfo_appinfo_h handle;
3332 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3333 if (ret != PMINFO_R_OK)
3335 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3336 if (ret != PMINFO_R_OK) {
3337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3340 printf("app hwacceleration: %d\n", hwacceleration);
3341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3346 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3349 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3350 * @brief This API gets the application 'screenreader' value from the app ID
3352 * @par This API is for package-manager client application
3353 * @par Sync (or) Async : Synchronous API
3355 * @param[in] handle pointer to application info handle
3356 * @param[out] screenreader pointer to hold package accessibility value
3357 * @return 0 if success, error code(<0) if fail
3358 * @retval PMINFO_R_OK success
3359 * @retval PMINFO_R_EINVAL invalid argument
3360 * @retval PMINFO_R_ERROR internal error
3361 * @pre pkgmgrinfo_appinfo_get_appinfo()
3362 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3363 * @see pkgmgrinfo_appinfo_get_appid()
3364 * @see pkgmgrinfo_appinfo_is_multiple()
3366 static int get_app_screenreader(const char *appid)
3369 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3370 pkgmgrinfo_appinfo_h handle = NULL;
3371 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3372 if (ret != PMINFO_R_OK)
3374 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3375 if (ret != PMINFO_R_OK) {
3376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3379 printf("app screenreader: %d\n", screenreader);
3380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3385 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3388 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3389 * @brief This API gets the application's landscape & portrait effect images
3391 * @par This API is for package-manager client application
3392 * @par Sync (or) Async : Synchronous API
3394 * @param[in] handle pointer to application info handle
3395 * @param[out] portrait_img contains portrait mode effect image
3396 * @param[out] landscape_img contains landscape mode effect image
3397 * @return 0 if success, error code(<0) if fail
3398 * @retval PMINFO_R_OK success
3399 * @retval PMINFO_R_EINVAL invalid argument
3400 * @retval PMINFO_R_ERROR internal error
3401 * @pre pkgmgrinfo_appinfo_get_appinfo()
3402 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3403 * @see pkgmgrinfo_appinfo_get_appid()
3404 * @see pkgmgrinfo_appinfo_is_nodisplay()
3406 static int get_app_effectimages(const char *appid)
3409 char *portraitimg = NULL;
3410 char *landscapeimg = NULL;
3411 pkgmgrinfo_appinfo_h handle;
3412 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3413 if (ret != PMINFO_R_OK)
3415 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3416 if (ret != PMINFO_R_OK) {
3417 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3420 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3421 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3426 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3429 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3430 * @brief This API gets the application's effect image type
3432 * @par This API is for package-manager client application
3433 * @par Sync (or) Async : Synchronous API
3435 * @param[in] handle pointer to application info handle
3436 * @param[out] effectimg_type contains effect image type
3437 * @return 0 if success, error code(<0) if fail
3438 * @retval PMINFO_R_OK success
3439 * @retval PMINFO_R_EINVAL invalid argument
3440 * @retval PMINFO_R_ERROR internal error
3441 * @pre pkgmgrinfo_appinfo_get_appinfo()
3442 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3443 * @see pkgmgrinfo_appinfo_get_appid()
3444 * @see pkgmgrinfo_appinfo_is_nodisplay()
3446 static int get_app_effectimage_type(const char *appid)
3449 char *effectimg_type = NULL;
3450 pkgmgrinfo_appinfo_h handle = NULL;
3451 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3452 if (ret != PMINFO_R_OK)
3454 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3455 if (ret != PMINFO_R_OK) {
3456 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3459 printf("app effect image type: %s\n", effectimg_type);
3460 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3465 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3468 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3469 * @brief This API gets the submode_mainid of the application
3471 * @par This API is for package-manager client application
3472 * @par Sync (or) Async : Synchronous API
3474 * @param[in] handle pointer to the application info handle.
3475 * @param[out] submode_mainid pointer to hold package name
3476 * @return 0 if success, error code(<0) if fail
3477 * @retval PMINFO_R_OK success
3478 * @retval PMINFO_R_EINVAL invalid argument
3479 * @retval PMINFO_R_ERROR internal error
3480 * @pre pkgmgrinfo_appinfo_get_appinfo()
3481 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3482 * @see pkgmgrinfo_appinfo_get_appid()
3483 * @see pkgmgrinfo_appinfo_is_multiple()
3485 static int get_app_submode_mainid(const char *appid)
3488 char *submode_mainid = NULL;
3489 pkgmgrinfo_appinfo_h handle = NULL;
3490 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3491 if (ret != PMINFO_R_OK)
3493 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3494 if (ret != PMINFO_R_OK) {
3495 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3498 printf("submode_mainid: %s\n", submode_mainid);
3499 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3504 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3507 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3508 * @brief This API gets the datacontrol info
3510 * @par This API is for package-manager client application
3511 * @par Sync (or) Async : Synchronous API
3513 * @param[in] providerid pointer to the providerid of dataconltrol.
3514 * @param[in] type pointer to the type of dataconltrol.
3515 * @param[out] appid pointer to hold appid, need to free after using
3516 * @param[out] access pointer to hold access, need to free after using
3517 * @return 0 if success, error code(<0) if fail
3518 * @retval PMINFO_R_OK success
3519 * @retval PMINFO_R_EINVAL invalid argument
3520 * @retval PMINFO_R_ERROR internal error
3523 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3524 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3527 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3528 * @brief This API gets the appid of datacontrol
3530 * @par This API is for package-manager client application
3531 * @par Sync (or) Async : Synchronous API
3533 * @param[in] providerid pointer to the providerid of dataconltrol.
3534 * @param[out] appid pointer to hold appid, need to free after using
3535 * @return 0 if success, error code(<0) if fail
3536 * @retval PMINFO_R_OK success
3537 * @retval PMINFO_R_EINVAL invalid argument
3538 * @retval PMINFO_R_ERROR internal error
3541 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3542 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3545 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3546 * @brief This API gets the information about trusted datacontrol
3548 * @par This API is for package-manager client application
3549 * @par Sync (or) Async : Synchronous API
3551 * @param[in] providerid pointer to the providerid of datacontrol.
3552 * @param[out] appid pointer to hold appid, need to free after using
3553 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3554 * @return 0 if success, error code(<0) if fail
3555 * @retval PMINFO_R_OK success
3556 * @retval PMINFO_R_EINVAL invalid argument
3557 * @retval PMINFO_R_ERROR internal error
3560 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3561 const char *type, char **appid, bool *is_trusted);
3562 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3563 const char *type, uid_t uid, char **appid, bool *is_trusted);
3566 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3567 * @brief This API gets the alias_appid of the application
3569 * @par This API is for package-manager client application
3570 * @par Sync (or) Async : Synchronous API
3572 * @param[in] handle pointer to the application info handle.
3573 * @param[out] alias_appid pointer to hold app alias_appid
3574 * @return 0 if success, error code(<0) if fail
3575 * @retval PMINFO_R_OK success
3576 * @retval PMINFO_R_EINVAL invalid argument
3577 * @retval PMINFO_R_ERROR internal error
3578 * @pre pkgmgrinfo_appinfo_get_appinfo()
3579 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3580 * @see pkgmgrinfo_appinfo_get_appid()
3582 static int get_alias_appid(const char *appid)
3585 char *alias_appid= 0;
3586 pkgmgrinfo_appinfo_h handle = NULL;
3587 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3588 if (ret != PMINFO_R_OK)
3590 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3591 if (ret != PMINFO_R_OK) {
3592 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3595 printf("alias_appid: %s\n", alias_appid);
3596 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3601 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3604 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3605 * @brief This API gets the effective_appid of the application
3607 * @par This API is for package-manager client application
3608 * @par Sync (or) Async : Synchronous API
3610 * @param[in] handle pointer to the application info handle.
3611 * @param[out] effective_appid pointer to hold app effective_appid
3612 * @return 0 if success, error code(<0) if fail
3613 * @retval PMINFO_R_OK success
3614 * @retval PMINFO_R_EINVAL invalid argument
3615 * @retval PMINFO_R_ERROR internal error
3616 * @pre pkgmgrinfo_appinfo_get_appinfo()
3617 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3618 * @see pkgmgrinfo_appinfo_get_appid()
3620 static int get_effective_appid(const char *appid)
3623 char *effective_appid= 0;
3624 pkgmgrinfo_appinfo_h handle = NULL;
3625 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3626 if (ret != PMINFO_R_OK)
3628 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3629 if (ret != PMINFO_R_OK) {
3630 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3633 printf("effective_appid: %s\n", effective_appid);
3634 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3639 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3642 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3643 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3645 * @par This API is for package-manager client application
3646 * @par Sync (or) Async : Synchronous API
3648 * @param[in] handle pointer to the appinfo handle.
3649 * @param[out] tep_name pointer to hold tep name
3650 * @return 0 if success, error code(<0) if fail
3651 * @retval PMINFO_R_OK success
3652 * @retval PMINFO_R_EINVAL invalid argument
3653 * @retval PMINFO_R_ERROR internal error
3654 * @pre pkgmgrinfo_appinfo_get_appinfo()
3655 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3656 * @see pkgmgrinfo_appinfo_get_appid()
3658 static int get_tep_name(const char *appid)
3661 char *tep_name = NULL;
3662 pkgmgrinfo_appinfo_h handle = NULL;
3663 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3664 if (ret != PMINFO_R_OK)
3666 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3667 if (ret != PMINFO_R_OK) {
3668 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3671 printf("TEP name is: %s\n", tep_name);
3672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3677 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3680 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3681 * @brief This API gets zip mount file name associated with the package which contain given application
3682 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3684 * @par This API is for package-manager client application
3685 * @par Sync (or) Async : Synchronous API
3687 * @param[in] handle pointer to the appinfo handle.
3688 * @param[out] zip_mount_file pointer to hold zip mount file name
3689 * @return 0 if success, error code(<0) if fail
3690 * @retval PMINFO_R_OK success
3691 * @retval PMINFO_R_EINVAL invalid argument
3692 * @retval PMINFO_R_ERROR internal error
3693 * @pre pkgmgrinfo_appinfo_get_appinfo()
3694 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3695 * @see pkgmgrinfo_appinfo_get_appid()
3697 static int get_zip_mount_file(const char *appid)
3700 char *zip_mount_file = NULL;
3701 pkgmgrinfo_appinfo_h handle = NULL;
3702 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3703 if (ret != PMINFO_R_OK)
3705 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3706 if (ret != PMINFO_R_OK) {
3707 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3710 printf("Mount file name is: %s\n", zip_mount_file);
3711 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3716 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3719 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3720 * @brief This API gets the root path of application
3722 * @par Sync (or) Async : Synchronous API
3724 * @param[in] handle pointer to appinfo handle
3725 * @param[out] path pointer to hold root path of application
3726 * @return 0 if success, error code(<0) if fail
3727 * @retval PMINFO_R_OK success
3728 * @retval PMINFO_R_EINVAL invalid argument
3729 * @retval PMINFO_R_ERROR internal error
3731 static int get_root_path(const char *appid)
3735 pkgmgrinfo_appinfo_h handle;
3736 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3737 if (ret != PMINFO_R_OK)
3740 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3741 if (ret != PMINFO_R_OK) {
3742 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3745 printf("path : %s\n", path);
3746 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3752 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3755 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3756 * @brief This API gets the application api_version from the application ID
3758 * @par This API is for package-manager client application
3759 * @par Sync (or) Async : Synchronous API
3761 * @param[in] handle pointer to appinfo handle
3762 * @param[out] api_version pointer to hold application api_version
3763 * @return 0 if success, error code(<0) if fail
3764 * @retval PMINFO_R_OK success
3765 * @retval PMINFO_R_EINVAL invalid argument
3766 * @retval PMINFO_R_ERROR internal error
3767 * @pre pkgmgrinfo_appinfo_get_appinfo()
3768 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3769 * @see pkgmgrinfo_appinfo_get_appid()
3771 static int get_app_api_version(const char *appid)
3774 char *api_version = NULL;
3775 pkgmgrinfo_appinfo_h handle = NULL;
3776 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3777 if (ret != PMINFO_R_OK)
3779 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3780 if (ret != PMINFO_R_OK) {
3781 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3784 printf("app api_version: %s\n", api_version);
3785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3790 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3793 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3794 * @brief This API gets the installed_time of the application
3796 * @par This API is for package-manager client application
3797 * @par Sync (or) Async : Synchronous API
3799 * @param[in] handle pointer to the application info handle.
3800 * @param[out] installed_time pointer to hold installed_time
3801 * @return 0 if success, error code(<0) if fail
3802 * @retval PMINFO_R_OK success
3803 * @retval PMINFO_R_EINVAL invalid argument
3804 * @retval PMINFO_R_ERROR internal error
3805 * @pre pkgmgrinfo_appinfo_get_appinfo()
3806 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3807 * @see pkgmgrinfo_appinfo_get_appid()
3808 * @see pkgmgrinfo_appinfo_is_multiple()
3810 static int get_app_installed_time(const char *appid)
3813 int installed_time = 0;
3814 pkgmgrinfo_appinfo_h handle = NULL;
3815 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3816 if (ret != PMINFO_R_OK)
3818 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
3819 if (ret != PMINFO_R_OK) {
3820 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3823 printf("installed_time: %d\n", installed_time);
3824 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3829 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
3832 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
3833 * @brief This API gets the support_mode of the application
3835 * @par This API is for package-manager client application
3836 * @par Sync (or) Async : Synchronous API
3838 * @param[in] handle pointer to the application info handle.
3839 * @param[out] support_mode pointer to hold app support_mode
3840 * @return 0 if success, error code(<0) if fail
3841 * @retval PMINFO_R_OK success
3842 * @retval PMINFO_R_EINVAL invalid argument
3843 * @retval PMINFO_R_ERROR internal error
3844 * @pre pkgmgrinfo_appinfo_get_appinfo()
3845 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3846 * @see pkgmgrinfo_appinfo_get_appid()
3848 static int get_app_support_mode(const char *appid)
3851 int support_mode = 0;
3852 pkgmgrinfo_appinfo_h handle = NULL;
3853 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3854 if (ret != PMINFO_R_OK)
3856 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
3857 if (ret != PMINFO_R_OK) {
3858 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3861 printf("support_mode: %s\n", support_mode);
3862 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3867 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
3870 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3871 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3872 * @brief This API gets the list of permission for a particular application
3874 * @par This API is for package-manager client application
3875 * @par Sync (or) Async : Synchronous API
3876 * @param[in] handle pointer to the application info handle.
3877 * @param[in] permission_func callback function for list
3878 * @param[in] user_data user data to be passed to callback function
3879 * @return 0 if success, error code(<0) if fail
3880 * @retval PMINFO_R_OK success
3881 * @retval PMINFO_R_EINVAL invalid argument
3882 * @retval PMINFO_R_ERROR internal error
3883 * @pre pkgmgrinfo_appinfo_get_appinfo()
3884 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3886 int permission_func(const char *name, void *user_data)
3888 if (strcmp(name, (char *)user_data) == 0)
3894 static int list_permission(const char *appid, char *permission)
3897 pkgmgrinfo_appinfo_h handle;
3898 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3899 if (ret != PMINFO_R_OK)
3901 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3902 if (ret != PMINFO_R_OK) {
3903 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3906 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3911 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3912 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3915 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3916 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3917 * @brief This API gets the list of category for a particular application
3919 * @par This API is for package-manager client application
3920 * @par Sync (or) Async : Synchronous API
3921 * @param[in] handle pointer to the application info handle.
3922 * @param[in] category_func callback function for list
3923 * @param[in] user_data user data to be passed to callback function
3924 * @return 0 if success, error code(<0) if fail
3925 * @retval PMINFO_R_OK success
3926 * @retval PMINFO_R_EINVAL invalid argument
3927 * @retval PMINFO_R_ERROR internal error
3928 * @pre pkgmgrinfo_appinfo_get_appinfo()
3929 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3931 int category_func(const char *name, void *user_data)
3933 if (strcmp(name, (char *)user_data) == 0)
3939 static int list_category(const char *appid, char *category)
3942 pkgmgrinfo_appinfo_h handle;
3943 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3944 if (ret != PMINFO_R_OK)
3946 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3947 if (ret != PMINFO_R_OK) {
3948 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3951 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3956 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3957 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3960 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3961 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3962 * @brief This API gets the list of metadata for a particular application
3964 * @par This API is for package-manager client application
3965 * @par Sync (or) Async : Synchronous API
3966 * @param[in] handle pointer to the application info handle.
3967 * @param[in] metadata_func callback function for list
3968 * @param[in] user_data user data to be passed to callback function
3969 * @return 0 if success, error code(<0) if fail
3970 * @retval PMINFO_R_OK success
3971 * @retval PMINFO_R_EINVAL invalid argument
3972 * @retval PMINFO_R_ERROR internal error
3973 * @pre pkgmgrinfo_appinfo_get_appinfo()
3974 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3976 int metadata_func(const char *key, const char *value, void *user_data)
3978 if (strcmp(key, (char *)user_data) == 0) {
3979 printf("Value is %s\n", value);
3986 static int list_metadata(const char *appid, char *key)
3989 pkgmgrinfo_appinfo_h handle;
3990 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3991 if (ret != PMINFO_R_OK)
3993 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3994 if (ret != PMINFO_R_OK) {
3995 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3998 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4003 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4004 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4008 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4009 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4010 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4011 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4012 * @brief This API gets the list of app-control for a particular application
4014 * @par This API is for package-manager client application
4015 * @par Sync (or) Async : Synchronous API
4016 * @param[in] handle pointer to the application info handle.
4017 * @param[in] appcontrol_func callback function for list
4018 * @param[in] user_data user data to be passed to callback function
4019 * @param[in] uid the addressee user id of the instruction
4020 * @return 0 if success, error code(<0) if fail
4021 * @retval PMINFO_R_OK success
4022 * @retval PMINFO_R_EINVAL invalid argument
4023 * @retval PMINFO_R_ERROR internal error
4024 * @pre pkgmgrinfo_appinfo_get_appinfo()
4025 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4027 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4032 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4033 for (i = 0; i < oc; i++) {
4034 if (strcmp(operation[i], (char *)user_data) == 0)
4041 static int check_operation(const char *appid, char *operation)
4044 pkgmgrinfo_appinfo_h handle;
4045 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4046 if (ret != PMINFO_R_OK)
4048 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4049 if (ret != PMINFO_R_OK) {
4050 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4058 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4059 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4064 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4065 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4068 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4069 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4070 * @brief This API gets the list of splashscreen for a particular application
4072 * @par This API is for package-manager client application
4073 * @par Sync (or) Async : Synchronous API
4074 * @param[in] handle pointer to the application info handle.
4075 * @param[in] splash_screen_func callback function for list
4076 * @param[in] user_data user data to be passed to callback function
4077 * @return 0 if success, error code(<0) if fail
4078 * @retval PMINFO_R_OK success
4079 * @retval PMINFO_R_EINVAL invalid argument
4080 * @retval PMINFO_R_ERROR internal error
4081 * @pre pkgmgrinfo_appinfo_get_appinfo()
4082 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4085 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4086 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4089 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4090 * @brief This API gets the application 'nodisplay' value from the app ID
4092 * @par This API is for package-manager client application
4093 * @par Sync (or) Async : Synchronous API
4095 * @param[in] handle pointer to application info handle
4096 * @param[out] nodisplay pointer to hold package nodisplay value
4097 * @return 0 if success, error code(<0) if fail
4098 * @retval PMINFO_R_OK success
4099 * @retval PMINFO_R_EINVAL invalid argument
4100 * @retval PMINFO_R_ERROR internal error
4101 * @pre pkgmgrinfo_appinfo_get_appinfo()
4102 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4103 * @see pkgmgrinfo_appinfo_get_appid()
4104 * @see pkgmgrinfo_appinfo_is_multiple()
4106 static int get_app_nodisplay(const char *appid)
4110 pkgmgrinfo_appinfo_h handle;
4111 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4112 if (ret != PMINFO_R_OK)
4114 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4115 if (ret != PMINFO_R_OK) {
4116 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4119 printf("app nodisplay: %d\n", nodisplay);
4120 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4125 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4128 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4129 * @brief This API gets the application 'multiple' value from the app ID
4131 * @par This API is for package-manager client application
4132 * @par Sync (or) Async : Synchronous API
4134 * @param[in] handle pointer to application info handle
4135 * @param[out] multiple pointer to hold package multiple value
4136 * @return 0 if success, error code(<0) if fail
4137 * @retval PMINFO_R_OK success
4138 * @retval PMINFO_R_EINVAL invalid argument
4139 * @retval PMINFO_R_ERROR internal error
4140 * @pre pkgmgrinfo_appinfo_get_appinfo()
4141 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4142 * @see pkgmgrinfo_appinfo_get_appid()
4143 * @see pkgmgrinfo_appinfo_is_nodisplay()
4145 static int get_app_multiple(const char *appid)
4149 pkgmgrinfo_appinfo_h handle;
4150 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4151 if (ret != PMINFO_R_OK)
4153 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4154 if (ret != PMINFO_R_OK) {
4155 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4158 printf("app multiple: %d\n", multiple);
4159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4164 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4167 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4168 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4169 * application launching effect. If fales, indicator will be hidden during application launching effect
4171 * @par This API is for package-manager client application
4172 * @par Sync (or) Async : Synchronous API
4174 * @param[in] handle pointer to application info handle
4175 * @param[out] indicator_disp contains indicator display status for application launching effect
4176 * @return 0 if success, error code(<0) if fail
4177 * @retval PMINFO_R_OK success
4178 * @retval PMINFO_R_EINVAL invalid argument
4179 * @retval PMINFO_R_ERROR internal error
4180 * @pre pkgmgrinfo_appinfo_get_appinfo()
4181 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4182 * @see pkgmgrinfo_appinfo_get_appid()
4183 * @see pkgmgrinfo_appinfo_is_nodisplay()
4185 static int get_app_indicator_display(const char *appid)
4188 bool indicator_disp;
4189 pkgmgrinfo_appinfo_h handle;
4190 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4191 if (ret != PMINFO_R_OK)
4193 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4194 if (ret != PMINFO_R_OK){
4195 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4198 printf("app indicator disp : %d\n", indicator_disp);
4199 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4204 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4207 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4208 * @brief This API gets the application 'taskmanage' value from the app ID
4210 * @par This API is for package-manager client application
4211 * @par Sync (or) Async : Synchronous API
4213 * @param[in] handle pointer to application info handle
4214 * @param[out] taskmanage pointer to hold package taskmanage value
4215 * @return 0 if success, error code(<0) if fail
4216 * @retval PMINFO_R_OK success
4217 * @retval PMINFO_R_EINVAL invalid argument
4218 * @retval PMINFO_R_ERROR internal error
4219 * @pre pkgmgrinfo_appinfo_get_appinfo()
4220 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4221 * @see pkgmgrinfo_appinfo_get_appid()
4222 * @see pkgmgrinfo_appinfo_is_multiple()
4224 static int get_app_taskmanage(const char *appid)
4228 pkgmgrinfo_appinfo_h handle;
4229 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4230 if (ret != PMINFO_R_OK)
4232 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4233 if (ret != PMINFO_R_OK) {
4234 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4237 printf("app taskmanage: %d\n", taskmanage);
4238 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4243 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4246 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4247 * @brief This API gets the application 'taskmanage' value from the app ID
4249 * @par This API is for package-manager client application
4250 * @par Sync (or) Async : Synchronous API
4252 * @param[in] handle pointer to application info handle
4253 * @param[out] enabled pointer to hold package enabled value
4254 * @return 0 if success, error code(<0) if fail
4255 * @retval PMINFO_R_OK success
4256 * @retval PMINFO_R_EINVAL invalid argument
4257 * @retval PMINFO_R_ERROR internal error
4258 * @pre pkgmgrinfo_appinfo_get_appinfo()
4259 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4260 * @see pkgmgrinfo_appinfo_get_appid()
4261 * @see pkgmgrinfo_appinfo_is_multiple()
4263 static int get_app_enabled(const char *appid)
4267 pkgmgrinfo_appinfo_h handle;
4268 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4269 if (ret != PMINFO_R_OK)
4271 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4272 if (ret != PMINFO_R_OK) {
4273 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4276 printf("app enabled: %d\n", enabled);
4277 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4282 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4285 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4286 * @brief This API gets the application 'onboot' value from the app ID
4288 * @par This API is for package-manager client application
4289 * @par Sync (or) Async : Synchronous API
4291 * @param[in] handle pointer to application info handle
4292 * @param[out] onboot pointer to hold package onboot value
4293 * @return 0 if success, error code(<0) if fail
4294 * @retval PMINFO_R_OK success
4295 * @retval PMINFO_R_EINVAL invalid argument
4296 * @retval PMINFO_R_ERROR internal error
4297 * @pre pkgmgrinfo_appinfo_get_appinfo()
4298 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4299 * @see pkgmgrinfo_appinfo_get_appid()
4300 * @see pkgmgrinfo_appinfo_is_multiple()
4302 static int get_app_onboot(const char *appid)
4306 pkgmgrinfo_appinfo_h handle;
4307 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4308 if (ret != PMINFO_R_OK)
4310 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4311 if (ret != PMINFO_R_OK) {
4312 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4315 printf("app onboot: %d\n", onboot);
4316 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4321 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4324 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4325 * @brief This API gets the application 'autorestart' value from the app ID
4327 * @par This API is for package-manager client application
4328 * @par Sync (or) Async : Synchronous API
4330 * @param[in] handle pointer to application info handle
4331 * @param[out] autorestart pointer to hold package autorestart value
4332 * @return 0 if success, error code(<0) if fail
4333 * @retval PMINFO_R_OK success
4334 * @retval PMINFO_R_EINVAL invalid argument
4335 * @retval PMINFO_R_ERROR internal error
4336 * @pre pkgmgrinfo_appinfo_get_appinfo()
4337 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4338 * @see pkgmgrinfo_appinfo_get_appid()
4339 * @see pkgmgrinfo_appinfo_is_multiple()
4341 static int get_app_autorestart(const char *appid)
4345 pkgmgrinfo_appinfo_h handle;
4346 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4347 if (ret != PMINFO_R_OK)
4349 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4350 if (ret != PMINFO_R_OK) {
4351 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4354 printf("app autorestart: %d\n", autorestart);
4355 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4360 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4363 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4364 * @brief This API gets the value for given application is main app or not from handle
4366 * @par This API is for package-manager client application
4367 * @par Sync (or) Async : Synchronous API
4369 * @param[in] handle pointer to application info handle
4370 * @param[out] mainapp pointer to hold package mainapp is or not
4371 * @return 0 if success, error code(<0) if fail
4372 * @retval PMINFO_R_OK success
4373 * @retval PMINFO_R_EINVAL invalid argument
4374 * @retval PMINFO_R_ERROR internal error
4375 * @pre pkgmgrinfo_appinfo_get_appinfo()
4376 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4377 * @see pkgmgrinfo_appinfo_get_appid()
4378 * @see pkgmgrinfo_appinfo_is_multiple()
4380 static int get_app_mainapp(const char *appid)
4384 pkgmgrinfo_appinfo_h handle;
4385 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4386 if (ret != PMINFO_R_OK)
4388 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4389 if (ret != PMINFO_R_OK) {
4390 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4393 printf("mainapp: %d\n", mainapp);
4394 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4399 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4403 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4404 * @brief This API gets the value for given application is preload or not from handle
4406 * @par This API is for package-manager client application
4407 * @par Sync (or) Async : Synchronous API
4409 * @param[in] handle pointer to application info handle
4410 * @param[out] preload pointer to hold preload is or not
4411 * @return 0 if success, error code(<0) if fail
4412 * @retval PMINFO_R_OK success
4413 * @retval PMINFO_R_EINVAL invalid argument
4414 * @retval PMINFO_R_ERROR internal error
4415 * @pre pkgmgrinfo_appinfo_get_appinfo()
4416 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4417 * @see pkgmgrinfo_appinfo_get_appid()
4418 * @see pkgmgrinfo_appinfo_is_multiple()
4420 static int get_app_preload(const char *appid)
4424 pkgmgrinfo_appinfo_h handle = NULL;
4425 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4426 if (ret != PMINFO_R_OK)
4428 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4429 if (ret != PMINFO_R_OK) {
4430 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4433 printf("preload: %d\n", preload);
4434 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4439 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4442 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4443 * @brief This API gets the value for given application is submode or not from handle
4445 * @par This API is for package-manager client application
4446 * @par Sync (or) Async : Synchronous API
4448 * @param[in] handle pointer to application info handle
4449 * @param[out] submode pointer to hold submode is or not
4450 * @return 0 if success, error code(<0) if fail
4451 * @retval PMINFO_R_OK success
4452 * @retval PMINFO_R_EINVAL invalid argument
4453 * @retval PMINFO_R_ERROR internal error
4454 * @pre pkgmgrinfo_appinfo_get_appinfo()
4455 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4456 * @see pkgmgrinfo_appinfo_get_appid()
4457 * @see pkgmgrinfo_appinfo_is_multiple()
4459 static int get_app_submode(const char *appid)
4463 pkgmgrinfo_appinfo_h handle = NULL;
4464 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4465 if (ret != PMINFO_R_OK)
4467 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4468 if (ret != PMINFO_R_OK) {
4469 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4472 printf("submode: %d\n", submode);
4473 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4478 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4481 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4482 * @brief This API gets the value for given application is process_pool or not from handle
4484 * @par This API is for package-manager client application
4485 * @par Sync (or) Async : Synchronous API
4487 * @param[in] handle pointer to application info handle
4488 * @param[out] process_pool pointer to hold process_pool is or not
4489 * @return 0 if success, error code(<0) if fail
4490 * @retval PMINFO_R_OK success
4491 * @retval PMINFO_R_EINVAL invalid argument
4492 * @retval PMINFO_R_ERROR internal error
4493 * @pre pkgmgrinfo_appinfo_get_appinfo()
4494 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4495 * @see pkgmgrinfo_appinfo_get_appid()
4497 static int get_app_process_pool(const char *appid)
4500 bool process_pool = 0;
4501 pkgmgrinfo_appinfo_h handle = NULL;
4502 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4503 if (ret != PMINFO_R_OK)
4505 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4506 if (ret != PMINFO_R_OK) {
4507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4510 printf("process_pool: %d\n", process_pool);
4511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4516 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4519 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4520 * @brief This API gets the installed storage location of the application
4522 * @par This API is for package-manager client application
4523 * @par Sync (or) Async : Synchronous API
4525 * @param[in] handle pointer to the application info handle.
4526 * @param[out] app_type pointer to hold installed storage location
4527 * @return 0 if success, error code(<0) if fail
4528 * @retval PMINFO_R_OK success
4529 * @retval PMINFO_R_EINVAL invalid argument
4530 * @retval PMINFO_R_ERROR internal error
4531 * @pre pkgmgrinfo_appinfo_get_appinfo()
4532 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4533 * @see pkgmgrinfo_appinfo_get_appid()
4535 static int get_app_installed_location(const char *appid)
4538 pkgmgrinfo_installed_storage storage;
4539 pkgmgrinfo_appinfo_h handle = NULL;
4540 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4541 if (ret != PMINFO_R_OK)
4543 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4544 if (ret != PMINFO_R_OK) {
4545 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4548 printf("Installed storage location : %d\n", storage);
4549 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4554 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4558 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4559 * @brief This API checks if the application has the given category
4561 * @par This API is for package-manager client application
4562 * @par Sync (or) Async : Synchronous API
4564 * @param[in] handle pointer to the application info handle
4565 * @param[in] category category
4566 * @param[out] exist value Gets whether the application has the given category
4567 * @return 0 if success, error code(<0) if fail
4568 * @retval PMINFO_R_OK success
4569 * @retval PMINFO_R_EINVAL invalid argument
4570 * @retval PMINFO_R_ERROR internal error
4572 static int is_category_exist(const char *appid, const char *category)
4575 pkgmgrinfo_appinfo_h handle;
4578 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4579 if (ret != PMINFO_R_OK)
4582 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4583 if (ret != PMINFO_R_OK) {
4584 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4588 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4593 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4596 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4597 * @brief This API gets the application 'ui_gadget' value from the app ID
4599 * @par This API is for package-manager client application
4600 * @par Sync (or) Async : Synchronous API
4602 * @param[in] handle pointer to application info handle
4603 * @param[out] ui_gadget pointer to hold package ui_gadget value
4604 * @return 0 if success, error code(<0) if fail
4605 * @retval PMINFO_R_OK success
4606 * @retval PMINFO_R_EINVAL invalid argument
4607 * @pre pkgmgrinfo_appinfo_get_appinfo()
4608 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4610 static int get_app_ui_gadget(const char *appid)
4614 pkgmgrinfo_appinfo_h handle = NULL;
4615 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4616 if (ret != PMINFO_R_OK)
4618 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4619 if (ret != PMINFO_R_OK) {
4620 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4623 printf("app ui_gadget: %d\n", ui_gadget);
4624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4629 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4632 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4633 * @brief This API gets the application 'support_disable' value from the app ID
4635 * @par This API is for package-manager client application
4636 * @par Sync (or) Async : Synchronous API
4638 * @param[in] handle pointer to application info handle
4639 * @param[out] support_disable pointer to hold package support_disable value
4640 * @return 0 if success, error code(<0) if fail
4641 * @retval PMINFO_R_OK success
4642 * @retval PMINFO_R_EINVAL invalid argument
4643 * @pre pkgmgrinfo_appinfo_get_appinfo()
4644 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4646 static int get_app_support_disable(const char *appid)
4649 bool support_disable;
4650 pkgmgrinfo_appinfo_h handle = NULL;
4651 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4652 if (ret != PMINFO_R_OK)
4654 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4655 if (ret != PMINFO_R_OK) {
4656 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4659 printf("app support_disable: %d\n", support_disable);
4660 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4665 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4668 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4669 * @brief This API gets the application 'removable' value from the app ID
4671 * @par This API is for package-manager client application
4672 * @par Sync (or) Async : Synchronous API
4674 * @param[in] handle pointer to application info handle
4675 * @param[out] removable pointer to hold package removable value
4676 * @return 0 if success, error code(<0) if fail
4677 * @retval PMINFO_R_OK success
4678 * @retval PMINFO_R_EINVAL invalid argument
4679 * @retval PMINFO_R_ERROR internal error
4680 * @pre pkgmgrinfo_appinfo_get_appinfo()
4681 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4682 * @see pkgmgrinfo_appinfo_get_appid()
4684 static int get_app_removable(const char *appid)
4688 pkgmgrinfo_appinfo_h handle = NULL;
4689 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4690 if (ret != PMINFO_R_OK)
4692 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4693 if (ret != PMINFO_R_OK) {
4694 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4697 printf("app removable: %d\n", removable);
4698 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4703 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4706 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4707 * @brief This API gets the application 'system' value from the app ID
4709 * @par This API is for package-manager client application
4710 * @par Sync (or) Async : Synchronous API
4712 * @param[in] handle pointer to application info handle
4713 * @param[out] system pointer to hold package system value
4714 * @return 0 if success, error code(<0) if fail
4715 * @retval PMINFO_R_OK success
4716 * @retval PMINFO_R_EINVAL invalid argument
4717 * @retval PMINFO_R_ERROR internal error
4718 * @pre pkgmgrinfo_appinfo_get_appinfo()
4719 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4720 * @see pkgmgrinfo_appinfo_get_appid()
4722 static int get_app_system(const char *appid)
4725 bool system = false;
4726 pkgmgrinfo_appinfo_h handle = NULL;
4727 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4728 if (ret != PMINFO_R_OK)
4730 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4731 if (ret != PMINFO_R_OK) {
4732 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4735 printf("app system: %d\n", system);
4736 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4741 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4745 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4746 * @brief This API gets the application 'is_disable' value from the app ID
4748 * @par This API is for package-manager client application
4749 * @par Sync (or) Async : Synchronous API
4751 * @param[in] handle pointer to application info handle
4752 * @param[out] disabled pointer to hold application is_disabled value
4753 * @return 0 if success, error code(<0) if fail
4754 * @retval PMINFO_R_OK success
4755 * @retval PMINFO_R_EINVAL invalid argument
4756 * @pre pkgmgrinfo_appinfo_get_appinfo()
4757 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4759 static int get_app_is_disable(const char *appid)
4763 pkgmgrinfo_appinfo_h handle = NULL;
4764 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4765 if (ret != PMINFO_R_OK)
4767 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4768 if (ret != PMINFO_R_OK) {
4769 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4772 printf("app is_disable: %d\n", is_disable);
4773 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4778 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4781 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4782 * @brief This API gets whethere the given application is global application or user application
4784 * @par This API is for package-manager client application
4785 * @par Sync (or) Async : Synchronous API
4787 * @param[in] handle pointer to application info handle
4788 * @param[in] global pointer to hold application global value
4789 * @return 0 if success, error code(<0) if fail
4790 * @retval PMINFO_R_OK success
4791 * @retval PMINFO_R_EINVAL invalid argument
4792 * @retval PMINFO_R_ERROR internal error
4793 * @pre pkgmgrinfo_appinfo_get_appinfo()
4794 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4795 * @see pkgmgrinfo_appinfo_get_appid()
4796 static int get_app_is_global(const char *appid)
4800 pkgmgrinfo_appinfo_h handle = NULL;
4801 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4802 if (ret != PMINFO_R_OK)
4804 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4805 if (ret != PMINFO_R_OK) {
4806 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4809 printf("app is_global: %d\n", global);
4810 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4815 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4818 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4819 * @brief This API gets the application 'splash_screen_display' value from the app ID
4821 * @par This API is for package-manager client application
4822 * @par Sync (or) Async : Synchronous API
4824 * @param[in] handle pointer to application info handle
4825 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4826 * @return 0 if success, error code(<0) if fail
4827 * @retval PMINFO_R_OK success
4828 * @retval PMINFO_R_EINVAL invalid argument
4829 * @retval PMINFO_R_ERROR internal error
4831 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4834 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
4835 * @brief This API gets the application 'setup_appid' value from the app ID
4837 * @par This API is for package-manager client application
4838 * @par Sync (or) Async : Synchronous API
4840 * @param[in] handle pointer to application info handle
4841 * @param[out] setup_appid pointer to hold package setup_appid value
4842 * @return 0 if success, error code(<0) if fail
4843 * @retval PMINFO_R_OK success
4844 * @retval PMINFO_R_EINVAL invalid argument
4845 * @retval PMINFO_R_ERROR internal error
4847 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
4850 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
4851 * @brief This API gets the application 'support_ambient' value from the app ID
4853 * @par This API is for package-manager client application
4854 * @par Sync (or) Async : Synchronous API
4856 * @param[in] handle pointer to application info handle
4857 * @param[out] support_ambient pointer to hold package support_ambient value
4858 * @return 0 if success, error code(<0) if fail
4859 * @retval PMINFO_R_OK success
4860 * @retval PMINFO_R_EINVAL invalid argument
4861 * @retval PMINFO_R_ERROR internal error
4863 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
4866 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4867 * @brief This API destroys the application information handle freeing up all the resources
4869 * @par This API is for package-manager client application
4870 * @par Sync (or) Async : Synchronous API
4872 * @param[in] handle pointer to the application info handle.
4873 * @return 0 if success, error code(<0) if fail
4874 * @retval PMINFO_R_OK success
4875 * @retval PMINFO_R_EINVAL invalid argument
4876 * @retval PMINFO_R_ERROR internal error
4877 * @pre pkgmgrinfo_appinfo_get_appinfo()
4879 * @see pkgmgrinfo_appinfo_get_pkgid()
4880 * @see pkgmgrinfo_appinfo_is_multiple()
4882 static int get_app_type(const char *appid)
4886 pkgmgrinfo_appinfo_h handle;
4887 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4888 if (ret != PMINFO_R_OK)
4890 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4891 if (ret != PMINFO_R_OK) {
4892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4895 printf("apptype: %s\n", type);
4896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4901 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4904 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4905 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4906 The query will search the entire application information collected from the manifest file of all the installed packages
4908 * @par This API is for package-manager client application
4909 * @par Sync (or) Async : Synchronous API
4911 * @param[out] handle pointer to the application info filter handle.
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
4917 * @post pkgmgrinfo_appinfo_filter_destroy()
4918 * @see pkgmgrinfo_appinfo_filter_count()
4919 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4921 static int get_capp_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_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
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 capp: %d\n", count);
4940 pkgmgrinfo_appinfo_filter_destroy(handle);
4945 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4948 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4949 * @brief This API destroys the application information filter handle freeing up all the resources
4951 * @par This API is for package-manager client application
4952 * @par Sync (or) Async : Synchronous API
4954 * @param[in] handle pointer to the application info filter handle.
4955 * @return 0 if success, error code(<0) if fail
4956 * @retval PMINFO_R_OK success
4957 * @retval PMINFO_R_EINVAL invalid argument
4958 * @retval PMINFO_R_ERROR internal error
4959 * @pre pkgmgrinfo_appinfo_filter_create()
4961 * @see pkgmgrinfo_appinfo_filter_count()
4962 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4964 static int get_capp_count()
4968 pkgmgrinfo_appinfo_filter_h handle;
4969 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4970 if (ret != PMINFO_R_OK)
4972 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4973 if (ret != PMINFO_R_OK) {
4974 pkgmgrinfo_appinfo_filter_destroy(handle);
4977 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4978 if (ret != PMINFO_R_OK) {
4979 pkgmgrinfo_appinfo_filter_destroy(handle);
4982 printf("No of capp: %d\n", count);
4983 pkgmgrinfo_appinfo_filter_destroy(handle);
4988 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4991 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4992 * @brief This API adds a boolean filter property to the filter handle
4994 * @par This API is for package-manager client application
4995 * @par Sync (or) Async : Synchronous API
4997 * @param[in] handle pointer to the application info filter handle.
4998 * @param[in] property boolean property name.
4999 * @param[in] value value corresponding to the property.
5000 * @return 0 if success, error code(<0) if fail
5001 * @retval PMINFO_R_OK success
5002 * @retval PMINFO_R_EINVAL invalid argument
5003 * @retval PMINFO_R_ERROR internal error
5004 * @pre pkgmgrinfo_appinfo_filter_create()
5005 * @post pkgmgrinfo_appinfo_filter_destroy()
5006 * @see pkgmgrinfo_appinfo_filter_count()
5007 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5009 static int get_taskmanageable_app_count()
5013 pkgmgrinfo_appinfo_filter_h handle;
5014 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5015 if (ret != PMINFO_R_OK)
5017 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5018 if (ret != PMINFO_R_OK) {
5019 pkgmgrinfo_appinfo_filter_destroy(handle);
5022 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5023 if (ret != PMINFO_R_OK) {
5024 pkgmgrinfo_appinfo_filter_destroy(handle);
5027 printf("No of taskmanageable apps: %d\n", count);
5028 pkgmgrinfo_appinfo_filter_destroy(handle);
5033 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5034 const char *property, const bool value);
5037 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5038 * @brief This API adds an integer filter property to the filter handle
5040 * @par This API is for package-manager client application
5041 * @par Sync (or) Async : Synchronous API
5043 * @param[in] handle pointer to the application info filter handle.
5044 * @param[in] property integer property name.
5045 * @param[in] value value corresponding to the property.
5046 * @return 0 if success, error code(<0) if fail
5047 * @retval PMINFO_R_OK success
5048 * @retval PMINFO_R_EINVAL invalid argument
5049 * @retval PMINFO_R_ERROR internal error
5050 * @pre pkgmgrinfo_appinfo_filter_create()
5051 * @post pkgmgrinfo_appinfo_filter_destroy()
5052 * @see pkgmgrinfo_appinfo_filter_count()
5053 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5055 static int get_taskmanageable_app_count()
5059 pkgmgrinfo_appinfo_filter_h handle;
5060 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5061 if (ret != PMINFO_R_OK)
5063 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5064 if (ret != PMINFO_R_OK) {
5065 pkgmgrinfo_appinfo_filter_destroy(handle);
5068 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5069 if (ret != PMINFO_R_OK) {
5070 pkgmgrinfo_appinfo_filter_destroy(handle);
5073 printf("No of apps: %d\n", count);
5074 pkgmgrinfo_appinfo_filter_destroy(handle);
5079 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5080 const char *property, const int value);
5083 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5084 * @brief This API adds a string filter property to the filter handle
5086 * @par This API is for package-manager client application
5087 * @par Sync (or) Async : Synchronous API
5089 * @param[in] handle pointer to the application info filter handle.
5090 * @param[in] property string property name.
5091 * @param[in] value value corresponding to the property.
5092 * @return 0 if success, error code(<0) if fail
5093 * @retval PMINFO_R_OK success
5094 * @retval PMINFO_R_EINVAL invalid argument
5095 * @retval PMINFO_R_ERROR internal error
5096 * @pre pkgmgrinfo_appinfo_filter_create()
5097 * @post pkgmgrinfo_appinfo_filter_destroy()
5098 * @see pkgmgrinfo_appinfo_filter_count()
5099 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5101 static int get_capp_count()
5105 pkgmgrinfo_appinfo_filter_h handle;
5106 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5107 if (ret != PMINFO_R_OK)
5109 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5110 if (ret != PMINFO_R_OK) {
5111 pkgmgrinfo_appinfo_filter_destroy(handle);
5114 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5115 if (ret != PMINFO_R_OK) {
5116 pkgmgrinfo_appinfo_filter_destroy(handle);
5119 printf("No of capp: %d\n", count);
5120 pkgmgrinfo_appinfo_filter_destroy(handle);
5125 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5126 const char *property, const char *value);
5129 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5130 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5132 * @par This API is for package-manager client application
5133 * @par Sync (or) Async : Synchronous API
5135 * @param[in] handle pointer to the application info filter handle.
5136 * @param[in] app_cb callback function.
5137 * @param[in] user_data user data to be passed to the callback function
5138 * @return 0 if success, error code(<0) if fail
5139 * @retval PMINFO_R_OK success
5140 * @retval PMINFO_R_EINVAL invalid argument
5141 * @retval PMINFO_R_ERROR internal error
5142 * @pre pkgmgrinfo_appinfo_filter_create()
5143 * @post pkgmgrinfo_appinfo_filter_destroy()
5144 * @see pkgmgrinfo_appinfo_filter_count()
5146 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5149 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5150 printf("appid : %s\n", appid);
5154 static int get_capp_list()
5157 pkgmgrinfo_appinfo_filter_h handle;
5158 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5159 if (ret != PMINFO_R_OK)
5161 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5162 if (ret != PMINFO_R_OK) {
5163 pkgmgrinfo_appinfo_filter_destroy(handle);
5166 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5167 if (ret != PMINFO_R_OK) {
5168 pkgmgrinfo_appinfo_filter_destroy(handle);
5171 pkgmgrinfo_appinfo_filter_destroy(handle);
5176 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5177 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5178 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5179 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5182 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5183 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5184 * @brief This API counts the application that satisfy the filter conditions
5186 * @par This API is for package-manager client application
5187 * @par Sync (or) Async : Synchronous API
5189 * @param[in] handle pointer to the application info filter handle.
5190 * @param[in] count pointer to store count value
5191 * @param[in] uid the addressee user id of the instruction
5192 * @return 0 if success, error code(<0) if fail
5193 * @retval PMINFO_R_OK success
5194 * @retval PMINFO_R_EINVAL invalid argument
5195 * @retval PMINFO_R_ERROR internal error
5196 * @pre pkgmgrinfo_appinfo_filter_create()
5197 * @post pkgmgrinfo_appinfo_filter_destroy()
5198 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5200 static int get_capp_count()
5204 pkgmgrinfo_appinfo_filter_h handle;
5205 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5206 if (ret != PMINFO_R_OK)
5208 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5209 if (ret != PMINFO_R_OK) {
5210 pkgmgrinfo_appinfo_filter_destroy(handle);
5213 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5214 if (ret != PMINFO_R_OK) {
5215 pkgmgrinfo_appinfo_filter_destroy(handle);
5218 printf("No of capp: %d\n", count);
5219 pkgmgrinfo_appinfo_filter_destroy(handle);
5224 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5225 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5227 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5228 * @brief This API creates the application's metadata information filter handle from db.
5230 * @par This API is for package-manager client application
5231 * @par Sync (or) Async : Synchronous API
5233 * @param[out] handle pointer to the application metadata info filter handle.
5234 * @return 0 if success, error code(<0) if fail
5235 * @retval PMINFO_R_OK success
5236 * @retval PMINFO_R_EINVAL invalid argument
5237 * @retval PMINFO_R_ERROR internal error
5239 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5240 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5242 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5245 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5246 printf("appid : %s\n", appid);
5250 static int get_app_list(const char *mkey, const char *mvalue)
5253 pkgmgrinfo_appinfo_metadata_filter_h handle;
5254 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5255 if (ret != PMINFO_R_OK)
5257 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5258 if (ret != PMINFO_R_OK) {
5259 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5262 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5263 if (ret != PMINFO_R_OK) {
5264 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5267 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5272 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5275 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5276 * @brief This API destroys the application's metadata information filter handle.
5278 * @par This API is for package-manager client application
5279 * @par Sync (or) Async : Synchronous API
5281 * @param[in] handle pointer to the application metadata info filter handle.
5282 * @return 0 if success, error code(<0) if fail
5283 * @retval PMINFO_R_OK success
5284 * @retval PMINFO_R_EINVAL invalid argument
5285 * @retval PMINFO_R_ERROR internal error
5286 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5288 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5290 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5293 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5294 printf("appid : %s\n", appid);
5298 static int get_app_list(const char *mkey, const char *mvalue)
5301 pkgmgrinfo_appinfo_metadata_filter_h handle;
5302 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5303 if (ret != PMINFO_R_OK)
5305 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5306 if (ret != PMINFO_R_OK) {
5307 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5310 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5311 if (ret != PMINFO_R_OK) {
5312 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5315 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5320 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5323 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5324 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5325 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5327 * @par This API is for package-manager client application
5328 * @par Sync (or) Async : Synchronous API
5330 * @param[in] handle pointer to the application metadata info filter handle.
5331 * @param[in] key pointer to metadata key
5332 * @param[in] value pointer to metadata value
5333 * @return 0 if success, error code(<0) if fail
5334 * @retval PMINFO_R_OK success
5335 * @retval PMINFO_R_EINVAL invalid argument
5336 * @retval PMINFO_R_ERROR internal error
5337 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5338 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5339 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5341 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5344 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5345 printf("appid : %s\n", appid);
5349 static int get_app_list(const char *mkey, const char *mvalue)
5352 pkgmgrinfo_appinfo_metadata_filter_h handle;
5353 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5354 if (ret != PMINFO_R_OK)
5356 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5357 if (ret != PMINFO_R_OK) {
5358 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5361 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5362 if (ret != PMINFO_R_OK) {
5363 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5366 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5371 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5372 const char *key, const char *value);
5375 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5376 * @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)
5377 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5378 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5379 * negative value, no more callbacks will be called and API will return.
5381 * @par This API is for package-manager client application
5382 * @par Sync (or) Async : Synchronous API
5384 * @param[in] handle pointer to the application metadata info filter handle.
5385 * @param[in] app_cb function pointer to callback
5386 * @param[in] user_data pointer to user data
5387 * @param[in] uid the addressee user id of the instruction
5388 * @return 0 if success, error code(<0) if fail
5389 * @retval PMINFO_R_OK success
5390 * @retval PMINFO_R_EINVAL invalid argument
5391 * @retval PMINFO_R_ERROR internal error
5392 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5393 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5395 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5398 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5399 printf("appid : %s\n", appid);
5403 static int get_app_list(const char *mkey, const char *mvalue)
5406 pkgmgrinfo_appinfo_metadata_filter_h handle;
5407 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5408 if (ret != PMINFO_R_OK)
5410 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5411 if (ret != PMINFO_R_OK) {
5412 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5415 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5416 if (ret != PMINFO_R_OK) {
5417 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5420 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5425 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5426 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5427 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5428 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5430 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5431 * @brief This API creates the package cert information handle to get data from db.
5433 * @par This API is for package-manager client application
5434 * @par Sync (or) Async : Synchronous API
5436 * @param[out] handle pointer to the package cert handle.
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
5442 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5443 * @see pkgmgrinfo_pkginfo_get_cert_value()
5444 * @see pkgmgrinfo_pkginfo_load_certinfo()
5446 static int get_cert_info(const char *pkgid)
5449 pkgmgrinfo_certinfo_h handle;
5450 char *auth_cert = NULL;
5451 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5452 if (ret != PMINFO_R_OK)
5454 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5455 if (ret != PMINFO_R_OK) {
5456 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5459 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5460 if (ret != PMINFO_R_OK) {
5461 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5464 printf("Author root certificate: %s\n", auth_root);
5465 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5470 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5473 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5474 * @brief This API loads the package cert information handle with data from db.
5476 * @par This API is for package-manager client application
5477 * @par Sync (or) Async : Synchronous API
5479 * @param[in] pkgid pointer to the package ID.
5480 * @param[in] handle pointer to the package cert handle.
5481 * @return 0 if success, error code(<0) if fail
5482 * @retval PMINFO_R_OK success
5483 * @retval PMINFO_R_EINVAL invalid argument
5484 * @retval PMINFO_R_ERROR internal error
5485 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5486 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5487 * @see pkgmgrinfo_pkginfo_get_cert_value()
5489 static int get_cert_info(const char *pkgid)
5492 pkgmgrinfo_certinfo_h handle;
5493 char *auth_cert = NULL;
5494 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5495 if (ret != PMINFO_R_OK)
5497 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5498 if (ret != PMINFO_R_OK) {
5499 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5502 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5503 if (ret != PMINFO_R_OK) {
5504 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5507 printf("Author root certificate: %s\n", auth_root);
5508 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5513 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5516 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5517 * @brief This API gets the package cert information from the handle
5519 * @par This API is for package-manager client application
5520 * @par Sync (or) Async : Synchronous API
5522 * @param[in] handle pointer to the package cert handle.
5523 * @param[in] cert_type certificate type
5524 * @param[out] cert_value pointer to hold certificate value
5525 * @return 0 if success, error code(<0) if fail
5526 * @retval PMINFO_R_OK success
5527 * @retval PMINFO_R_EINVAL invalid argument
5528 * @retval PMINFO_R_ERROR internal error
5529 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5530 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5531 * @see pkgmgrinfo_pkginfo_load_certinfo()
5533 static int get_cert_info(const char *pkgid)
5536 pkgmgrinfo_certinfo_h handle;
5537 char *auth_cert = NULL;
5538 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5539 if (ret != PMINFO_R_OK)
5541 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5542 if (ret != PMINFO_R_OK) {
5543 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5546 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5547 if (ret != PMINFO_R_OK) {
5548 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5551 printf("Author root certificate: %s\n", auth_root);
5552 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5557 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5560 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5561 * @brief This API destroys the package cert information handle freeing up all the resources
5563 * @par This API is for package-manager client application
5564 * @par Sync (or) Async : Synchronous API
5566 * @param[in] handle pointer to the package cert handle.
5567 * @return 0 if success, error code(<0) if fail
5568 * @retval PMINFO_R_OK success
5569 * @retval PMINFO_R_EINVAL invalid argument
5570 * @retval PMINFO_R_ERROR internal error
5571 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5573 * @see pkgmgrinfo_pkginfo_load_certinfo()
5575 static int get_cert_info(const char *pkgid)
5578 pkgmgrinfo_certinfo_h handle;
5579 char *auth_cert = NULL;
5580 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5581 if (ret != PMINFO_R_OK)
5583 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5584 if (ret != PMINFO_R_OK) {
5585 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5588 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5589 if (ret != PMINFO_R_OK) {
5590 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5593 printf("Author root certificate: %s\n", auth_root);
5594 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5599 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5602 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5603 * @brief This API deletes the package cert information from DB
5605 * @par This API is for package-manager client application
5606 * @par Sync (or) Async : Synchronous API
5608 * @param[in] pkgid pointer to the package ID.
5609 * @return 0 if success, error code(<0) if fail
5610 * @retval PMINFO_R_OK success
5611 * @retval PMINFO_R_EINVAL invalid argument
5612 * @retval PMINFO_R_ERROR internal error
5616 static int delete_cert_info(const char *pkgid)
5619 ret = pkgmgrinfo_delete_certinfo(pkgid);
5620 if (ret != PMINFO_R_OK)
5626 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5627 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5630 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5631 * @brief This API creates the package cert information handle to set data in db.
5633 * @par This API is for package-manager client application
5634 * @par Sync (or) Async : Synchronous API
5636 * @param[out] handle pointer to the package cert handle.
5637 * @return 0 if success, error code(<0) if fail
5638 * @retval PMINFO_R_OK success
5639 * @retval PMINFO_R_EINVAL invalid argument
5640 * @retval PMINFO_R_ERROR internal error
5642 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5643 * @see pkgmgrinfo_set_cert_value()
5644 * @see pkgmgrinfo_save_certinfo()
5646 static int set_cert_in_db(const char *pkgid)
5649 pkgmgrinfo_instcertinfo_h handle;
5650 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5651 if (ret != PMINFO_R_OK)
5653 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5654 if (ret != PMINFO_R_OK) {
5655 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5658 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5659 if (ret != PMINFO_R_OK) {
5660 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5663 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5668 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5671 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5672 * @brief This API sets the package cert information in the handle.
5674 * @par This API is for package-manager client application
5675 * @par Sync (or) Async : Synchronous API
5677 * @param[in] handle pointer to the package cert handle.
5678 * @param[in] cert_type certificate type.
5679 * @param[in] cert_value certificate value.
5680 * @return 0 if success, error code(<0) if fail
5681 * @retval PMINFO_R_OK success
5682 * @retval PMINFO_R_EINVAL invalid argument
5683 * @retval PMINFO_R_ERROR internal error
5684 * @pre pkgmgrinfo_create_certinfo_set_handle()
5685 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5686 * @see pkgmgrinfo_save_certinfo()
5688 static int set_cert_in_db(const char *pkgid)
5691 pkgmgrinfo_instcertinfo_h handle;
5692 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5693 if (ret != PMINFO_R_OK)
5695 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5696 if (ret != PMINFO_R_OK) {
5697 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5700 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5701 if (ret != PMINFO_R_OK) {
5702 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5705 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5710 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5713 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5714 * @brief This API saves the package cert information in the DB.
5716 * @par This API is for package-manager client application
5717 * @par Sync (or) Async : Synchronous API
5719 * @param[in] pkgid pointer to the package ID.
5720 * @param[in] handle pointer to the package cert handle.
5721 * @return 0 if success, error code(<0) if fail
5722 * @retval PMINFO_R_OK success
5723 * @retval PMINFO_R_EINVAL invalid argument
5724 * @retval PMINFO_R_ERROR internal error
5725 * @pre pkgmgrinfo_create_certinfo_set_handle()
5726 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5727 * @see pkgmgrinfo_save_certinfo()
5729 static int set_cert_in_db(const char *pkgid)
5732 pkgmgrinfo_instcertinfo_h handle;
5733 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5734 if (ret != PMINFO_R_OK)
5736 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5737 if (ret != PMINFO_R_OK) {
5738 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5741 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5742 if (ret != PMINFO_R_OK) {
5743 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5746 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5751 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5754 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5755 * @brief This API destroys the package cert information handle freeing up all the resources.
5757 * @par This API is for package-manager client application
5758 * @par Sync (or) Async : Synchronous API
5760 * @param[in] handle pointer to the package cert handle.
5761 * @return 0 if success, error code(<0) if fail
5762 * @retval PMINFO_R_OK success
5763 * @retval PMINFO_R_EINVAL invalid argument
5764 * @retval PMINFO_R_ERROR internal error
5765 * @pre pkgmgrinfo_create_certinfo_set_handle()
5767 * @see pkgmgrinfo_save_certinfo()
5769 static int set_cert_in_db(const char *pkgid)
5772 pkgmgrinfo_instcertinfo_h handle;
5773 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5774 if (ret != PMINFO_R_OK)
5776 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5777 if (ret != PMINFO_R_OK) {
5778 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5781 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5782 if (ret != PMINFO_R_OK) {
5783 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5786 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5791 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5794 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5795 * @brief This API gets the datacontrol info
5797 * @par This API is for package-manager client application
5798 * @par Sync (or) Async : Synchronous API
5800 * @param[in] providerid pointer to the providerid of dataconltrol.
5801 * @param[in] type pointer to the type of dataconltrol.
5802 * @param[out] appid pointer to hold appid, need to free after using
5803 * @param[out] access pointer to hold access, need to free after using
5804 * @return 0 if success, error code(<0) if fail
5805 * @retval PMINFO_R_OK success
5806 * @retval PMINFO_R_EINVAL invalid argument
5807 * @retval PMINFO_R_ERROR internal error
5810 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5813 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5814 * @brief This API gets the application 'guest mode visibility' value from the DB
5816 * @par This API is for package-manager client application
5817 * @par Sync (or) Async : Synchronous API
5819 * @param[in] handle pointer to application info handle
5820 * @param[out] status pointer to hold app guest mode visibility value
5821 * @return 0 if success, error code(<0) if fail
5822 * @retval PMINFO_R_OK success
5823 * @retval PMINFO_R_EINVAL invalid argument
5824 * @retval PMINFO_R_ERROR internal error
5825 * @pre pkgmgrinfo_appinfo_get_appinfo()
5826 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5827 * @see pkgmgrinfo_appinfo_get_appid()
5828 * @see pkgmgrinfo_appinfo_is_multiple()
5830 static int get_app_guestmode_visibility(const char *appid)
5834 pkgmgrinfo_appinfo_h handle;
5835 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5836 if (ret != PMINFO_R_OK)
5838 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5839 if (ret != PMINFO_R_OK) {
5840 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5843 printf("app guest mode visibility: %d\n", status);
5844 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5849 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5852 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5853 * @brief This API sets the package 'installed_storage' value in db
5855 * @par This API is for package-manager client application
5856 * @par Sync (or) Async : Synchronous API
5858 * @param[in] pkgid pointer to the package ID.
5859 * @param[in] location package install location
5860 * @param[in] external_pkg_path image path if pkg has installed at external storage
5861 * @return 0 if success, error code(<0) if fail
5862 * @retval PMINFO_R_OK success
5863 * @retval PMINFO_R_EINVAL invalid argument
5864 * @retval PMINFO_R_ERROR internal error
5866 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5870 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5871 if (ret != PMINFO_R_OK) {
5878 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
5879 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
5881 /* version compare */
5882 int pkgmgrinfo_compare_package_version(const char *current_version,
5883 const char *target_version, pkgmgrinfo_version_compare_type *res);
5890 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5891 int flag, void *user_data, uid_t uid);
5892 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5893 int flag, void *user_data);
5894 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5895 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5897 int pkgmgrinfo_appinfo_get_installed_list_full(
5898 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5901 * @pkgmgrinfo client API end
5909 #endif /* __PKG_INFO_H__ */