4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
115 /** Integer property for filtering based on package info*/
116 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE"
149 /** Integer property for filtering app support mode */
150 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
173 /** will be updated*/
174 /** string property for filtering based on pkg info*/
175 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
177 /* For multiuser support */
178 const char *getIconPath(uid_t uid, bool readonly);
179 char *getUserPkgParserDBPath(void);
180 char *getUserPkgParserDBPathUID(uid_t uid);
181 char *getUserPkgCertDBPath(void);
182 char *getUserPkgCertDBPathUID(uid_t uid);
183 const char *getUserManifestPath(uid_t uid, bool readonly);
186 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
187 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
188 * @brief This API gets list of installed packages
190 * @par This API is for package-manager client application
191 * @par Sync (or) Async : Synchronous API
192 * @param[in] pkg_list_cb iteration function for list
193 * @param[in] user_data user data to be passed to callback function
194 * @param[in] uid the addressee user id of the instruction
195 * @return 0 if success, error code(<0) if fail
196 * @retval PMINFO_R_OK success
197 * @retval PMINFO_R_EINVAL invalid argument
198 * @retval PMINFO_R_ERROR internal error
202 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
206 pkgid1 = (char *)user_data;
207 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
208 if (strcmp(pkgid1, pkgid2) == 0) {
215 static int list_pkgs()
218 char *name = "helloworld";
219 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
220 if (ret != PMINFO_R_OK) {
227 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
228 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
231 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
232 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
233 * @brief This API gets list of disabled packages
235 * @par This API is for package-manager client application
236 * @par Sync (or) Async : Synchronous API
237 * @param[in] pkg_list_cb iteration function for list
238 * @param[in] user_data user data to be passed to callback function
239 * @param[in] uid the addressee user id of the instruction
240 * @return 0 if success, error code(<0) if fail
241 * @retval PMINFO_R_OK success
242 * @retval PMINFO_R_EINVAL invalid argument
243 * @retval PMINFO_R_ERROR internal error
247 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
248 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
251 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
252 * @brief This API creates the package information handle from db which is not disabled
254 * @par This API is for package-manager client application
255 * @par Sync (or) Async : Synchronous API
257 * @param[in] pkgid pointer to package ID
258 * @param[in] uid the addressee user id of the instruction
259 * @param[out] handle pointer to the package info handle.
260 * @return 0 if success, error code(<0) if fail
261 * @retval PMINFO_R_OK success
262 * @retval PMINFO_R_EINVAL invalid argument
263 * @retval PMINFO_R_ERROR internal error
265 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
266 * @see pkgmgrinfo_pkginfo_get_pkgid()
267 * @see pkgmgrinfo_pkginfo_is_removable()
269 static int get_pkg_type(const char *pkgid)
273 pkgmgrinfo_pkginfo_h handle;
274 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
275 if (ret != PMINFO_R_OK)
277 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
278 if (ret != PMINFO_R_OK) {
279 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
282 printf("pkgtype: %s\n", type);
283 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
288 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
289 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
292 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
293 * @brief This API creates the disabled package information handle from db
295 * @par This API is for package-manager client application
296 * @par Sync (or) Async : Synchronous API
298 * @param[in] pkgid pointer to package ID
299 * @param[in] uid the addressee user id of the instruction
300 * @param[out] handle pointer to the package info handle.
301 * @return 0 if success, error code(<0) if fail
302 * @retval PMINFO_R_OK success
303 * @retval PMINFO_R_EINVAL invalid argument
304 * @retval PMINFO_R_ERROR internal error
306 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
307 * @see pkgmgrinfo_pkginfo_get_pkginfo()
309 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
310 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
313 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
314 * @brief This API creates the package information handle from db regardless of its disable or storage status
316 * @par This API is for package-manager client application
317 * @par Sync (or) Async : Synchronous API
319 * @param[in] pkgid pointer to package ID
320 * @param[in] uid the addressee user id of the instruction
321 * @param[out] handle pointer to the package info handle.
322 * @return 0 if success, error code(<0) if fail
323 * @retval PMINFO_R_OK success
324 * @retval PMINFO_R_EINVAL invalid argument
325 * @retval PMINFO_R_ERROR internal error
327 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
328 * @see pkgmgrinfo_pkginfo_get_pkgid()
329 * @see pkgmgrinfo_pkginfo_is_removable()
331 static int get_pkg_type(const char *pkgid)
335 pkgmgrinfo_pkginfo_h handle;
336 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
337 if (ret != PMINFO_R_OK)
339 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
340 if (ret != PMINFO_R_OK) {
341 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
344 printf("pkgtype: %s\n", type);
345 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
350 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
351 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
354 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
355 * @brief This API gets the package name from the package ID
357 * @par This API is for package-manager client application
358 * @par Sync (or) Async : Synchronous API
360 * @param[in] handle pointer to package info handle
361 * @param[out] pkg_name pointer to hold package name
362 * @return 0 if success, error code(<0) if fail
363 * @retval PMINFO_R_OK success
364 * @retval PMINFO_R_EINVAL invalid argument
365 * @retval PMINFO_R_ERROR internal error
366 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
367 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
368 * @see pkgmgrinfo_pkginfo_get_type()
369 * @see pkgmgrinfo_pkginfo_is_removable()
371 static int get_pkg_name(const char *pkgid)
374 char *pkgname = NULL;
375 pkgmgrinfo_pkginfo_h handle;
376 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
377 if (ret != PMINFO_R_OK)
379 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
380 if (ret != PMINFO_R_OK) {
381 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
384 printf("pkgname: %s\n", pkgname);
385 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
390 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
393 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
394 * @brief This API gets the package id from the package ID
396 * @par This API is for package-manager client application
397 * @par Sync (or) Async : Synchronous API
399 * @param[in] handle pointer to package info handle
400 * @param[out] pkgid pointer to hold package id
401 * @return 0 if success, error code(<0) if fail
402 * @retval PMINFO_R_OK success
403 * @retval PMINFO_R_EINVAL invalid argument
404 * @retval PMINFO_R_ERROR internal error
405 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
406 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
407 * @see pkgmgrinfo_pkginfo_get_type()
408 * @see pkgmgrinfo_pkginfo_is_removable()
410 static int get_pkgid(const char *pkgid)
414 pkgmgrinfo_pkginfo_h handle;
415 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
416 if (ret != PMINFO_R_OK)
418 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
419 if (ret != PMINFO_R_OK) {
420 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
423 printf("pkg id: %s\n", pkg_id);
424 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
429 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
432 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
433 * @brief This API gets the package type from the package ID
435 * @par This API is for package-manager client application
436 * @par Sync (or) Async : Synchronous API
438 * @param[in] handle pointer to package info handle
439 * @param[out] type pointer to hold package type
440 * @return 0 if success, error code(<0) if fail
441 * @retval PMINFO_R_OK success
442 * @retval PMINFO_R_EINVAL invalid argument
443 * @retval PMINFO_R_ERROR internal error
444 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
445 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
446 * @see pkgmgrinfo_pkginfo_get_pkgid()
447 * @see pkgmgrinfo_pkginfo_is_removable()
449 static int get_pkg_type(const char *pkgid)
453 pkgmgrinfo_pkginfo_h handle;
454 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
455 if (ret != PMINFO_R_OK)
457 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
458 if (ret != PMINFO_R_OK) {
459 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
462 printf("pkgtype: %s\n", type);
463 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
468 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
471 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
472 * @brief This API gets the package version from the package ID
474 * @par This API is for package-manager client application
475 * @par Sync (or) Async : Synchronous API
477 * @param[in] handle pointer to package info handle
478 * @param[out] version pointer to hold package version
479 * @return 0 if success, error code(<0) if fail
480 * @retval PMINFO_R_OK success
481 * @retval PMINFO_R_EINVAL invalid argument
482 * @retval PMINFO_R_ERROR internal error
483 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
484 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
485 * @see pkgmgrinfo_pkginfo_get_pkgid()
486 * @see pkgmgrinfo_pkginfo_is_removable()
488 static int get_pkg_version(const char *pkgid)
491 char *version = NULL;
492 pkgmgrinfo_pkginfo_h handle;
493 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
494 if (ret != PMINFO_R_OK)
496 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
497 if (ret != PMINFO_R_OK) {
498 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
501 printf("pkg version: %s\n", version);
502 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
507 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
510 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
511 * @brief This API gets the package api_version from the package ID
513 * @par This API is for package-manager client application
514 * @par Sync (or) Async : Synchronous API
516 * @param[in] handle pointer to package info handle
517 * @param[out] api_version pointer to hold package api_version
518 * @return 0 if success, error code(<0) if fail
519 * @retval PMINFO_R_OK success
520 * @retval PMINFO_R_EINVAL invalid argument
521 * @retval PMINFO_R_ERROR internal error
522 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
523 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
524 * @see pkgmgrinfo_pkginfo_get_pkgid()
525 * @see pkgmgrinfo_pkginfo_is_removable()
527 static int get_pkg_api_version(const char *pkgid)
530 char *api_version = NULL;
531 pkgmgrinfo_pkginfo_h handle = NULL;
532 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
533 if (ret != PMINFO_R_OK)
535 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
536 if (ret != PMINFO_R_OK) {
537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
540 printf("pkg api_version: %s\n", api_version);
541 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
546 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
549 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
550 * @brief This API gets tep(tizen expansion package) file name associated with the package
552 * @par This API is for package-manager client application
553 * @par Sync (or) Async : Synchronous API
555 * @param[in] handle pointer to the pkginfo handle.
556 * @param[out] tep_name pointer to hold tep name
557 * @return 0 if success, error code(<0) if fail
558 * @retval PMINFO_R_OK success
559 * @retval PMINFO_R_EINVAL invalid argument
560 * @retval PMINFO_R_ERROR internal error
561 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
562 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
563 * @see pkgmgrinfo_pkginfo_get_pkgid()
565 static int get_tep_name(const char *pkgid)
568 char *tep_name = NULL;
569 pkgmgrinfo_pkginfo_h handle = NULL;
570 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
571 if (ret != PMINFO_R_OK)
573 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
574 if (ret != PMINFO_R_OK) {
575 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
578 printf("TEP name is: %s\n", tep_name);
579 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
584 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
587 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
588 * @brief This API gets package mount point path associated with the package
589 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
591 * @par This API is for package-manager client application
592 * @par Sync (or) Async : Synchronous API
594 * @param[in] handle pointer to the pkginfo handle.
595 * @param[out] zip_mount_file pointer to hold zip mount file
596 * @return 0 if success, error code(<0) if fail
597 * @retval PMINFO_R_OK success
598 * @retval PMINFO_R_EINVAL invalid argument
599 * @retval PMINFO_R_ERROR internal error
600 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
601 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
602 * @see pkgmgrinfo_pkginfo_get_pkgid()
604 static int get_zip_mount_file(const char *pkgid)
607 char *zip_mount_file = NULL;
608 pkgmgrinfo_pkginfo_h handle = NULL;
609 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
610 if (ret != PMINFO_R_OK)
612 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
613 if (ret != PMINFO_R_OK) {
614 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
617 if (zip_mount_file != NULL)
618 printf("Zip mount path is: %s\n", zip_mount_file);
619 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
624 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
627 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
628 * @brief This API gets the package install location from the package ID
630 * @par This API is for package-manager client application
631 * @par Sync (or) Async : Synchronous API
633 * @param[in] handle pointer to package info handle
634 * @param[out] location pointer to hold package install location
635 * @return 0 if success, error code(<0) if fail
636 * @retval PMINFO_R_OK success
637 * @retval PMINFO_R_EINVAL invalid argument
638 * @retval PMINFO_R_ERROR internal error
639 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
640 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
641 * @see pkgmgrinfo_pkginfo_get_pkgid()
642 * @see pkgmgrinfo_pkginfo_is_removable()
644 static int get_pkg_install_location(const char *pkgid)
647 pkgmgrinfo_install_location location;
648 pkgmgrinfo_pkginfo_h handle;
649 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
650 if (ret != PMINFO_R_OK)
652 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
653 if (ret != PMINFO_R_OK) {
654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
657 printf("pkg install location: %d\n", location);
658 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
663 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
666 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
667 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
668 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
669 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
671 * @par This API is for package-manager client application
672 * @par Sync (or) Async : Synchronous API
674 * @param[in] handle pointer to package info handle
675 * @param[out] size pointer to hold package size
676 * @return 0 if success, error code(<0) if fail
677 * @retval PMINFO_R_OK success
678 * @retval PMINFO_R_EINVAL invalid argument
679 * @retval PMINFO_R_ERROR internal error
680 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
681 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
682 * @see pkgmgrinfo_pkginfo_get_pkgid()
683 * @see pkgmgrinfo_pkginfo_is_removable()
685 static int get_pkg_size(const char *pkgid)
689 pkgmgrinfo_pkginfo_h handle;
690 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
691 if (ret != PMINFO_R_OK)
693 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
694 if (ret != PMINFO_R_OK) {
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
698 printf("pkgsize: %d\n", size);
699 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
704 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
707 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
708 * @brief This API gets the package icon from the package ID
710 * @par This API is for package-manager client application
711 * @par Sync (or) Async : Synchronous API
713 * @param[in] handle pointer to package info handle
714 * @param[out] icon pointer to hold package icon
715 * @return 0 if success, error code(<0) if fail
716 * @retval PMINFO_R_OK success
717 * @retval PMINFO_R_EINVAL invalid argument
718 * @retval PMINFO_R_ERROR internal error
719 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
720 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
721 * @see pkgmgrinfo_pkginfo_get_pkgid()
722 * @see pkgmgrinfo_pkginfo_is_removable()
724 static int get_pkg_icon(const char *pkgid)
728 pkgmgrinfo_pkginfo_h handle;
729 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
730 if (ret != PMINFO_R_OK)
732 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
733 if (ret != PMINFO_R_OK) {
734 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
737 printf("pkg icon: %s\n", icon);
738 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
743 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
746 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
747 * @brief This API gets the package label from the package ID
749 * @par This API is for package-manager client application
750 * @par Sync (or) Async : Synchronous API
752 * @param[in] handle pointer to package info handle
753 * @param[out] label pointer to hold package label
754 * @return 0 if success, error code(<0) if fail
755 * @retval PMINFO_R_OK success
756 * @retval PMINFO_R_EINVAL invalid argument
757 * @retval PMINFO_R_ERROR internal error
758 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
759 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
760 * @see pkgmgrinfo_pkginfo_get_pkgid()
761 * @see pkgmgrinfo_pkginfo_is_removable()
763 static int get_pkg_label(const char *pkgid)
767 pkgmgrinfo_pkginfo_h handle;
768 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
769 if (ret != PMINFO_R_OK)
771 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
772 if (ret != PMINFO_R_OK) {
773 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
776 printf("pkg label: %s\n", label);
777 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
782 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
785 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
786 * @brief This API gets the package description from the package ID
788 * @par This API is for package-manager client application
789 * @par Sync (or) Async : Synchronous API
791 * @param[in] handle pointer to package info handle
792 * @param[out] description pointer to hold package description
793 * @return 0 if success, error code(<0) if fail
794 * @retval PMINFO_R_OK success
795 * @retval PMINFO_R_EINVAL invalid argument
796 * @retval PMINFO_R_ERROR internal error
797 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
798 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
799 * @see pkgmgrinfo_pkginfo_get_pkgid()
800 * @see pkgmgrinfo_pkginfo_is_removable()
802 static int get_pkg_description(const char *pkgid)
805 char *description = NULL;
806 pkgmgrinfo_pkginfo_h handle;
807 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
808 if (ret != PMINFO_R_OK)
810 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
811 if (ret != PMINFO_R_OK) {
812 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
815 printf("pkg description: %s\n", description);
816 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
821 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
824 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
825 * @brief This API gets the package's author name from the package ID
827 * @par This API is for package-manager client application
828 * @par Sync (or) Async : Synchronous API
830 * @param[in] handle pointer to package info handle
831 * @param[out] author_name pointer to hold package author name
832 * @return 0 if success, error code(<0) if fail
833 * @retval PMINFO_R_OK success
834 * @retval PMINFO_R_EINVAL invalid argument
835 * @retval PMINFO_R_ERROR internal error
836 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
837 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
838 * @see pkgmgrinfo_pkginfo_get_pkgid()
839 * @see pkgmgrinfo_pkginfo_is_removable()
841 static int get_pkg_author_name(const char *pkgid)
844 char *author_name = NULL;
845 pkgmgrinfo_pkginfo_h handle;
846 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
847 if (ret != PMINFO_R_OK)
849 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
850 if (ret != PMINFO_R_OK) {
851 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
854 printf("pkg author name: %s\n", author_name);
855 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
860 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
863 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
864 * @brief This API gets the package's author email from the package ID
866 * @par This API is for package-manager client application
867 * @par Sync (or) Async : Synchronous API
869 * @param[in] handle pointer to package info handle
870 * @param[out] author_email pointer to hold package author email
871 * @return 0 if success, error code(<0) if fail
872 * @retval PMINFO_R_OK success
873 * @retval PMINFO_R_EINVAL invalid argument
874 * @retval PMINFO_R_ERROR internal error
875 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
876 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
877 * @see pkgmgrinfo_pkginfo_get_pkgid()
878 * @see pkgmgrinfo_pkginfo_is_removable()
880 static int get_pkg_author_email(const char *pkgid)
883 char *author_email = NULL;
884 pkgmgrinfo_pkginfo_h handle;
885 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
886 if (ret != PMINFO_R_OK)
888 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
889 if (ret != PMINFO_R_OK) {
890 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
893 printf("pkg author email: %s\n", author_email);
894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
899 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
902 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
903 * @brief This API gets the package's author href from the package ID
905 * @par This API is for package-manager client application
906 * @par Sync (or) Async : Synchronous API
908 * @param[in] handle pointer to package info handle
909 * @param[out] author_href pointer to hold package author href
910 * @return 0 if success, error code(<0) if fail
911 * @retval PMINFO_R_OK success
912 * @retval PMINFO_R_EINVAL invalid argument
913 * @retval PMINFO_R_ERROR internal error
914 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
915 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
916 * @see pkgmgrinfo_pkginfo_get_pkgid()
917 * @see pkgmgrinfo_pkginfo_is_removable()
919 static int get_pkg_author_href(const char *pkgid)
922 char *author_href = NULL;
923 pkgmgrinfo_pkginfo_h handle;
924 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
925 if (ret != PMINFO_R_OK)
927 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
928 if (ret != PMINFO_R_OK) {
929 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
932 printf("pkg author href: %s\n", author_href);
933 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
938 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
941 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
942 * @brief This API gets the package installed storagae value from the package ID
944 * @par This API is for package-manager client application
945 * @par Sync (or) Async : Synchronous API
947 * @param[in] handle pointer to package info handle
948 * @param[out] storage pointer to hold package installed storage
949 * @return 0 if success, error code(<0) if fail
950 * @retval PMINFO_R_OK success
951 * @retval PMINFO_R_EINVAL invalid argument
952 * @retval PMINFO_R_ERROR internal error
953 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
954 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
955 * @see pkgmgrinfo_pkginfo_get_pkgid()
956 * @see pkgmgrinfo_pkginfo_is_removable()
958 static int get_pkg_installed_storage(const char *pkgid)
961 pkgmgrinfo_installed_storage storage;
962 pkgmgrinfo_pkginfo_h handle;
963 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
964 if (ret != PMINFO_R_OK)
966 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
967 if (ret != PMINFO_R_OK) {
968 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
971 printf("pkg installed storage: %d\n", storage);
972 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
977 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
980 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
981 * @brief This API gets the installed time of package from the package ID
983 * @par This API is for package-manager client application
984 * @par Sync (or) Async : Synchronous API
986 * @param[in] handle pointer to package info handle
987 * @param[out] installed_time pointer to hold installed time of package
988 * @return 0 if success, error code(<0) if fail
989 * @retval PMINFO_R_OK success
990 * @retval PMINFO_R_EINVAL invalid argument
991 * @retval PMINFO_R_ERROR internal error
992 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
993 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
994 * @see pkgmgrinfo_pkginfo_get_pkgid()
995 * @see pkgmgrinfo_pkginfo_is_removable()
997 static int get_pkg_installed_time(const char *pkgid)
1000 int installed_time = 0;
1001 pkgmgrinfo_pkginfo_h handle;
1002 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1003 if (ret != PMINFO_R_OK)
1005 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1006 if (ret != PMINFO_R_OK) {
1007 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1010 printf("installed_time: %d\n", installed_time);
1011 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1016 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1019 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1020 * @brief This API gets the launch mode of package from the package ID
1022 * @par This API is for package-manager client application
1023 * @par Sync (or) Async : Synchronous API
1025 * @param[in] handle pointer to package info handle
1026 * @param[out] mode pointer to hold launch mode of package
1027 * @return 0 if success, error code(<0) if fail
1028 * @retval PMINFO_R_OK success
1029 * @retval PMINFO_R_EINVAL invalid argument
1030 * @retval PMINFO_R_ERROR internal error
1031 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1032 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1033 * @see pkgmgrinfo_pkginfo_get_pkgid()
1034 * @see pkgmgrinfo_pkginfo_is_removable()
1036 static int get_pkg_launch_mode(const char *pkgid)
1039 char *launch_mode = NULL;
1040 pkgmgrinfo_pkginfo_h handle;
1041 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1042 if (ret != PMINFO_R_OK)
1044 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1045 if (ret != PMINFO_R_OK) {
1046 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1049 printf("launch mode: %s\n", mode);
1050 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1055 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1058 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1059 * @brief This API gets the store client id of package from the package ID
1061 * @par This API is for package-manager client application
1062 * @par Sync (or) Async : Synchronous API
1064 * @param[in] handle pointer to package info handle
1065 * @param[out] storeclientid pointer to hold store client id of package
1066 * @return 0 if success, error code(<0) if fail
1067 * @retval PMINFO_R_OK success
1068 * @retval PMINFO_R_EINVAL invalid argument
1069 * @retval PMINFO_R_ERROR internal error
1070 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1071 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1072 * @see pkgmgrinfo_pkginfo_get_pkgid()
1073 * @see pkgmgrinfo_pkginfo_is_removable()
1075 static int get_pkg_storeclientid(const char *pkgid)
1078 char *storeclientid = 0;
1079 pkgmgrinfo_pkginfo_h handle;
1080 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1081 if (ret != PMINFO_R_OK)
1083 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1084 if (ret != PMINFO_R_OK) {
1085 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1088 printf(store client id: %s\n", storeclientid);
1089 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1094 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1097 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1098 * @brief This API gets the main app id of package from the package ID
1100 * @par This API is for package-manager client application
1101 * @par Sync (or) Async : Synchronous API
1103 * @param[in] handle pointer to package info handle
1104 * @param[out] mainappid pointer to hold main app id of package
1105 * @return 0 if success, error code(<0) if fail
1106 * @retval PMINFO_R_OK success
1107 * @retval PMINFO_R_EINVAL invalid argument
1108 * @retval PMINFO_R_ERROR internal error
1109 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1110 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1111 * @see pkgmgrinfo_pkginfo_get_pkgid()
1112 * @see pkgmgrinfo_pkginfo_is_removable()
1114 static int get_pkg_mainappid(const char *pkgid)
1117 char *mainappid = 0;
1118 pkgmgrinfo_pkginfo_h handle;
1119 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1120 if (ret != PMINFO_R_OK)
1122 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1123 if (ret != PMINFO_R_OK) {
1124 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1127 printf(main app id: %s\n", mainappid);
1128 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1133 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1136 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1137 * @brief This API gets the url of package from the package ID
1139 * @par This API is for package-manager client application
1140 * @par Sync (or) Async : Synchronous API
1142 * @param[in] handle pointer to package info handle
1143 * @param[out] url pointer to hold url of package
1144 * @return 0 if success, error code(<0) if fail
1145 * @retval PMINFO_R_OK success
1146 * @retval PMINFO_R_EINVAL invalid argument
1147 * @retval PMINFO_R_ERROR internal error
1148 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1149 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1150 * @see pkgmgrinfo_pkginfo_get_pkgid()
1151 * @see pkgmgrinfo_pkginfo_is_removable()
1153 static int get_pkg_url(const char *pkgid)
1157 pkgmgrinfo_pkginfo_h handle;
1158 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1159 if (ret != PMINFO_R_OK)
1161 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1162 if (ret != PMINFO_R_OK) {
1163 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1166 printf("url : %s\n", url);
1167 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1172 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1175 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1176 * @brief This API gets the root path of package
1178 * @par Sync (or) Async : Synchronous API
1180 * @param[in] handle pointer to package info handle
1181 * @param[out] path pointer to hold root path of package
1182 * @return 0 if success, error code(<0) if fail
1183 * @retval PMINFO_R_OK success
1184 * @retval PMINFO_R_EINVAL invalid argument
1185 * @retval PMINFO_R_ERROR internal error
1187 static int get_root_path(const char *pkgid)
1191 pkgmgrinfo_pkginfo_h handle;
1192 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1193 if (ret != PMINFO_R_OK)
1196 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1197 if (ret != PMINFO_R_OK) {
1198 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1201 printf("path : %s\n", path);
1202 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1208 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1212 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1213 * @brief This API gets the csc 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 csc 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_csc_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_csc_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_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1248 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1249 * @brief This API gets the support_mode of package
1251 * @par Sync (or) Async : Synchronous API
1253 * @param[in] handle pointer to package info handle
1254 * @param[out] support_mode pointer to hold support_mode of package
1255 * @return 0 if success, error code(<0) if fail
1256 * @retval PMINFO_R_OK success
1257 * @retval PMINFO_R_EINVAL invalid argument
1258 * @retval PMINFO_R_ERROR internal error
1260 static int get_support_mode(const char *pkgid)
1263 int support_mode = 0;
1264 pkgmgrinfo_pkginfo_h handle = NULL;
1265 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1266 if (ret != PMINFO_R_OK)
1269 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1270 if (ret != PMINFO_R_OK) {
1271 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1274 printf("support_mode : %s\n", support_mode);
1275 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1281 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1284 * @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)
1285 * @brief This API compare the cert information from given package id
1287 * @par This API is for package-manager client application
1288 * @par Sync (or) Async : Synchronous API
1290 * @param[in] lhs_package_id pointer to first package ID
1291 * @param[in] rhs_package_id pointer to second package ID
1292 * @param[out] compare_result pointer to the compare result.
1293 * @return 0 if success, error code(<0) if fail
1294 * @retval PMINFO_R_OK success
1295 * @retval PMINFO_R_EINVAL invalid argument
1296 * @retval PMINFO_R_ERROR internal error
1298 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1299 * @see pkgmgrinfo_pkginfo_get_pkgid()
1300 * @see pkgmgrinfo_pkginfo_is_removable()
1302 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1305 pkgmgrinfo_cert_compare_result_type_e result;
1307 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1308 if (ret != PMINFO_R_OK) {
1311 printf("result: %d\n", result);
1316 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);
1317 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);
1319 * @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)
1320 * @brief This API compare the cert information from given app id
1322 * @par This API is for package-manager client application
1323 * @par Sync (or) Async : Synchronous API
1325 * @param[in] lhs_app_id pointer to first app ID
1326 * @param[in] rhs_app_id pointer to second app ID
1327 * @param[out] compare_result pointer to the compare result.
1328 * @return 0 if success, error code(<0) if fail
1329 * @retval PMINFO_R_OK success
1330 * @retval PMINFO_R_EINVAL invalid argument
1331 * @retval PMINFO_R_ERROR internal error
1333 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1334 * @see pkgmgrinfo_pkginfo_get_pkgid()
1335 * @see pkgmgrinfo_pkginfo_is_removable()
1337 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1340 pkgmgrinfo_cert_compare_result_type_e result;
1342 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1343 if (ret != PMINFO_R_OK) {
1346 printf("result: %d\n", result);
1351 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);
1352 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);
1354 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1355 * @brief This API gets the package 'removable' value from the package ID
1357 * @par This API is for package-manager client application
1358 * @par Sync (or) Async : Synchronous API
1360 * @param[in] handle pointer to package info handle
1361 * @param[out] removable pointer to hold package removable value
1362 * @return 0 if success, error code(<0) if fail
1363 * @retval PMINFO_R_OK success
1364 * @retval PMINFO_R_EINVAL invalid argument
1365 * @retval PMINFO_R_ERROR internal error
1366 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1367 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1368 * @see pkgmgrinfo_pkginfo_get_pkgid()
1369 * @see pkgmgrinfo_pkginfo_is_readonly()
1371 static int get_pkg_removable(const char *pkgid)
1375 pkgmgrinfo_pkginfo_h handle;
1376 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1377 if (ret != PMINFO_R_OK)
1379 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1380 if (ret != PMINFO_R_OK) {
1381 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1384 printf("pkg removable: %d\n", removable);
1385 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1390 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1393 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1394 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1396 * @par This API is for package-manager client application
1397 * @par Sync (or) Async : Synchronous API
1399 * @param[in] handle pointer to package info handle
1400 * @param[out] movable pointer to hold package movable state
1401 * @return 0 if success, error code(<0) if fail
1402 * @retval PMINFO_R_OK success
1403 * @retval PMINFO_R_EINVAL invalid argument
1404 * @retval PMINFO_R_ERROR internal error
1405 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1406 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1407 * @see pkgmgrinfo_pkginfo_get_pkgid()
1409 static int get_pkg_movable(const char *pkgid)
1413 pkgmgrinfo_pkginfo_h handle;
1414 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1415 if (ret != PMINFO_R_OK)
1417 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1418 if (ret != PMINFO_R_OK) {
1419 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1422 printf("pkg movable: %d\n", movable);
1423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1428 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1431 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1432 * @brief This API gets the package 'preload' value from the package ID
1434 * @par This API is for package-manager client application
1435 * @par Sync (or) Async : Synchronous API
1437 * @param[in] handle pointer to package info handle
1438 * @param[out] preload pointer to hold package preload value
1439 * @return 0 if success, error code(<0) if fail
1440 * @retval PMINFO_R_OK success
1441 * @retval PMINFO_R_EINVAL invalid argument
1442 * @retval PMINFO_R_ERROR internal error
1443 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1444 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1445 * @see pkgmgrinfo_pkginfo_get_pkgid()
1446 * @see pkgmgrinfo_pkginfo_is_readonly()
1448 static int get_pkg_preload(const char *pkgid)
1452 pkgmgrinfo_pkginfo_h handle;
1453 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1454 if (ret != PMINFO_R_OK)
1456 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1457 if (ret != PMINFO_R_OK) {
1458 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1461 printf("pkg preload: %d\n", preload);
1462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1467 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1470 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1471 * @brief This API gets the value for given handle is system or not
1473 * @par This API is for package-manager client application
1474 * @par Sync (or) Async : Synchronous API
1476 * @param[in] handle pointer to package info handle
1477 * @param[out] system pointer to hold system is or not
1478 * @return 0 if success, error code(<0) if fail
1479 * @retval PMINFO_R_OK success
1480 * @retval PMINFO_R_EINVAL invalid argument
1481 * @retval PMINFO_R_ERROR internal error
1482 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1483 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1484 * @see pkgmgrinfo_pkginfo_get_pkgid()
1485 * @see pkgmgrinfo_pkginfo_is_readonly()
1487 static int get_pkg_system(const char *pkgid)
1490 bool system = false;
1491 pkgmgrinfo_pkginfo_h handle = NULL;
1492 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1493 if (ret != PMINFO_R_OK)
1495 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1496 if (ret != PMINFO_R_OK) {
1497 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1500 printf("pkg system: %d\n", system);
1501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1506 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1509 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1510 * @brief This API gets the package 'readonly' value from the package ID
1512 * @par This API is for package-manager client application
1513 * @par Sync (or) Async : Synchronous API
1515 * @param[in] handle pointer to package info handle
1516 * @param[out] readonly pointer to hold package readonly value
1517 * @return 0 if success, error code(<0) if fail
1518 * @retval PMINFO_R_OK success
1519 * @retval PMINFO_R_EINVAL invalid argument
1520 * @retval PMINFO_R_ERROR internal error
1521 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1522 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1523 * @see pkgmgrinfo_pkginfo_get_pkgid()
1524 * @see pkgmgrinfo_pkginfo_is_removable()
1526 static int get_pkg_readonly(const char *pkgid)
1530 pkgmgrinfo_pkginfo_h handle;
1531 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1532 if (ret != PMINFO_R_OK)
1534 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1535 if (ret != PMINFO_R_OK) {
1536 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1539 printf("pkg readonly: %d\n", readonly);
1540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1545 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1549 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1550 * @brief This API gets the package 'upate' value from the package ID
1552 * @par This API is for package-manager client application
1553 * @par Sync (or) Async : Synchronous API
1555 * @param[in] handle pointer to package info handle
1556 * @param[out] update pointer to hold package update value
1557 * @return 0 if success, error code(<0) if fail
1558 * @retval PMINFO_R_OK success
1559 * @retval PMINFO_R_EINVAL invalid argument
1560 * @retval PMINFO_R_ERROR internal error
1561 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1562 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1563 * @see pkgmgrinfo_pkginfo_get_pkgid()
1565 static int get_pkg_update(const char *pkgid)
1569 pkgmgrinfo_pkginfo_h handle;
1570 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1571 if (ret != PMINFO_R_OK)
1573 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1574 if (ret != PMINFO_R_OK) {
1575 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1578 printf("pkg update: %d\n", update);
1579 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1584 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1587 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1588 * @brief This API gets the package 'support_disable' value from the package ID
1590 * @par This API is for package-manager client application
1591 * @par Sync (or) Async : Synchronous API
1593 * @param[in] handle pointer to package info handle
1594 * @param[out] support_disable pointer to hold package support_disable value
1595 * @return 0 if success, error code(<0) if fail
1596 * @retval PMINFO_R_OK success
1597 * @retval PMINFO_R_EINVAL invalid argument
1598 * @retval PMINFO_R_ERROR internal error
1599 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1600 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1601 * @see pkgmgrinfo_pkginfo_get_pkgid()
1603 static int get_pkg_support_disable(const char *pkgid)
1606 bool support_disable;
1607 pkgmgrinfo_pkginfo_h handle = NULL;
1608 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1609 if (ret != PMINFO_R_OK)
1611 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1612 if (ret != PMINFO_R_OK) {
1613 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1616 printf("pkg support_disable: %d\n", support_disable);
1617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1622 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1625 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1626 * @brief This API gets whethere the given package is global package or user package
1628 * @par This API is for package-manager client application
1629 * @par Sync (or) Async : Synchronous API
1631 * @param[in] handle pointer to package info handle
1632 * @param[in] global pointer to hold package global value
1633 * @return 0 if success, error code(<0) if fail
1634 * @retval PMINFO_R_OK success
1635 * @retval PMINFO_R_EINVAL invalid argument
1636 * @retval PMINFO_R_ERROR internal error
1637 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1638 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1639 * @see pkgmgrinfo_pkginfo_get_pkgid()
1640 static int get_pkg_support_disable(const char *pkgid)
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_global(handle, &global);
1649 if (ret != PMINFO_R_OK) {
1650 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1653 printf("pkg is_global: %d\n", global);
1654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1659 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1662 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1663 * @brief This API gets the package 'accessible' value from the package ID
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[out] accessible pointer to hold package accessible 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 * @see pkgmgrinfo_pkginfo_is_readonly()
1679 static int get_pkg_accessible(const char *pkgid)
1683 pkgmgrinfo_pkginfo_h handle;
1684 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1685 if (ret != PMINFO_R_OK)
1687 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1688 if (ret != PMINFO_R_OK) {
1689 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1692 printf("pkg accessible: %d\n", accessible);
1693 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1698 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1701 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1702 * @brief This API destroys the package information handle freeing up all the resources
1704 * @par This API is for package-manager client application
1705 * @par Sync (or) Async : Synchronous API
1707 * @param[in] handle pointer to the package info handle
1708 * @return 0 if success, error code(<0) if fail
1709 * @retval PMINFO_R_OK success
1710 * @retval PMINFO_R_EINVAL invalid argument
1711 * @retval PMINFO_R_ERROR internal error
1712 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1714 * @see pkgmgrinfo_pkginfo_get_pkgid()
1715 * @see pkgmgrinfo_pkginfo_is_removable()
1717 static int get_pkg_type(const char *pkgid)
1721 pkgmgrinfo_pkginfo_h handle;
1722 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1723 if (ret != PMINFO_R_OK)
1725 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1726 if (ret != PMINFO_R_OK) {
1727 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1730 printf("pkgtype: %s\n", type);
1731 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1736 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1739 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1740 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1741 The query will search the entire package information collected from the manifest file of all the installed packages
1743 * @par This API is for package-manager client application
1744 * @par Sync (or) Async : Synchronous API
1746 * @param[out] handle pointer to the package info filter handle.
1747 * @return 0 if success, error code(<0) if fail
1748 * @retval PMINFO_R_OK success
1749 * @retval PMINFO_R_EINVAL invalid argument
1750 * @retval PMINFO_R_ERROR internal error
1752 * @post pkgmgrinfo_pkginfo_filter_destroy()
1753 * @see pkgmgrinfo_pkginfo_filter_count()
1754 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1756 static int get_tpk_pkg_count()
1760 pkgmgrinfo_pkginfo_filter_h handle;
1761 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1762 if (ret != PMINFO_R_OK)
1764 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1765 if (ret != PMINFO_R_OK) {
1766 pkgmgrinfo_pkginfo_filter_destroy(handle);
1769 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1770 if (ret != PMINFO_R_OK) {
1771 pkgmgrinfo_pkginfo_filter_destroy(handle);
1774 printf("No of tpk pkgs: %d\n", count);
1775 pkgmgrinfo_pkginfo_filter_destroy(handle);
1780 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1783 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1784 * @brief This API destroys the package information filter handle freeing up all the resources
1786 * @par This API is for package-manager client application
1787 * @par Sync (or) Async : Synchronous API
1789 * @param[in] handle pointer to the package info filter handle.
1790 * @return 0 if success, error code(<0) if fail
1791 * @retval PMINFO_R_OK success
1792 * @retval PMINFO_R_EINVAL invalid argument
1793 * @retval PMINFO_R_ERROR internal error
1794 * @pre pkgmgrinfo_pkginfo_filter_create()
1796 * @see pkgmgrinfo_pkginfo_filter_count()
1797 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1799 static int get_tpk_pkg_count()
1803 pkgmgrinfo_pkginfo_filter_h handle;
1804 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1805 if (ret != PMINFO_R_OK)
1807 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1808 if (ret != PMINFO_R_OK) {
1809 pkgmgrinfo_pkginfo_filter_destroy(handle);
1812 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1813 if (ret != PMINFO_R_OK) {
1814 pkgmgrinfo_pkginfo_filter_destroy(handle);
1817 printf("No of tpk pkgs: %d\n", count);
1818 pkgmgrinfo_pkginfo_filter_destroy(handle);
1823 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1826 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1827 * @brief This API adds a boolean filter property to the filter handle
1829 * @par This API is for package-manager client application
1830 * @par Sync (or) Async : Synchronous API
1832 * @param[in] handle pointer to the package info filter handle.
1833 * @param[in] property boolean property name.
1834 * @param[in] value value corresponding to the property.
1835 * @return 0 if success, error code(<0) if fail
1836 * @retval PMINFO_R_OK success
1837 * @retval PMINFO_R_EINVAL invalid argument
1838 * @retval PMINFO_R_ERROR internal error
1839 * @pre pkgmgrinfo_pkginfo_filter_create()
1840 * @post pkgmgrinfo_pkginfo_filter_destroy()
1841 * @see pkgmgrinfo_pkginfo_filter_count()
1842 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1844 static int get_preload_pkg_count()
1848 pkgmgrinfo_pkginfo_filter_h handle;
1849 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1850 if (ret != PMINFO_R_OK)
1852 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1853 if (ret != PMINFO_R_OK) {
1854 pkgmgrinfo_pkginfo_filter_destroy(handle);
1857 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1858 if (ret != PMINFO_R_OK) {
1859 pkgmgrinfo_pkginfo_filter_destroy(handle);
1862 printf("No of preload pkgs: %d\n", count);
1863 pkgmgrinfo_pkginfo_filter_destroy(handle);
1868 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1869 const char *property, const bool value);
1872 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1873 * @brief This API adds an integer filter property to the filter handle
1875 * @par This API is for package-manager client application
1876 * @par Sync (or) Async : Synchronous API
1878 * @param[in] handle pointer to the package info filter handle.
1879 * @param[in] property integer property name.
1880 * @param[in] value value corresponding to the property.
1881 * @return 0 if success, error code(<0) if fail
1882 * @retval PMINFO_R_OK success
1883 * @retval PMINFO_R_EINVAL invalid argument
1884 * @retval PMINFO_R_ERROR internal error
1885 * @pre pkgmgrinfo_pkginfo_filter_create()
1886 * @post pkgmgrinfo_pkginfo_filter_destroy()
1887 * @see pkgmgrinfo_pkginfo_filter_count()
1888 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1890 static int get_pkg_count()
1894 pkgmgrinfo_pkginfo_filter_h handle;
1895 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1896 if (ret != PMINFO_R_OK)
1898 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1899 if (ret != PMINFO_R_OK) {
1900 pkgmgrinfo_pkginfo_filter_destroy(handle);
1903 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1904 if (ret != PMINFO_R_OK) {
1905 pkgmgrinfo_pkginfo_filter_destroy(handle);
1908 printf("No of preload pkgs: %d\n", count);
1909 pkgmgrinfo_pkginfo_filter_destroy(handle);
1914 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1915 const char *property, const int value);
1918 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1919 * @brief This API adds a string filter property to the filter handle
1921 * @par This API is for package-manager client application
1922 * @par Sync (or) Async : Synchronous API
1924 * @param[in] handle pointer to the package info filter handle.
1925 * @param[in] property string property name.
1926 * @param[in] value value corresponding to the property.
1927 * @return 0 if success, error code(<0) if fail
1928 * @retval PMINFO_R_OK success
1929 * @retval PMINFO_R_EINVAL invalid argument
1930 * @retval PMINFO_R_ERROR internal error
1931 * @pre pkgmgrinfo_pkginfo_filter_create()
1932 * @post pkgmgrinfo_pkginfo_filter_destroy()
1933 * @see pkgmgrinfo_pkginfo_filter_count()
1934 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1936 static int get_tpk_pkg_count()
1940 pkgmgrinfo_pkginfo_filter_h handle;
1941 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1942 if (ret != PMINFO_R_OK)
1944 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1945 if (ret != PMINFO_R_OK) {
1946 pkgmgrinfo_pkginfo_filter_destroy(handle);
1949 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1950 if (ret != PMINFO_R_OK) {
1951 pkgmgrinfo_pkginfo_filter_destroy(handle);
1954 printf("No of tpk pkgs: %d\n", count);
1955 pkgmgrinfo_pkginfo_filter_destroy(handle);
1960 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1961 const char *property, const char *value);
1964 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1965 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1967 * @par This API is for package-manager client application
1968 * @par Sync (or) Async : Synchronous API
1970 * @param[in] handle pointer to the package info filter handle.
1971 * @param[in] pkg_cb callback function.
1972 * @param[in] user_data user data to be passed to the callback function
1973 * @return 0 if success, error code(<0) if fail
1974 * @retval PMINFO_R_OK success
1975 * @retval PMINFO_R_EINVAL invalid argument
1976 * @retval PMINFO_R_ERROR internal error
1977 * @pre pkgmgrinfo_pkginfo_filter_create()
1978 * @post pkgmgrinfo_pkginfo_filter_destroy()
1979 * @see pkgmgrinfo_pkginfo_filter_count()
1981 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1984 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1985 printf("pkg id : %s\n", pkgid);
1989 static int get_tpk_pkg_list()
1992 pkgmgrinfo_pkginfo_filter_h handle;
1993 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1994 if (ret != PMINFO_R_OK)
1996 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1997 if (ret != PMINFO_R_OK) {
1998 pkgmgrinfo_pkginfo_filter_destroy(handle);
2001 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2002 if (ret != PMINFO_R_OK) {
2003 pkgmgrinfo_pkginfo_filter_destroy(handle);
2006 pkgmgrinfo_pkginfo_filter_destroy(handle);
2011 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2012 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2013 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2014 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2017 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2018 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2019 * @brief This API counts the package that satisfy the filter conditions
2021 * @par This API is for package-manager client application
2022 * @par Sync (or) Async : Synchronous API
2024 * @param[in] handle pointer to the package info filter handle.
2025 * @param[in] count pointer to store the count value.
2026 * @param[in] uid the addressee user id of the instruction
2027 * @return 0 if success, error code(<0) if fail
2028 * @retval PMINFO_R_OK success
2029 * @retval PMINFO_R_EINVAL invalid argument
2030 * @retval PMINFO_R_ERROR internal error
2031 * @pre pkgmgrinfo_pkginfo_filter_create()
2032 * @post pkgmgrinfo_pkginfo_filter_destroy()
2033 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2035 static int get_tpk_pkg_count()
2039 pkgmgrinfo_pkginfo_filter_h handle;
2040 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2041 if (ret != PMINFO_R_OK)
2043 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2044 if (ret != PMINFO_R_OK) {
2045 pkgmgrinfo_pkginfo_filter_destroy(handle);
2048 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2049 if (ret != PMINFO_R_OK) {
2050 pkgmgrinfo_pkginfo_filter_destroy(handle);
2053 printf("No of tpk pkgs: %d\n", count);
2054 pkgmgrinfo_pkginfo_filter_destroy(handle);
2059 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2060 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2062 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2063 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2064 * @brief This API gets the list of privilege for a particular package
2066 * @par This API is for package-manager client application
2067 * @par Sync (or) Async : Synchronous API
2068 * @param[in] handle pointer to the package info handle.
2069 * @param[in] privilege_func callback function for list
2070 * @param[in] user_data user data to be passed to callback function
2071 * @return 0 if success, error code(<0) if fail
2072 * @retval PMINFO_R_OK success
2073 * @retval PMINFO_R_EINVAL invalid argument
2074 * @retval PMINFO_R_ERROR internal error
2075 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2076 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2078 int privilege_func(const char *name, void *user_data)
2080 if (strcmp(name, (char *)user_data) == 0)
2086 static int list_privilege(const char *package, char *privilege)
2089 pkgmgrinfo_pkginfo_h handle;
2090 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2091 if (ret != PMINFO_R_OK)
2093 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2094 if (ret != PMINFO_R_OK) {
2095 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2098 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2103 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2104 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2106 /* TODO: add doxygen comment here */
2107 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2110 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2111 * @brief This API copy the application information handle
2113 * @par This API is for package-manager client application
2114 * @par Sync (or) Async : Synchronous API
2116 * @param[in] handle pointer to the package info handle.
2117 * @param[out] handle pointer to the package info handle.
2118 * @return 0 if success, error code(<0) if fail
2119 * @retval PMINFO_R_OK success
2120 * @retval PMINFO_R_EINVAL invalid argument
2121 * @retval PMINFO_R_ERROR internal error
2123 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2125 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2129 pkgmgrinfo_pkginfo_h clone;
2131 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2132 if (ret != PMINFO_R_OK)
2136 printf("package: %s\n", clone->package);
2137 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2142 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2146 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2147 pkgmgrinfo_app_list_cb app_func, void *user_data)
2148 * @brief This API gets list of installed applications for a particular package
2150 * @par This API is for package-manager client application
2151 * @par Sync (or) Async : Synchronous API
2152 * @param[in] handle package info handle
2153 * @param[in] component application component
2154 * @param[in] app_func iteration function for list
2155 * @param[in] user_data user data to be passed to callback function
2156 * @return 0 if success, error code(<0) if fail
2157 * @retval PMINFO_R_OK success
2158 * @retval PMINFO_R_EINVAL invalid argument
2159 * @retval PMINFO_R_ERROR internal error
2160 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2161 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2163 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2166 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2167 printf("appid : %s\n", appid);
2171 static int list_apps(const char *pkgid)
2174 pkgmgrinfo_pkginfo_h handle;
2175 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2176 if (ret != PMINFO_R_OK)
2178 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2179 if (ret != PMINFO_R_OK) {
2180 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2183 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2188 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2189 pkgmgrinfo_app_list_cb app_func, void *user_data);
2190 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2191 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2194 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2195 * @brief This API gets list of installed applications from all packages with minimum informaion.
2197 * @par This API is for package-manager client application
2198 * @par Sync (or) Async : Synchronous API
2199 * @param[in] app_func iteration function for list
2200 * @param[in] user_data user data to be passed to callback function
2201 * @return 0 if success, error code(<0) if fail
2202 * @retval PMINFO_R_OK success
2203 * @retval PMINFO_R_EINVAL invalid argument
2204 * @retval PMINFO_R_ERROR internal error
2208 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2210 char *pkgid1 = NULL;
2211 char *pkgid2 = NULL;
2212 pkgid1 = (char *)user_data;
2213 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2214 if (strcmp(pkgid1, pkgid2) == 0) {
2221 static int list_apps()
2224 char *name = "helloworld";
2225 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2226 if (ret != PMINFO_R_OK) {
2233 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2234 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2237 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2238 * @brief This API gets list of installed applications from all packages.
2240 * @par This API is for package-manager client application
2241 * @par Sync (or) Async : Synchronous API
2242 * @param[in] app_func iteration function for list
2243 * @param[in] user_data user data to be passed to callback function
2244 * @return 0 if success, error code(<0) if fail
2245 * @retval PMINFO_R_OK success
2246 * @retval PMINFO_R_EINVAL invalid argument
2247 * @retval PMINFO_R_ERROR internal error
2251 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2253 char *pkgid1 = NULL;
2254 char *pkgid2 = NULL;
2255 pkgid1 = (char *)user_data;
2256 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2257 if (strcmp(pkgid1, pkgid2) == 0) {
2264 static int list_apps()
2267 char *name = "helloworld";
2268 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2269 if (ret != PMINFO_R_OK) {
2276 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2277 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2280 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2281 * @brief This API creates the disabled application information handle from db
2283 * @par This API is for package-manager client application
2284 * @par Sync (or) Async : Synchronous API
2286 * @param[in] appid pointer to appid
2287 * @param[out] handle pointer to the application info handle.
2288 * @return 0 if success, error code(<0) if fail
2289 * @retval PMINFO_R_OK success
2290 * @retval PMINFO_R_EINVAL invalid argument
2291 * @retval PMINFO_R_ERROR internal error
2293 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2294 * @see pkgmgrinfo_appinfo_get_pkgid()
2295 * @see pkgmgrinfo_appinfo_is_multiple()
2297 static int get_disabled_app_type(const char *appid)
2301 pkgmgrinfo_appinfo_h handle;
2302 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2303 if (ret != PMINFO_R_OK)
2305 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2306 if (ret != PMINFO_R_OK) {
2307 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2310 printf("apptype: %s\n", type);
2311 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2316 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2317 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2320 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2321 * @brief This API creates the application information handle from db
2323 * @par This API is for package-manager client application
2324 * @par Sync (or) Async : Synchronous API
2326 * @param[in] appid pointer to appid
2327 * @param[out] handle pointer to the application info handle.
2328 * @return 0 if success, error code(<0) if fail
2329 * @retval PMINFO_R_OK success
2330 * @retval PMINFO_R_EINVAL invalid argument
2331 * @retval PMINFO_R_ERROR internal error
2333 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2334 * @see pkgmgrinfo_appinfo_get_pkgid()
2335 * @see pkgmgrinfo_appinfo_is_multiple()
2337 static int get_app_type(const char *appid)
2341 pkgmgrinfo_appinfo_h handle;
2342 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2343 if (ret != PMINFO_R_OK)
2345 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2346 if (ret != PMINFO_R_OK) {
2347 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2350 printf("apptype: %s\n", type);
2351 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2356 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2357 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2360 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2361 * @brief This API creates the application information handle from db regardless of its disable or storage status
2363 * @par This API is for package-manager client application
2364 * @par Sync (or) Async : Synchronous API
2366 * @param[in] appid pointer to appid
2367 * @param[out] handle pointer to the application info handle.
2368 * @return 0 if success, error code(<0) if fail
2369 * @retval PMINFO_R_OK success
2370 * @retval PMINFO_R_EINVAL invalid argument
2371 * @retval PMINFO_R_ERROR internal error
2373 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2374 * @see pkgmgrinfo_appinfo_get_pkgid()
2375 * @see pkgmgrinfo_appinfo_is_multiple()
2377 static int get_app_type(const char *appid)
2381 pkgmgrinfo_appinfo_h handle;
2382 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2383 if (ret != PMINFO_R_OK)
2385 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2386 if (ret != PMINFO_R_OK) {
2387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2390 printf("apptype: %s\n", type);
2391 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2396 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2397 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2400 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2401 * @brief This API gets the application ID
2403 * @par This API is for package-manager client application
2404 * @par Sync (or) Async : Synchronous API
2406 * @param[in] handle pointer to the application info handle.
2407 * @param[out] appid pointer to hold appid
2408 * @return 0 if success, error code(<0) if fail
2409 * @retval PMINFO_R_OK success
2410 * @retval PMINFO_R_EINVAL invalid argument
2411 * @retval PMINFO_R_ERROR internal error
2412 * @pre pkgmgrinfo_appinfo_get_appinfo()
2413 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2414 * @see pkgmgrinfo_appinfo_get_pkgid()
2415 * @see pkgmgrinfo_appinfo_is_multiple()
2417 static int get_app_id(const char *appid)
2420 char *app_id = NULL;
2421 pkgmgrinfo_appinfo_h handle;
2422 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2423 if (ret != PMINFO_R_OK)
2425 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2426 if (ret != PMINFO_R_OK) {
2427 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2430 printf("app id: %s\n", app_id);
2431 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2436 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2439 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2440 * @brief This API gets the package name of the application
2442 * @par This API is for package-manager client application
2443 * @par Sync (or) Async : Synchronous API
2445 * @param[in] handle pointer to the application info handle.
2446 * @param[out] pkg_name pointer to hold package name
2447 * @return 0 if success, error code(<0) if fail
2448 * @retval PMINFO_R_OK success
2449 * @retval PMINFO_R_EINVAL invalid argument
2450 * @retval PMINFO_R_ERROR internal error
2451 * @pre pkgmgrinfo_appinfo_get_appinfo()
2452 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2453 * @see pkgmgrinfo_appinfo_get_appid()
2454 * @see pkgmgrinfo_appinfo_is_multiple()
2456 static int get_app_pkgname(const char *appid)
2459 char *pkgname = NULL;
2460 pkgmgrinfo_appinfo_h handle;
2461 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2462 if (ret != PMINFO_R_OK)
2464 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2465 if (ret != PMINFO_R_OK) {
2466 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2469 printf("pkg name: %s\n", pkgname);
2470 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2475 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2478 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2479 * @brief This API gets the package id of the application
2481 * @par This API is for package-manager client application
2482 * @par Sync (or) Async : Synchronous API
2484 * @param[in] handle pointer to the application info handle.
2485 * @param[out] pkgid pointer to hold package id
2486 * @return 0 if success, error code(<0) if fail
2487 * @retval PMINFO_R_OK success
2488 * @retval PMINFO_R_EINVAL invalid argument
2489 * @retval PMINFO_R_ERROR internal error
2490 * @pre pkgmgrinfo_appinfo_get_appinfo()
2491 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2492 * @see pkgmgrinfo_appinfo_get_appid()
2493 * @see pkgmgrinfo_appinfo_is_multiple()
2495 static int get_app_pkgid(const char *appid)
2499 pkgmgrinfo_appinfo_h handle;
2500 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2501 if (ret != PMINFO_R_OK)
2503 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2504 if (ret != PMINFO_R_OK) {
2505 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2508 printf("pkg id: %s\n", pkgid);
2509 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2514 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2517 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2518 * @brief This API gets the package type of the application
2520 * @par This API is for package-manager client application
2521 * @par Sync (or) Async : Synchronous API
2523 * @param[in] handle pointer to the application info handle.
2524 * @param[out] pkgtype pointer to hold package type
2525 * @return 0 if success, error code(<0) if fail
2526 * @retval PMINFO_R_OK success
2527 * @retval PMINFO_R_EINVAL invalid argument
2528 * @retval PMINFO_R_ERROR internal error
2529 * @pre pkgmgrinfo_appinfo_get_appinfo()
2530 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2531 * @see pkgmgrinfo_appinfo_get_appid()
2532 * @see pkgmgrinfo_appinfo_is_multiple()
2534 static int get_app_pkgtype(const char *appid)
2537 char *pkgtype = NULL;
2538 pkgmgrinfo_appinfo_h handle = NULL;
2539 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2540 if (ret != PMINFO_R_OK)
2542 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2543 if (ret != PMINFO_R_OK) {
2544 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2547 printf("pkgtype: %s\n", pkgtype);
2548 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2553 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2556 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2557 * @brief This API gets the executable name of the application
2559 * @par This API is for package-manager client application
2560 * @par Sync (or) Async : Synchronous API
2562 * @param[in] handle pointer to the application info handle.
2563 * @param[out] exec pointer to hold app exec name
2564 * @return 0 if success, error code(<0) if fail
2565 * @retval PMINFO_R_OK success
2566 * @retval PMINFO_R_EINVAL invalid argument
2567 * @retval PMINFO_R_ERROR internal error
2568 * @pre pkgmgrinfo_appinfo_get_appinfo()
2569 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2570 * @see pkgmgrinfo_appinfo_get_appid()
2571 * @see pkgmgrinfo_appinfo_is_multiple()
2573 static int get_app_exec(const char *appid)
2577 pkgmgrinfo_appinfo_h handle;
2578 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2579 if (ret != PMINFO_R_OK)
2581 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2582 if (ret != PMINFO_R_OK) {
2583 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2586 printf("exec name: %s\n", exec);
2587 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2592 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2595 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2596 * @brief This API gets the icon name of the application
2598 * @par This API is for package-manager client application
2599 * @par Sync (or) Async : Synchronous API
2601 * @param[in] handle pointer to the application info handle.
2602 * @param[out] icon pointer to hold app icon name
2603 * @return 0 if success, error code(<0) if fail
2604 * @retval PMINFO_R_OK success
2605 * @retval PMINFO_R_EINVAL invalid argument
2606 * @retval PMINFO_R_ERROR internal error
2607 * @pre pkgmgrinfo_appinfo_get_appinfo()
2608 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2609 * @see pkgmgrinfo_appinfo_get_appid()
2610 * @see pkgmgrinfo_appinfo_is_multiple()
2612 static int get_app_icon(const char *appid)
2616 pkgmgrinfo_appinfo_h handle;
2617 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2618 if (ret != PMINFO_R_OK)
2620 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2621 if (ret != PMINFO_R_OK) {
2622 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2625 printf("icon name: %s\n", icon);
2626 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2631 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2634 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2635 * @brief This API gets the label of the application
2637 * @par This API is for package-manager client application
2638 * @par Sync (or) Async : Synchronous API
2640 * @param[in] handle pointer to the application info handle.
2641 * @param[out] label pointer to hold app label
2642 * @return 0 if success, error code(<0) if fail
2643 * @retval PMINFO_R_OK success
2644 * @retval PMINFO_R_EINVAL invalid argument
2645 * @retval PMINFO_R_ERROR internal error
2646 * @pre pkgmgrinfo_appinfo_get_appinfo()
2647 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2648 * @see pkgmgrinfo_appinfo_get_appid()
2649 * @see pkgmgrinfo_appinfo_is_multiple()
2651 static int get_app_label(const char *appid)
2655 pkgmgrinfo_appinfo_h handle;
2656 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2657 if (ret != PMINFO_R_OK)
2659 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2660 if (ret != PMINFO_R_OK) {
2661 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2664 printf("label : %s\n", label);
2665 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2670 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2673 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2674 * @brief This API gets exactly matched label by given appid and locale
2676 * @par This API is for package-manager client application
2677 * @par Sync (or) Async : Synchronous API
2679 * @param[in] appid pointer to appid
2680 * @param[in] locale pointer to locale
2681 * @param[out] label pointer to hold app label
2682 * @return 0 if success, error code(<0) if fail
2683 * @retval PMINFO_R_OK success
2684 * @retval PMINFO_R_EINVAL invalid argument
2685 * @retval PMINFO_R_ERROR internal error
2687 static int get_localed_label(const char *appid, const char *locale)
2692 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2693 if (ret != PMINFO_R_OK)
2696 printf("localed label: %s\n", label);
2704 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2705 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2708 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2709 * @brief This API gets metadata value by given metadata key
2711 * @par This API is for package-manager client application
2712 * @par Sync (or) Async : Synchronous API
2714 * @param[in] handle pointer to the application info handle
2715 * @param[in] metadata_key metadata key
2716 * @param[out] metadata_value pointer to hold metadata value
2717 * @return 0 if success, error code(<0) if fail
2718 * @retval PMINFO_R_OK success
2719 * @retval PMINFO_R_EINVAL invalid argument
2721 static int get_metadata_value(const char *appid, const char *metadata_key)
2724 pkgmgrinfo_appinfo_h handle = NULL;
2725 char *metadata_value = NULL;
2727 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2728 if (ret != PMINFO_R_OK)
2731 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2732 if (ret != PMINFO_R_OK) {
2733 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2737 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2742 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2745 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2746 * @brief This API gets the component of the application
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[out] component pointer to hold app component
2753 * @return 0 if success, error code(<0) if fail
2754 * @retval PMINFO_R_OK success
2755 * @retval PMINFO_R_EINVAL invalid argument
2756 * @retval PMINFO_R_ERROR internal error
2757 * @pre pkgmgrinfo_appinfo_get_appinfo()
2758 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2759 * @see pkgmgrinfo_appinfo_get_appid()
2760 * @see pkgmgrinfo_appinfo_is_multiple()
2762 static int get_app_component(const char *appid)
2765 pkgmgrinfo_app_component component;
2766 pkgmgrinfo_appinfo_h handle;
2767 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2768 if (ret != PMINFO_R_OK)
2770 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2771 if (ret != PMINFO_R_OK) {
2772 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2775 printf("component : %s\n", component);
2776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2781 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2784 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2785 * @brief This API gets the apptype of the application
2787 * @par This API is for package-manager client application
2788 * @par Sync (or) Async : Synchronous API
2790 * @param[in] handle pointer to the application info handle.
2791 * @param[out] app_type pointer to hold apptype
2792 * @return 0 if success, error code(<0) if fail
2793 * @retval PMINFO_R_OK success
2794 * @retval PMINFO_R_EINVAL invalid argument
2795 * @retval PMINFO_R_ERROR internal error
2796 * @pre pkgmgrinfo_appinfo_get_appinfo()
2797 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2798 * @see pkgmgrinfo_appinfo_get_appid()
2799 * @see pkgmgrinfo_appinfo_is_multiple()
2801 static int get_app_type(const char *appid)
2804 char *apptype = NULL;
2805 pkgmgrinfo_appinfo_h handle;
2806 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2807 if (ret != PMINFO_R_OK)
2809 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2810 if (ret != PMINFO_R_OK) {
2811 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2814 printf("apptype : %s\n", apptype);
2815 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2820 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2823 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2824 int *operation_count, char ***operation)
2825 * @brief This API gets the list of operation of the application
2827 * @par This API is for package-manager client application
2828 * @par Sync (or) Async : Synchronous API
2830 * @param[in] handle pointer to the appcontrol handle.
2831 * @param[out] operation_count pointer to hold number of operations
2832 * @param[out] operation pointer to hold list of operations
2833 * @return 0 if success, error code(<0) if fail
2834 * @retval PMINFO_R_OK success
2835 * @retval PMINFO_R_EINVAL invalid argument
2836 * @retval PMINFO_R_ERROR internal error
2837 * @pre pkgmgrinfo_appinfo_get_appinfo()
2838 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2839 * @see pkgmgrinfo_appinfo_get_uri()
2840 * @see pkgmgrinfo_appinfo_get_mime()
2842 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2847 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2848 for (i = 0; i < oc; i++) {
2849 if (strcmp(operation[i], (char *)user_data) == 0)
2856 static int check_operation(const char *appid, char *operation)
2859 pkgmgrinfo_appinfo_h handle;
2860 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2861 if (ret != PMINFO_R_OK)
2863 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2864 if (ret != PMINFO_R_OK) {
2865 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2868 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2873 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2874 int *operation_count, char ***operation);
2877 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2878 int *uri_count, char ***uri)
2879 * @brief This API gets the list of uri of the application
2881 * @par This API is for package-manager client application
2882 * @par Sync (or) Async : Synchronous API
2884 * @param[in] handle pointer to the appcontrol handle.
2885 * @param[out] uri_count pointer to hold number of uris
2886 * @param[out] uri pointer to hold list of uris
2887 * @return 0 if success, error code(<0) if fail
2888 * @retval PMINFO_R_OK success
2889 * @retval PMINFO_R_EINVAL invalid argument
2890 * @retval PMINFO_R_ERROR internal error
2891 * @pre pkgmgrinfo_appinfo_get_appinfo()
2892 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2893 * @see pkgmgrinfo_appinfo_get_operation()
2894 * @see pkgmgrinfo_appinfo_get_mime()
2896 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2901 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2902 for (i = 0; i < uc; i++) {
2903 if (strcmp(uri[i], (char *)user_data) == 0)
2910 static int check_uri(const char *appid, char *uri)
2913 pkgmgrinfo_appinfo_h handle;
2914 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2915 if (ret != PMINFO_R_OK)
2917 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2918 if (ret != PMINFO_R_OK) {
2919 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2922 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2927 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2928 int *uri_count, char ***uri);
2931 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2932 int *mime_count, char ***mime)
2933 * @brief This API gets the list of mime of the application
2935 * @par This API is for package-manager client application
2936 * @par Sync (or) Async : Synchronous API
2938 * @param[in] handle pointer to the appcontrol handle.
2939 * @param[out] mime_count pointer to hold number of mimes
2940 * @param[out] mime pointer to hold list of mimes
2941 * @return 0 if success, error code(<0) if fail
2942 * @retval PMINFO_R_OK success
2943 * @retval PMINFO_R_EINVAL invalid argument
2944 * @retval PMINFO_R_ERROR internal error
2945 * @pre pkgmgrinfo_appinfo_get_appinfo()
2946 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2947 * @see pkgmgrinfo_appinfo_get_uri()
2948 * @see pkgmgrinfo_appinfo_get_operation()
2950 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2955 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2956 for (i = 0; i < mc; i++) {
2957 if (strcmp(mime[i], (char *)user_data) == 0)
2964 static int check_mime(const char *appid, char *mime)
2967 pkgmgrinfo_appinfo_h handle;
2968 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2969 if (ret != PMINFO_R_OK)
2971 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2972 if (ret != PMINFO_R_OK) {
2973 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2981 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2982 int *mime_count, char ***mime);
2985 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2986 int *subapp_count, char ***subapp)
2987 * @brief This API gets the list of subapp of the application
2989 * @par This API is for package-manager client application
2990 * @par Sync (or) Async : Synchronous API
2992 * @param[in] handle pointer to the appcontrol handle.
2993 * @param[out] subapp_count pointer to hold number of subapp
2994 * @param[out] subapp pointer to hold list of subapp
2995 * @return 0 if success, error code(<0) if fail
2996 * @retval PMINFO_R_OK success
2997 * @retval PMINFO_R_EINVAL invalid argument
2998 * @retval PMINFO_R_ERROR internal error
2999 * @pre pkgmgrinfo_appinfo_get_appinfo()
3000 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3001 * @see pkgmgrinfo_appinfo_get_uri()
3002 * @see pkgmgrinfo_appinfo_get_operation()
3004 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3008 char **subapp = NULL;
3009 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3010 for (i = 0; i < sc; i++) {
3011 if (strcmp(subapp[i], (char *)user_data) == 0)
3018 static int check_subapp(const char *appid, char *subapp)
3021 pkgmgrinfo_appinfo_h handle = NULL;
3022 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3023 if (ret != PMINFO_R_OK)
3025 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3026 if (ret != PMINFO_R_OK) {
3027 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3030 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3035 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3036 int *subapp_count, char ***subapp);
3039 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3040 * @brief This API gets the notification icon of the application
3042 * @par This API is for package-manager client application
3043 * @par Sync (or) Async : Synchronous API
3045 * @param[in] handle pointer to the application info handle.
3046 * @param[out] path pointer to hold notification icon
3047 * @return 0 if success, error code(<0) if fail
3048 * @retval PMINFO_R_OK success
3049 * @retval PMINFO_R_EINVAL invalid argument
3050 * @retval PMINFO_R_ERROR internal error
3051 * @pre pkgmgrinfo_appinfo_get_appinfo()
3052 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3053 * @see pkgmgrinfo_appinfo_get_appid()
3054 * @see pkgmgrinfo_appinfo_is_multiple()
3056 static int get_app_notification_icon(const char *appid)
3059 char *notification_icon = NULL;
3060 pkgmgrinfo_appinfo_h handle;
3061 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3062 if (ret != PMINFO_R_OK)
3064 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3065 if (ret != PMINFO_R_OK) {
3066 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3069 printf("notification icon : %s\n", notification_icon);
3070 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3075 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3078 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3079 * @brief This API gets the setting icon of the application
3081 * @par This API is for package-manager client application
3082 * @par Sync (or) Async : Synchronous API
3084 * @param[in] handle pointer to the application info handle.
3085 * @param[out] path pointer to hold setting icon
3086 * @return 0 if success, error code(<0) if fail
3087 * @retval PMINFO_R_OK success
3088 * @retval PMINFO_R_EINVAL invalid argument
3089 * @retval PMINFO_R_ERROR internal error
3090 * @pre pkgmgrinfo_appinfo_get_appinfo()
3091 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3092 * @see pkgmgrinfo_appinfo_get_appid()
3093 * @see pkgmgrinfo_appinfo_is_multiple()
3095 static int get_app_setting_icon(const char *appid)
3098 char *setting_icon = NULL;
3099 pkgmgrinfo_appinfo_h handle;
3100 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3101 if (ret != PMINFO_R_OK)
3103 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3104 if (ret != PMINFO_R_OK) {
3105 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3108 printf("setting icon : %s\n", setting_icon);
3109 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3114 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3117 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3118 * @brief This API gets the type of recent image on app-tray
3120 * @par This API is for package-manager client application
3121 * @par Sync (or) Async : Synchronous API
3123 * @param[in] handle pointer to the application info handle.
3124 * @param[out] type pointer to hold image type
3125 * @return 0 if success, error code(<0) if fail
3126 * @retval PMINFO_R_OK success
3127 * @retval PMINFO_R_EINVAL invalid argument
3128 * @retval PMINFO_R_ERROR internal error
3129 * @pre pkgmgrinfo_appinfo_get_appinfo()
3130 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3131 * @see pkgmgrinfo_appinfo_get_appid()
3132 * @see pkgmgrinfo_appinfo_is_multiple()
3134 static int get_app_recent_image_type(const char *appid)
3137 pkgmgrinfo_app_recentimage type;
3138 pkgmgrinfo_appinfo_h handle;
3139 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3140 if (ret != PMINFO_R_OK)
3142 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3143 if (ret != PMINFO_R_OK) {
3144 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3147 printf("recent image type: %d\n", type);
3148 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3153 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3157 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3158 * @brief This API gets the preview image of application
3160 * @par Sync (or) Async : Synchronous API
3162 * @param[in] handle pointer to the application info handle.
3163 * @param[out] preview_img pointer to hold preview image path
3164 * @return 0 if success, error code(<0) if fail
3165 * @retval PMINFO_R_OK success
3166 * @retval PMINFO_R_EINVAL invalid argument
3167 * @retval PMINFO_R_ERROR internal error
3168 * @pre pkgmgrinfo_appinfo_get_appinfo()
3169 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3170 * @see pkgmgrinfo_appinfo_get_appid()
3172 static int get_app_previewimage(const char *appid)
3175 char *preview = NULL;
3176 pkgmgrinfo_appinfo_h handle = NULL;
3177 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3178 if (ret != PMINFO_R_OK)
3180 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3181 if (ret != PMINFO_R_OK) {
3182 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3185 printf("preview image path : %s\n", preview);
3186 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3191 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3195 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3196 * @brief This API gets the package permission type of the application
3198 * @par This API is for package-manager client application
3199 * @par Sync (or) Async : Synchronous API
3201 * @param[in] handle pointer to the application info handle.
3202 * @param[out] permission pointer to hold package permission
3203 * @return 0 if success, error code(<0) if fail
3204 * @retval PMINFO_R_OK success
3205 * @retval PMINFO_R_EINVAL invalid argument
3206 * @retval PMINFO_R_ERROR internal error
3207 * @pre pkgmgrinfo_appinfo_get_appinfo()
3208 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3209 * @see pkgmgrinfo_appinfo_get_appid()
3211 static int get_app_permission(const char *appid)
3214 pkgmgrinfo_permission_type permission = 0;
3215 pkgmgrinfo_appinfo_h handle;
3217 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3218 if (ret != PMINFO_R_OK)
3220 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3221 if (ret != PMINFO_R_OK) {
3222 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3225 printf("permission type: %d\n", permission);
3226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3231 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3234 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3235 * @brief This API gets the component_type
3237 * @par This API is for package-manager client application
3238 * @par Sync (or) Async : Synchronous API
3240 * @param[in] handle pointer to the application info handle.
3241 * @param[out] component_type pointer to hold component_type
3242 * @return 0 if success, error code(<0) if fail
3243 * @retval PMINFO_R_OK success
3244 * @retval PMINFO_R_EINVAL invalid argument
3245 * @retval PMINFO_R_ERROR internal error
3246 * @pre pkgmgrinfo_appinfo_get_appinfo()
3247 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3248 * @see pkgmgrinfo_appinfo_get_pkgid()
3249 * @see pkgmgrinfo_appinfo_is_multiple()
3251 static int get_component_type(const char *appid)
3254 char *component_type = NULL;
3255 pkgmgrinfo_appinfo_h handle;
3256 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3257 if (ret != PMINFO_R_OK)
3259 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3260 if (ret != PMINFO_R_OK) {
3261 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3264 printf("component_type: %s\n", component_type);
3265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3270 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3273 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3274 * @brief This API gets the application 'hwacceleration' value from the app ID
3276 * @par This API is for package-manager client application
3277 * @par Sync (or) Async : Synchronous API
3279 * @param[in] handle pointer to application info handle
3280 * @param[out] hwacceleration pointer to hold package hwacceleration value
3281 * @return 0 if success, error code(<0) if fail
3282 * @retval PMINFO_R_OK success
3283 * @retval PMINFO_R_EINVAL invalid argument
3284 * @retval PMINFO_R_ERROR internal error
3285 * @pre pkgmgrinfo_appinfo_get_appinfo()
3286 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3287 * @see pkgmgrinfo_appinfo_get_appid()
3288 * @see pkgmgrinfo_appinfo_is_multiple()
3290 static int get_app_hwacceleration(const char *appid)
3293 pkgmgrinfo_app_hwacceleration hwacceleration;
3294 pkgmgrinfo_appinfo_h handle;
3295 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3296 if (ret != PMINFO_R_OK)
3298 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3299 if (ret != PMINFO_R_OK) {
3300 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3303 printf("app hwacceleration: %d\n", hwacceleration);
3304 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3309 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3312 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3313 * @brief This API gets the application 'screenreader' value from the app ID
3315 * @par This API is for package-manager client application
3316 * @par Sync (or) Async : Synchronous API
3318 * @param[in] handle pointer to application info handle
3319 * @param[out] screenreader pointer to hold package accessibility value
3320 * @return 0 if success, error code(<0) if fail
3321 * @retval PMINFO_R_OK success
3322 * @retval PMINFO_R_EINVAL invalid argument
3323 * @retval PMINFO_R_ERROR internal error
3324 * @pre pkgmgrinfo_appinfo_get_appinfo()
3325 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3326 * @see pkgmgrinfo_appinfo_get_appid()
3327 * @see pkgmgrinfo_appinfo_is_multiple()
3329 static int get_app_screenreader(const char *appid)
3332 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3333 pkgmgrinfo_appinfo_h handle = NULL;
3334 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3335 if (ret != PMINFO_R_OK)
3337 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3338 if (ret != PMINFO_R_OK) {
3339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3342 printf("app screenreader: %d\n", screenreader);
3343 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3348 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3351 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3352 * @brief This API gets the application's landscape & portrait effect images
3354 * @par This API is for package-manager client application
3355 * @par Sync (or) Async : Synchronous API
3357 * @param[in] handle pointer to application info handle
3358 * @param[out] portrait_img contains portrait mode effect image
3359 * @param[out] landscape_img contains landscape mode effect image
3360 * @return 0 if success, error code(<0) if fail
3361 * @retval PMINFO_R_OK success
3362 * @retval PMINFO_R_EINVAL invalid argument
3363 * @retval PMINFO_R_ERROR internal error
3364 * @pre pkgmgrinfo_appinfo_get_appinfo()
3365 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3366 * @see pkgmgrinfo_appinfo_get_appid()
3367 * @see pkgmgrinfo_appinfo_is_nodisplay()
3369 static int get_app_effectimages(const char *appid)
3372 char *portraitimg = NULL;
3373 char *landscapeimg = NULL;
3374 pkgmgrinfo_appinfo_h handle;
3375 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3376 if (ret != PMINFO_R_OK)
3378 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3379 if (ret != PMINFO_R_OK) {
3380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3383 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3389 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3392 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3393 * @brief This API gets the application's effect image type
3395 * @par This API is for package-manager client application
3396 * @par Sync (or) Async : Synchronous API
3398 * @param[in] handle pointer to application info handle
3399 * @param[out] effectimg_type contains effect image type
3400 * @return 0 if success, error code(<0) if fail
3401 * @retval PMINFO_R_OK success
3402 * @retval PMINFO_R_EINVAL invalid argument
3403 * @retval PMINFO_R_ERROR internal error
3404 * @pre pkgmgrinfo_appinfo_get_appinfo()
3405 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3406 * @see pkgmgrinfo_appinfo_get_appid()
3407 * @see pkgmgrinfo_appinfo_is_nodisplay()
3409 static int get_app_effectimage_type(const char *appid)
3412 char *effectimg_type = NULL;
3413 pkgmgrinfo_appinfo_h handle = NULL;
3414 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3415 if (ret != PMINFO_R_OK)
3417 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3418 if (ret != PMINFO_R_OK) {
3419 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3422 printf("app effect image type: %s\n", effectimg_type);
3423 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3428 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3431 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3432 * @brief This API gets the submode_mainid of the application
3434 * @par This API is for package-manager client application
3435 * @par Sync (or) Async : Synchronous API
3437 * @param[in] handle pointer to the application info handle.
3438 * @param[out] submode_mainid pointer to hold package name
3439 * @return 0 if success, error code(<0) if fail
3440 * @retval PMINFO_R_OK success
3441 * @retval PMINFO_R_EINVAL invalid argument
3442 * @retval PMINFO_R_ERROR internal error
3443 * @pre pkgmgrinfo_appinfo_get_appinfo()
3444 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3445 * @see pkgmgrinfo_appinfo_get_appid()
3446 * @see pkgmgrinfo_appinfo_is_multiple()
3448 static int get_app_submode_mainid(const char *appid)
3451 char *submode_mainid = NULL;
3452 pkgmgrinfo_appinfo_h handle = NULL;
3453 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3454 if (ret != PMINFO_R_OK)
3456 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3457 if (ret != PMINFO_R_OK) {
3458 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3461 printf("submode_mainid: %s\n", submode_mainid);
3462 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3467 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3470 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3471 * @brief This API gets the datacontrol info
3473 * @par This API is for package-manager client application
3474 * @par Sync (or) Async : Synchronous API
3476 * @param[in] providerid pointer to the providerid of dataconltrol.
3477 * @param[in] type pointer to the type of dataconltrol.
3478 * @param[out] appid pointer to hold appid, need to free after using
3479 * @param[out] access pointer to hold access, need to free after using
3480 * @return 0 if success, error code(<0) if fail
3481 * @retval PMINFO_R_OK success
3482 * @retval PMINFO_R_EINVAL invalid argument
3483 * @retval PMINFO_R_ERROR internal error
3486 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3487 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3490 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3491 * @brief This API gets the appid of datacontrol
3493 * @par This API is for package-manager client application
3494 * @par Sync (or) Async : Synchronous API
3496 * @param[in] providerid pointer to the providerid of dataconltrol.
3497 * @param[out] appid pointer to hold appid, need to free after using
3498 * @return 0 if success, error code(<0) if fail
3499 * @retval PMINFO_R_OK success
3500 * @retval PMINFO_R_EINVAL invalid argument
3501 * @retval PMINFO_R_ERROR internal error
3504 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3505 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3508 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3509 * @brief This API gets the alias_appid of the application
3511 * @par This API is for package-manager client application
3512 * @par Sync (or) Async : Synchronous API
3514 * @param[in] handle pointer to the application info handle.
3515 * @param[out] alias_appid pointer to hold app alias_appid
3516 * @return 0 if success, error code(<0) if fail
3517 * @retval PMINFO_R_OK success
3518 * @retval PMINFO_R_EINVAL invalid argument
3519 * @retval PMINFO_R_ERROR internal error
3520 * @pre pkgmgrinfo_appinfo_get_appinfo()
3521 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3522 * @see pkgmgrinfo_appinfo_get_appid()
3524 static int get_alias_appid(const char *appid)
3527 char *alias_appid= 0;
3528 pkgmgrinfo_appinfo_h handle = NULL;
3529 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3530 if (ret != PMINFO_R_OK)
3532 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3533 if (ret != PMINFO_R_OK) {
3534 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3537 printf("alias_appid: %s\n", alias_appid);
3538 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3543 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3546 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3547 * @brief This API gets the effective_appid of the application
3549 * @par This API is for package-manager client application
3550 * @par Sync (or) Async : Synchronous API
3552 * @param[in] handle pointer to the application info handle.
3553 * @param[out] effective_appid pointer to hold app effective_appid
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
3558 * @pre pkgmgrinfo_appinfo_get_appinfo()
3559 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3560 * @see pkgmgrinfo_appinfo_get_appid()
3562 static int get_effective_appid(const char *appid)
3565 char *effective_appid= 0;
3566 pkgmgrinfo_appinfo_h handle = NULL;
3567 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3568 if (ret != PMINFO_R_OK)
3570 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3571 if (ret != PMINFO_R_OK) {
3572 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3575 printf("effective_appid: %s\n", effective_appid);
3576 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3581 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3584 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3585 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3587 * @par This API is for package-manager client application
3588 * @par Sync (or) Async : Synchronous API
3590 * @param[in] handle pointer to the appinfo handle.
3591 * @param[out] tep_name pointer to hold tep name
3592 * @return 0 if success, error code(<0) if fail
3593 * @retval PMINFO_R_OK success
3594 * @retval PMINFO_R_EINVAL invalid argument
3595 * @retval PMINFO_R_ERROR internal error
3596 * @pre pkgmgrinfo_appinfo_get_appinfo()
3597 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3598 * @see pkgmgrinfo_appinfo_get_appid()
3600 static int get_tep_name(const char *appid)
3603 char *tep_name = NULL;
3604 pkgmgrinfo_appinfo_h handle = NULL;
3605 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3606 if (ret != PMINFO_R_OK)
3608 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3609 if (ret != PMINFO_R_OK) {
3610 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3613 printf("TEP name is: %s\n", tep_name);
3614 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3619 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3622 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3623 * @brief This API gets zip mount file name associated with the package which contain given application
3624 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3626 * @par This API is for package-manager client application
3627 * @par Sync (or) Async : Synchronous API
3629 * @param[in] handle pointer to the appinfo handle.
3630 * @param[out] zip_mount_file pointer to hold zip mount file name
3631 * @return 0 if success, error code(<0) if fail
3632 * @retval PMINFO_R_OK success
3633 * @retval PMINFO_R_EINVAL invalid argument
3634 * @retval PMINFO_R_ERROR internal error
3635 * @pre pkgmgrinfo_appinfo_get_appinfo()
3636 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3637 * @see pkgmgrinfo_appinfo_get_appid()
3639 static int get_zip_mount_file(const char *appid)
3642 char *zip_mount_file = NULL;
3643 pkgmgrinfo_appinfo_h handle = NULL;
3644 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3645 if (ret != PMINFO_R_OK)
3647 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3648 if (ret != PMINFO_R_OK) {
3649 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3652 printf("Mount file name is: %s\n", zip_mount_file);
3653 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3658 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3661 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3662 * @brief This API gets the root path of application
3664 * @par Sync (or) Async : Synchronous API
3666 * @param[in] handle pointer to appinfo handle
3667 * @param[out] path pointer to hold root path of application
3668 * @return 0 if success, error code(<0) if fail
3669 * @retval PMINFO_R_OK success
3670 * @retval PMINFO_R_EINVAL invalid argument
3671 * @retval PMINFO_R_ERROR internal error
3673 static int get_root_path(const char *appid)
3677 pkgmgrinfo_appinfo_h handle;
3678 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3679 if (ret != PMINFO_R_OK)
3682 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3683 if (ret != PMINFO_R_OK) {
3684 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3687 printf("path : %s\n", path);
3688 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3694 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3697 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3698 * @brief This API gets the application api_version from the application ID
3700 * @par This API is for package-manager client application
3701 * @par Sync (or) Async : Synchronous API
3703 * @param[in] handle pointer to appinfo handle
3704 * @param[out] api_version pointer to hold application api_version
3705 * @return 0 if success, error code(<0) if fail
3706 * @retval PMINFO_R_OK success
3707 * @retval PMINFO_R_EINVAL invalid argument
3708 * @retval PMINFO_R_ERROR internal error
3709 * @pre pkgmgrinfo_appinfo_get_appinfo()
3710 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3711 * @see pkgmgrinfo_appinfo_get_appid()
3713 static int get_app_api_version(const char *appid)
3716 char *api_version = NULL;
3717 pkgmgrinfo_appinfo_h handle = NULL;
3718 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3719 if (ret != PMINFO_R_OK)
3721 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3722 if (ret != PMINFO_R_OK) {
3723 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3726 printf("app api_version: %s\n", api_version);
3727 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3732 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3735 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3736 * @brief This API gets the installed_time of the application
3738 * @par This API is for package-manager client application
3739 * @par Sync (or) Async : Synchronous API
3741 * @param[in] handle pointer to the application info handle.
3742 * @param[out] installed_time pointer to hold installed_time
3743 * @return 0 if success, error code(<0) if fail
3744 * @retval PMINFO_R_OK success
3745 * @retval PMINFO_R_EINVAL invalid argument
3746 * @retval PMINFO_R_ERROR internal error
3747 * @pre pkgmgrinfo_appinfo_get_appinfo()
3748 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3749 * @see pkgmgrinfo_appinfo_get_appid()
3750 * @see pkgmgrinfo_appinfo_is_multiple()
3752 static int get_app_installed_time(const char *appid)
3755 int installed_time = 0;
3756 pkgmgrinfo_appinfo_h handle = NULL;
3757 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3758 if (ret != PMINFO_R_OK)
3760 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
3761 if (ret != PMINFO_R_OK) {
3762 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3765 printf("installed_time: %d\n", installed_time);
3766 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3771 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
3774 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
3775 * @brief This API gets the support_mode of the application
3777 * @par This API is for package-manager client application
3778 * @par Sync (or) Async : Synchronous API
3780 * @param[in] handle pointer to the application info handle.
3781 * @param[out] support_mode pointer to hold app support_mode
3782 * @return 0 if success, error code(<0) if fail
3783 * @retval PMINFO_R_OK success
3784 * @retval PMINFO_R_EINVAL invalid argument
3785 * @retval PMINFO_R_ERROR internal error
3786 * @pre pkgmgrinfo_appinfo_get_appinfo()
3787 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3788 * @see pkgmgrinfo_appinfo_get_appid()
3790 static int get_app_support_mode(const char *appid)
3793 int support_mode = 0;
3794 pkgmgrinfo_appinfo_h handle = NULL;
3795 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3796 if (ret != PMINFO_R_OK)
3798 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
3799 if (ret != PMINFO_R_OK) {
3800 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3803 printf("support_mode: %s\n", support_mode);
3804 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3809 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
3812 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3813 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3814 * @brief This API gets the list of permission for a particular application
3816 * @par This API is for package-manager client application
3817 * @par Sync (or) Async : Synchronous API
3818 * @param[in] handle pointer to the application info handle.
3819 * @param[in] permission_func callback function for list
3820 * @param[in] user_data user data to be passed to callback function
3821 * @return 0 if success, error code(<0) if fail
3822 * @retval PMINFO_R_OK success
3823 * @retval PMINFO_R_EINVAL invalid argument
3824 * @retval PMINFO_R_ERROR internal error
3825 * @pre pkgmgrinfo_appinfo_get_appinfo()
3826 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3828 int permission_func(const char *name, void *user_data)
3830 if (strcmp(name, (char *)user_data) == 0)
3836 static int list_permission(const char *appid, char *permission)
3839 pkgmgrinfo_appinfo_h handle;
3840 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3841 if (ret != PMINFO_R_OK)
3843 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3844 if (ret != PMINFO_R_OK) {
3845 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3848 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3853 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3854 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3857 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3858 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3859 * @brief This API gets the list of category for a particular application
3861 * @par This API is for package-manager client application
3862 * @par Sync (or) Async : Synchronous API
3863 * @param[in] handle pointer to the application info handle.
3864 * @param[in] category_func callback function for list
3865 * @param[in] user_data user data to be passed to callback function
3866 * @return 0 if success, error code(<0) if fail
3867 * @retval PMINFO_R_OK success
3868 * @retval PMINFO_R_EINVAL invalid argument
3869 * @retval PMINFO_R_ERROR internal error
3870 * @pre pkgmgrinfo_appinfo_get_appinfo()
3871 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3873 int category_func(const char *name, void *user_data)
3875 if (strcmp(name, (char *)user_data) == 0)
3881 static int list_category(const char *appid, char *category)
3884 pkgmgrinfo_appinfo_h handle;
3885 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3886 if (ret != PMINFO_R_OK)
3888 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3889 if (ret != PMINFO_R_OK) {
3890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3893 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3898 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3899 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3902 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3903 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3904 * @brief This API gets the list of metadata for a particular application
3906 * @par This API is for package-manager client application
3907 * @par Sync (or) Async : Synchronous API
3908 * @param[in] handle pointer to the application info handle.
3909 * @param[in] metadata_func callback function for list
3910 * @param[in] user_data user data to be passed to callback function
3911 * @return 0 if success, error code(<0) if fail
3912 * @retval PMINFO_R_OK success
3913 * @retval PMINFO_R_EINVAL invalid argument
3914 * @retval PMINFO_R_ERROR internal error
3915 * @pre pkgmgrinfo_appinfo_get_appinfo()
3916 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3918 int metadata_func(const char *key, const char *value, void *user_data)
3920 if (strcmp(key, (char *)user_data) == 0) {
3921 printf("Value is %s\n", value);
3928 static int list_metadata(const char *appid, char *key)
3931 pkgmgrinfo_appinfo_h handle;
3932 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3933 if (ret != PMINFO_R_OK)
3935 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3936 if (ret != PMINFO_R_OK) {
3937 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3940 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3945 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3946 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3950 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3951 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3952 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3953 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3954 * @brief This API gets the list of app-control for a particular application
3956 * @par This API is for package-manager client application
3957 * @par Sync (or) Async : Synchronous API
3958 * @param[in] handle pointer to the application info handle.
3959 * @param[in] appcontrol_func callback function for list
3960 * @param[in] user_data user data to be passed to callback function
3961 * @param[in] uid the addressee user id of the instruction
3962 * @return 0 if success, error code(<0) if fail
3963 * @retval PMINFO_R_OK success
3964 * @retval PMINFO_R_EINVAL invalid argument
3965 * @retval PMINFO_R_ERROR internal error
3966 * @pre pkgmgrinfo_appinfo_get_appinfo()
3967 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3969 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3974 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3975 for (i = 0; i < oc; i++) {
3976 if (strcmp(operation[i], (char *)user_data) == 0)
3983 static int check_operation(const char *appid, char *operation)
3986 pkgmgrinfo_appinfo_h handle;
3987 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3988 if (ret != PMINFO_R_OK)
3990 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3991 if (ret != PMINFO_R_OK) {
3992 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3995 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4000 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4001 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4006 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4007 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4010 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4011 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4012 * @brief This API gets the list of splashscreen 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] splash_screen_func callback function for list
4018 * @param[in] user_data user data to be passed to callback function
4019 * @return 0 if success, error code(<0) if fail
4020 * @retval PMINFO_R_OK success
4021 * @retval PMINFO_R_EINVAL invalid argument
4022 * @retval PMINFO_R_ERROR internal error
4023 * @pre pkgmgrinfo_appinfo_get_appinfo()
4024 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4027 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4028 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4031 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4032 * @brief This API gets the application 'nodisplay' value from the app ID
4034 * @par This API is for package-manager client application
4035 * @par Sync (or) Async : Synchronous API
4037 * @param[in] handle pointer to application info handle
4038 * @param[out] nodisplay pointer to hold package nodisplay value
4039 * @return 0 if success, error code(<0) if fail
4040 * @retval PMINFO_R_OK success
4041 * @retval PMINFO_R_EINVAL invalid argument
4042 * @retval PMINFO_R_ERROR internal error
4043 * @pre pkgmgrinfo_appinfo_get_appinfo()
4044 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4045 * @see pkgmgrinfo_appinfo_get_appid()
4046 * @see pkgmgrinfo_appinfo_is_multiple()
4048 static int get_app_nodisplay(const char *appid)
4052 pkgmgrinfo_appinfo_h handle;
4053 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4054 if (ret != PMINFO_R_OK)
4056 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4057 if (ret != PMINFO_R_OK) {
4058 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4061 printf("app nodisplay: %d\n", nodisplay);
4062 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4067 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4070 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4071 * @brief This API gets the application 'multiple' value from the app ID
4073 * @par This API is for package-manager client application
4074 * @par Sync (or) Async : Synchronous API
4076 * @param[in] handle pointer to application info handle
4077 * @param[out] multiple pointer to hold package multiple value
4078 * @return 0 if success, error code(<0) if fail
4079 * @retval PMINFO_R_OK success
4080 * @retval PMINFO_R_EINVAL invalid argument
4081 * @retval PMINFO_R_ERROR internal error
4082 * @pre pkgmgrinfo_appinfo_get_appinfo()
4083 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4084 * @see pkgmgrinfo_appinfo_get_appid()
4085 * @see pkgmgrinfo_appinfo_is_nodisplay()
4087 static int get_app_multiple(const char *appid)
4091 pkgmgrinfo_appinfo_h handle;
4092 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4093 if (ret != PMINFO_R_OK)
4095 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4096 if (ret != PMINFO_R_OK) {
4097 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4100 printf("app multiple: %d\n", multiple);
4101 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4106 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4109 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4110 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4111 * application launching effect. If fales, indicator will be hidden during application launching effect
4113 * @par This API is for package-manager client application
4114 * @par Sync (or) Async : Synchronous API
4116 * @param[in] handle pointer to application info handle
4117 * @param[out] indicator_disp contains indicator display status for application launching effect
4118 * @return 0 if success, error code(<0) if fail
4119 * @retval PMINFO_R_OK success
4120 * @retval PMINFO_R_EINVAL invalid argument
4121 * @retval PMINFO_R_ERROR internal error
4122 * @pre pkgmgrinfo_appinfo_get_appinfo()
4123 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4124 * @see pkgmgrinfo_appinfo_get_appid()
4125 * @see pkgmgrinfo_appinfo_is_nodisplay()
4127 static int get_app_indicator_display(const char *appid)
4130 bool indicator_disp;
4131 pkgmgrinfo_appinfo_h handle;
4132 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4133 if (ret != PMINFO_R_OK)
4135 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4136 if (ret != PMINFO_R_OK){
4137 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4140 printf("app indicator disp : %d\n", indicator_disp);
4141 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4146 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4149 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4150 * @brief This API gets the application 'taskmanage' value from the app ID
4152 * @par This API is for package-manager client application
4153 * @par Sync (or) Async : Synchronous API
4155 * @param[in] handle pointer to application info handle
4156 * @param[out] taskmanage pointer to hold package taskmanage value
4157 * @return 0 if success, error code(<0) if fail
4158 * @retval PMINFO_R_OK success
4159 * @retval PMINFO_R_EINVAL invalid argument
4160 * @retval PMINFO_R_ERROR internal error
4161 * @pre pkgmgrinfo_appinfo_get_appinfo()
4162 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4163 * @see pkgmgrinfo_appinfo_get_appid()
4164 * @see pkgmgrinfo_appinfo_is_multiple()
4166 static int get_app_taskmanage(const char *appid)
4170 pkgmgrinfo_appinfo_h handle;
4171 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4172 if (ret != PMINFO_R_OK)
4174 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4175 if (ret != PMINFO_R_OK) {
4176 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4179 printf("app taskmanage: %d\n", taskmanage);
4180 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4185 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4188 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4189 * @brief This API gets the application 'taskmanage' value from the app ID
4191 * @par This API is for package-manager client application
4192 * @par Sync (or) Async : Synchronous API
4194 * @param[in] handle pointer to application info handle
4195 * @param[out] enabled pointer to hold package enabled value
4196 * @return 0 if success, error code(<0) if fail
4197 * @retval PMINFO_R_OK success
4198 * @retval PMINFO_R_EINVAL invalid argument
4199 * @retval PMINFO_R_ERROR internal error
4200 * @pre pkgmgrinfo_appinfo_get_appinfo()
4201 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4202 * @see pkgmgrinfo_appinfo_get_appid()
4203 * @see pkgmgrinfo_appinfo_is_multiple()
4205 static int get_app_enabled(const char *appid)
4209 pkgmgrinfo_appinfo_h handle;
4210 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4211 if (ret != PMINFO_R_OK)
4213 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4214 if (ret != PMINFO_R_OK) {
4215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4218 printf("app enabled: %d\n", enabled);
4219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4224 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4227 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4228 * @brief This API gets the application 'onboot' value from the app ID
4230 * @par This API is for package-manager client application
4231 * @par Sync (or) Async : Synchronous API
4233 * @param[in] handle pointer to application info handle
4234 * @param[out] onboot pointer to hold package onboot value
4235 * @return 0 if success, error code(<0) if fail
4236 * @retval PMINFO_R_OK success
4237 * @retval PMINFO_R_EINVAL invalid argument
4238 * @retval PMINFO_R_ERROR internal error
4239 * @pre pkgmgrinfo_appinfo_get_appinfo()
4240 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4241 * @see pkgmgrinfo_appinfo_get_appid()
4242 * @see pkgmgrinfo_appinfo_is_multiple()
4244 static int get_app_onboot(const char *appid)
4248 pkgmgrinfo_appinfo_h handle;
4249 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4250 if (ret != PMINFO_R_OK)
4252 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4253 if (ret != PMINFO_R_OK) {
4254 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4257 printf("app onboot: %d\n", onboot);
4258 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4263 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4266 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4267 * @brief This API gets the application 'autorestart' value from the app ID
4269 * @par This API is for package-manager client application
4270 * @par Sync (or) Async : Synchronous API
4272 * @param[in] handle pointer to application info handle
4273 * @param[out] autorestart pointer to hold package autorestart value
4274 * @return 0 if success, error code(<0) if fail
4275 * @retval PMINFO_R_OK success
4276 * @retval PMINFO_R_EINVAL invalid argument
4277 * @retval PMINFO_R_ERROR internal error
4278 * @pre pkgmgrinfo_appinfo_get_appinfo()
4279 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4280 * @see pkgmgrinfo_appinfo_get_appid()
4281 * @see pkgmgrinfo_appinfo_is_multiple()
4283 static int get_app_autorestart(const char *appid)
4287 pkgmgrinfo_appinfo_h handle;
4288 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4289 if (ret != PMINFO_R_OK)
4291 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4292 if (ret != PMINFO_R_OK) {
4293 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4296 printf("app autorestart: %d\n", autorestart);
4297 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4302 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4305 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4306 * @brief This API gets the value for given application is main app or not from handle
4308 * @par This API is for package-manager client application
4309 * @par Sync (or) Async : Synchronous API
4311 * @param[in] handle pointer to application info handle
4312 * @param[out] mainapp pointer to hold package mainapp is or not
4313 * @return 0 if success, error code(<0) if fail
4314 * @retval PMINFO_R_OK success
4315 * @retval PMINFO_R_EINVAL invalid argument
4316 * @retval PMINFO_R_ERROR internal error
4317 * @pre pkgmgrinfo_appinfo_get_appinfo()
4318 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4319 * @see pkgmgrinfo_appinfo_get_appid()
4320 * @see pkgmgrinfo_appinfo_is_multiple()
4322 static int get_app_mainapp(const char *appid)
4326 pkgmgrinfo_appinfo_h handle;
4327 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4328 if (ret != PMINFO_R_OK)
4330 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4331 if (ret != PMINFO_R_OK) {
4332 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4335 printf("mainapp: %d\n", mainapp);
4336 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4341 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4345 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4346 * @brief This API gets the value for given application is preload or not from handle
4348 * @par This API is for package-manager client application
4349 * @par Sync (or) Async : Synchronous API
4351 * @param[in] handle pointer to application info handle
4352 * @param[out] preload pointer to hold preload is or not
4353 * @return 0 if success, error code(<0) if fail
4354 * @retval PMINFO_R_OK success
4355 * @retval PMINFO_R_EINVAL invalid argument
4356 * @retval PMINFO_R_ERROR internal error
4357 * @pre pkgmgrinfo_appinfo_get_appinfo()
4358 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4359 * @see pkgmgrinfo_appinfo_get_appid()
4360 * @see pkgmgrinfo_appinfo_is_multiple()
4362 static int get_app_preload(const char *appid)
4366 pkgmgrinfo_appinfo_h handle = NULL;
4367 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4368 if (ret != PMINFO_R_OK)
4370 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4371 if (ret != PMINFO_R_OK) {
4372 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4375 printf("preload: %d\n", preload);
4376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4381 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4384 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4385 * @brief This API gets the value for given application is submode or not from handle
4387 * @par This API is for package-manager client application
4388 * @par Sync (or) Async : Synchronous API
4390 * @param[in] handle pointer to application info handle
4391 * @param[out] submode pointer to hold submode is or not
4392 * @return 0 if success, error code(<0) if fail
4393 * @retval PMINFO_R_OK success
4394 * @retval PMINFO_R_EINVAL invalid argument
4395 * @retval PMINFO_R_ERROR internal error
4396 * @pre pkgmgrinfo_appinfo_get_appinfo()
4397 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4398 * @see pkgmgrinfo_appinfo_get_appid()
4399 * @see pkgmgrinfo_appinfo_is_multiple()
4401 static int get_app_submode(const char *appid)
4405 pkgmgrinfo_appinfo_h handle = NULL;
4406 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4407 if (ret != PMINFO_R_OK)
4409 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4410 if (ret != PMINFO_R_OK) {
4411 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4414 printf("submode: %d\n", submode);
4415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4420 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4423 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4424 * @brief This API gets the value for given application is process_pool or not from handle
4426 * @par This API is for package-manager client application
4427 * @par Sync (or) Async : Synchronous API
4429 * @param[in] handle pointer to application info handle
4430 * @param[out] process_pool pointer to hold process_pool is or not
4431 * @return 0 if success, error code(<0) if fail
4432 * @retval PMINFO_R_OK success
4433 * @retval PMINFO_R_EINVAL invalid argument
4434 * @retval PMINFO_R_ERROR internal error
4435 * @pre pkgmgrinfo_appinfo_get_appinfo()
4436 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4437 * @see pkgmgrinfo_appinfo_get_appid()
4439 static int get_app_process_pool(const char *appid)
4442 bool process_pool = 0;
4443 pkgmgrinfo_appinfo_h handle = NULL;
4444 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4445 if (ret != PMINFO_R_OK)
4447 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4448 if (ret != PMINFO_R_OK) {
4449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4452 printf("process_pool: %d\n", process_pool);
4453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4458 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4461 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4462 * @brief This API gets the installed storage location of the application
4464 * @par This API is for package-manager client application
4465 * @par Sync (or) Async : Synchronous API
4467 * @param[in] handle pointer to the application info handle.
4468 * @param[out] app_type pointer to hold installed storage location
4469 * @return 0 if success, error code(<0) if fail
4470 * @retval PMINFO_R_OK success
4471 * @retval PMINFO_R_EINVAL invalid argument
4472 * @retval PMINFO_R_ERROR internal error
4473 * @pre pkgmgrinfo_appinfo_get_appinfo()
4474 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4475 * @see pkgmgrinfo_appinfo_get_appid()
4477 static int get_app_installed_location(const char *appid)
4480 pkgmgrinfo_installed_storage storage;
4481 pkgmgrinfo_appinfo_h handle = NULL;
4482 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4483 if (ret != PMINFO_R_OK)
4485 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4486 if (ret != PMINFO_R_OK) {
4487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4490 printf("Installed storage location : %d\n", storage);
4491 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4496 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4500 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4501 * @brief This API checks if the application has the given category
4503 * @par This API is for package-manager client application
4504 * @par Sync (or) Async : Synchronous API
4506 * @param[in] handle pointer to the application info handle
4507 * @param[in] category category
4508 * @param[out] exist value Gets whether the application has the given category
4509 * @return 0 if success, error code(<0) if fail
4510 * @retval PMINFO_R_OK success
4511 * @retval PMINFO_R_EINVAL invalid argument
4512 * @retval PMINFO_R_ERROR internal error
4514 static int is_category_exist(const char *appid, const char *category)
4517 pkgmgrinfo_appinfo_h handle;
4520 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4521 if (ret != PMINFO_R_OK)
4524 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4525 if (ret != PMINFO_R_OK) {
4526 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4530 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4535 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4538 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4539 * @brief This API gets the application 'ui_gadget' value from the app ID
4541 * @par This API is for package-manager client application
4542 * @par Sync (or) Async : Synchronous API
4544 * @param[in] handle pointer to application info handle
4545 * @param[out] ui_gadget pointer to hold package ui_gadget value
4546 * @return 0 if success, error code(<0) if fail
4547 * @retval PMINFO_R_OK success
4548 * @retval PMINFO_R_EINVAL invalid argument
4549 * @pre pkgmgrinfo_appinfo_get_appinfo()
4550 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4552 static int get_app_ui_gadget(const char *appid)
4556 pkgmgrinfo_appinfo_h handle = NULL;
4557 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4558 if (ret != PMINFO_R_OK)
4560 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4561 if (ret != PMINFO_R_OK) {
4562 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4565 printf("app ui_gadget: %d\n", ui_gadget);
4566 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4571 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4574 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4575 * @brief This API gets the application 'support_disable' value from the app ID
4577 * @par This API is for package-manager client application
4578 * @par Sync (or) Async : Synchronous API
4580 * @param[in] handle pointer to application info handle
4581 * @param[out] support_disable pointer to hold package support_disable value
4582 * @return 0 if success, error code(<0) if fail
4583 * @retval PMINFO_R_OK success
4584 * @retval PMINFO_R_EINVAL invalid argument
4585 * @pre pkgmgrinfo_appinfo_get_appinfo()
4586 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4588 static int get_app_support_disable(const char *appid)
4591 bool support_disable;
4592 pkgmgrinfo_appinfo_h handle = NULL;
4593 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4594 if (ret != PMINFO_R_OK)
4596 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4597 if (ret != PMINFO_R_OK) {
4598 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4601 printf("app support_disable: %d\n", support_disable);
4602 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4607 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4610 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4611 * @brief This API gets the application 'removable' value from the app ID
4613 * @par This API is for package-manager client application
4614 * @par Sync (or) Async : Synchronous API
4616 * @param[in] handle pointer to application info handle
4617 * @param[out] removable pointer to hold package removable value
4618 * @return 0 if success, error code(<0) if fail
4619 * @retval PMINFO_R_OK success
4620 * @retval PMINFO_R_EINVAL invalid argument
4621 * @retval PMINFO_R_ERROR internal error
4622 * @pre pkgmgrinfo_appinfo_get_appinfo()
4623 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4624 * @see pkgmgrinfo_appinfo_get_appid()
4626 static int get_app_removable(const char *appid)
4630 pkgmgrinfo_appinfo_h handle = NULL;
4631 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4632 if (ret != PMINFO_R_OK)
4634 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4635 if (ret != PMINFO_R_OK) {
4636 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4639 printf("app removable: %d\n", removable);
4640 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4645 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4648 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4649 * @brief This API gets the application 'system' value from the app ID
4651 * @par This API is for package-manager client application
4652 * @par Sync (or) Async : Synchronous API
4654 * @param[in] handle pointer to application info handle
4655 * @param[out] system pointer to hold package system value
4656 * @return 0 if success, error code(<0) if fail
4657 * @retval PMINFO_R_OK success
4658 * @retval PMINFO_R_EINVAL invalid argument
4659 * @retval PMINFO_R_ERROR internal error
4660 * @pre pkgmgrinfo_appinfo_get_appinfo()
4661 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4662 * @see pkgmgrinfo_appinfo_get_appid()
4664 static int get_app_system(const char *appid)
4667 bool system = false;
4668 pkgmgrinfo_appinfo_h handle = NULL;
4669 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4670 if (ret != PMINFO_R_OK)
4672 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4673 if (ret != PMINFO_R_OK) {
4674 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4677 printf("app system: %d\n", system);
4678 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4683 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4687 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4688 * @brief This API gets the application 'is_disable' value from the app ID
4690 * @par This API is for package-manager client application
4691 * @par Sync (or) Async : Synchronous API
4693 * @param[in] handle pointer to application info handle
4694 * @param[out] disabled pointer to hold application is_disabled value
4695 * @return 0 if success, error code(<0) if fail
4696 * @retval PMINFO_R_OK success
4697 * @retval PMINFO_R_EINVAL invalid argument
4698 * @pre pkgmgrinfo_appinfo_get_appinfo()
4699 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4701 static int get_app_is_disable(const char *appid)
4705 pkgmgrinfo_appinfo_h handle = NULL;
4706 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4707 if (ret != PMINFO_R_OK)
4709 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4710 if (ret != PMINFO_R_OK) {
4711 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4714 printf("app is_disable: %d\n", is_disable);
4715 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4720 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4723 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4724 * @brief This API gets whethere the given application is global application or user application
4726 * @par This API is for package-manager client application
4727 * @par Sync (or) Async : Synchronous API
4729 * @param[in] handle pointer to application info handle
4730 * @param[in] global pointer to hold application global value
4731 * @return 0 if success, error code(<0) if fail
4732 * @retval PMINFO_R_OK success
4733 * @retval PMINFO_R_EINVAL invalid argument
4734 * @retval PMINFO_R_ERROR internal error
4735 * @pre pkgmgrinfo_appinfo_get_appinfo()
4736 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4737 * @see pkgmgrinfo_appinfo_get_appid()
4738 static int get_app_is_global(const char *appid)
4742 pkgmgrinfo_appinfo_h handle = NULL;
4743 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4744 if (ret != PMINFO_R_OK)
4746 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4747 if (ret != PMINFO_R_OK) {
4748 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4751 printf("app is_global: %d\n", global);
4752 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4757 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4760 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4761 * @brief This API gets the application 'splash_screen_display' value from the app ID
4763 * @par This API is for package-manager client application
4764 * @par Sync (or) Async : Synchronous API
4766 * @param[in] handle pointer to application info handle
4767 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4768 * @return 0 if success, error code(<0) if fail
4769 * @retval PMINFO_R_OK success
4770 * @retval PMINFO_R_EINVAL invalid argument
4771 * @retval PMINFO_R_ERROR internal error
4773 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4776 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
4777 * @brief This API gets the application 'support_ambient' value from the app ID
4779 * @par This API is for package-manager client application
4780 * @par Sync (or) Async : Synchronous API
4782 * @param[in] handle pointer to application info handle
4783 * @param[out] support_ambient pointer to hold package support_ambient value
4784 * @return 0 if success, error code(<0) if fail
4785 * @retval PMINFO_R_OK success
4786 * @retval PMINFO_R_EINVAL invalid argument
4787 * @retval PMINFO_R_ERROR internal error
4789 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
4792 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4793 * @brief This API destroys the application information handle freeing up all the resources
4795 * @par This API is for package-manager client application
4796 * @par Sync (or) Async : Synchronous API
4798 * @param[in] handle pointer to the application info handle.
4799 * @return 0 if success, error code(<0) if fail
4800 * @retval PMINFO_R_OK success
4801 * @retval PMINFO_R_EINVAL invalid argument
4802 * @retval PMINFO_R_ERROR internal error
4803 * @pre pkgmgrinfo_appinfo_get_appinfo()
4805 * @see pkgmgrinfo_appinfo_get_pkgid()
4806 * @see pkgmgrinfo_appinfo_is_multiple()
4808 static int get_app_type(const char *appid)
4812 pkgmgrinfo_appinfo_h handle;
4813 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4814 if (ret != PMINFO_R_OK)
4816 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4817 if (ret != PMINFO_R_OK) {
4818 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4821 printf("apptype: %s\n", type);
4822 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4827 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4830 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4831 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4832 The query will search the entire application information collected from the manifest file of all the installed packages
4834 * @par This API is for package-manager client application
4835 * @par Sync (or) Async : Synchronous API
4837 * @param[out] handle pointer to the application info filter handle.
4838 * @return 0 if success, error code(<0) if fail
4839 * @retval PMINFO_R_OK success
4840 * @retval PMINFO_R_EINVAL invalid argument
4841 * @retval PMINFO_R_ERROR internal error
4843 * @post pkgmgrinfo_appinfo_filter_destroy()
4844 * @see pkgmgrinfo_appinfo_filter_count()
4845 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4847 static int get_capp_count()
4851 pkgmgrinfo_appinfo_filter_h handle;
4852 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4853 if (ret != PMINFO_R_OK)
4855 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4856 if (ret != PMINFO_R_OK) {
4857 pkgmgrinfo_appinfo_filter_destroy(handle);
4860 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4861 if (ret != PMINFO_R_OK) {
4862 pkgmgrinfo_appinfo_filter_destroy(handle);
4865 printf("No of capp: %d\n", count);
4866 pkgmgrinfo_appinfo_filter_destroy(handle);
4871 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4874 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4875 * @brief This API destroys the application information filter handle freeing up all the resources
4877 * @par This API is for package-manager client application
4878 * @par Sync (or) Async : Synchronous API
4880 * @param[in] handle pointer to the application info filter handle.
4881 * @return 0 if success, error code(<0) if fail
4882 * @retval PMINFO_R_OK success
4883 * @retval PMINFO_R_EINVAL invalid argument
4884 * @retval PMINFO_R_ERROR internal error
4885 * @pre pkgmgrinfo_appinfo_filter_create()
4887 * @see pkgmgrinfo_appinfo_filter_count()
4888 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4890 static int get_capp_count()
4894 pkgmgrinfo_appinfo_filter_h handle;
4895 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4896 if (ret != PMINFO_R_OK)
4898 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4899 if (ret != PMINFO_R_OK) {
4900 pkgmgrinfo_appinfo_filter_destroy(handle);
4903 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4904 if (ret != PMINFO_R_OK) {
4905 pkgmgrinfo_appinfo_filter_destroy(handle);
4908 printf("No of capp: %d\n", count);
4909 pkgmgrinfo_appinfo_filter_destroy(handle);
4914 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4917 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4918 * @brief This API adds a boolean filter property to the filter handle
4920 * @par This API is for package-manager client application
4921 * @par Sync (or) Async : Synchronous API
4923 * @param[in] handle pointer to the application info filter handle.
4924 * @param[in] property boolean property name.
4925 * @param[in] value value corresponding to the property.
4926 * @return 0 if success, error code(<0) if fail
4927 * @retval PMINFO_R_OK success
4928 * @retval PMINFO_R_EINVAL invalid argument
4929 * @retval PMINFO_R_ERROR internal error
4930 * @pre pkgmgrinfo_appinfo_filter_create()
4931 * @post pkgmgrinfo_appinfo_filter_destroy()
4932 * @see pkgmgrinfo_appinfo_filter_count()
4933 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4935 static int get_taskmanageable_app_count()
4939 pkgmgrinfo_appinfo_filter_h handle;
4940 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4941 if (ret != PMINFO_R_OK)
4943 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4944 if (ret != PMINFO_R_OK) {
4945 pkgmgrinfo_appinfo_filter_destroy(handle);
4948 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4949 if (ret != PMINFO_R_OK) {
4950 pkgmgrinfo_appinfo_filter_destroy(handle);
4953 printf("No of taskmanageable apps: %d\n", count);
4954 pkgmgrinfo_appinfo_filter_destroy(handle);
4959 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4960 const char *property, const bool value);
4963 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4964 * @brief This API adds an integer filter property to the filter handle
4966 * @par This API is for package-manager client application
4967 * @par Sync (or) Async : Synchronous API
4969 * @param[in] handle pointer to the application info filter handle.
4970 * @param[in] property integer property name.
4971 * @param[in] value value corresponding to the property.
4972 * @return 0 if success, error code(<0) if fail
4973 * @retval PMINFO_R_OK success
4974 * @retval PMINFO_R_EINVAL invalid argument
4975 * @retval PMINFO_R_ERROR internal error
4976 * @pre pkgmgrinfo_appinfo_filter_create()
4977 * @post pkgmgrinfo_appinfo_filter_destroy()
4978 * @see pkgmgrinfo_appinfo_filter_count()
4979 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4981 static int get_taskmanageable_app_count()
4985 pkgmgrinfo_appinfo_filter_h handle;
4986 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4987 if (ret != PMINFO_R_OK)
4989 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4990 if (ret != PMINFO_R_OK) {
4991 pkgmgrinfo_appinfo_filter_destroy(handle);
4994 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4995 if (ret != PMINFO_R_OK) {
4996 pkgmgrinfo_appinfo_filter_destroy(handle);
4999 printf("No of apps: %d\n", count);
5000 pkgmgrinfo_appinfo_filter_destroy(handle);
5005 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5006 const char *property, const int value);
5009 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5010 * @brief This API adds a string filter property to the filter handle
5012 * @par This API is for package-manager client application
5013 * @par Sync (or) Async : Synchronous API
5015 * @param[in] handle pointer to the application info filter handle.
5016 * @param[in] property string property name.
5017 * @param[in] value value corresponding to the property.
5018 * @return 0 if success, error code(<0) if fail
5019 * @retval PMINFO_R_OK success
5020 * @retval PMINFO_R_EINVAL invalid argument
5021 * @retval PMINFO_R_ERROR internal error
5022 * @pre pkgmgrinfo_appinfo_filter_create()
5023 * @post pkgmgrinfo_appinfo_filter_destroy()
5024 * @see pkgmgrinfo_appinfo_filter_count()
5025 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5027 static int get_capp_count()
5031 pkgmgrinfo_appinfo_filter_h handle;
5032 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5033 if (ret != PMINFO_R_OK)
5035 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5036 if (ret != PMINFO_R_OK) {
5037 pkgmgrinfo_appinfo_filter_destroy(handle);
5040 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5041 if (ret != PMINFO_R_OK) {
5042 pkgmgrinfo_appinfo_filter_destroy(handle);
5045 printf("No of capp: %d\n", count);
5046 pkgmgrinfo_appinfo_filter_destroy(handle);
5051 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5052 const char *property, const char *value);
5055 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5056 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5058 * @par This API is for package-manager client application
5059 * @par Sync (or) Async : Synchronous API
5061 * @param[in] handle pointer to the application info filter handle.
5062 * @param[in] app_cb callback function.
5063 * @param[in] user_data user data to be passed to the callback function
5064 * @return 0 if success, error code(<0) if fail
5065 * @retval PMINFO_R_OK success
5066 * @retval PMINFO_R_EINVAL invalid argument
5067 * @retval PMINFO_R_ERROR internal error
5068 * @pre pkgmgrinfo_appinfo_filter_create()
5069 * @post pkgmgrinfo_appinfo_filter_destroy()
5070 * @see pkgmgrinfo_appinfo_filter_count()
5072 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5075 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5076 printf("appid : %s\n", appid);
5080 static int get_capp_list()
5083 pkgmgrinfo_appinfo_filter_h handle;
5084 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5085 if (ret != PMINFO_R_OK)
5087 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5088 if (ret != PMINFO_R_OK) {
5089 pkgmgrinfo_appinfo_filter_destroy(handle);
5092 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5093 if (ret != PMINFO_R_OK) {
5094 pkgmgrinfo_appinfo_filter_destroy(handle);
5097 pkgmgrinfo_appinfo_filter_destroy(handle);
5102 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5103 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5104 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5105 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5108 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5109 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5110 * @brief This API counts the application that satisfy the filter conditions
5112 * @par This API is for package-manager client application
5113 * @par Sync (or) Async : Synchronous API
5115 * @param[in] handle pointer to the application info filter handle.
5116 * @param[in] count pointer to store count value
5117 * @param[in] uid the addressee user id of the instruction
5118 * @return 0 if success, error code(<0) if fail
5119 * @retval PMINFO_R_OK success
5120 * @retval PMINFO_R_EINVAL invalid argument
5121 * @retval PMINFO_R_ERROR internal error
5122 * @pre pkgmgrinfo_appinfo_filter_create()
5123 * @post pkgmgrinfo_appinfo_filter_destroy()
5124 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5126 static int get_capp_count()
5130 pkgmgrinfo_appinfo_filter_h handle;
5131 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5132 if (ret != PMINFO_R_OK)
5134 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5135 if (ret != PMINFO_R_OK) {
5136 pkgmgrinfo_appinfo_filter_destroy(handle);
5139 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5140 if (ret != PMINFO_R_OK) {
5141 pkgmgrinfo_appinfo_filter_destroy(handle);
5144 printf("No of capp: %d\n", count);
5145 pkgmgrinfo_appinfo_filter_destroy(handle);
5150 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5151 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5153 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5154 * @brief This API creates the application's metadata information filter handle from db.
5156 * @par This API is for package-manager client application
5157 * @par Sync (or) Async : Synchronous API
5159 * @param[out] handle pointer to the application metadata info filter handle.
5160 * @return 0 if success, error code(<0) if fail
5161 * @retval PMINFO_R_OK success
5162 * @retval PMINFO_R_EINVAL invalid argument
5163 * @retval PMINFO_R_ERROR internal error
5165 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5166 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5168 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5171 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5172 printf("appid : %s\n", appid);
5176 static int get_app_list(const char *mkey, const char *mvalue)
5179 pkgmgrinfo_appinfo_metadata_filter_h handle;
5180 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5181 if (ret != PMINFO_R_OK)
5183 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5184 if (ret != PMINFO_R_OK) {
5185 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5188 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5189 if (ret != PMINFO_R_OK) {
5190 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5193 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5198 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5201 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5202 * @brief This API destroys the application's metadata information filter handle.
5204 * @par This API is for package-manager client application
5205 * @par Sync (or) Async : Synchronous API
5207 * @param[in] handle pointer to the application metadata info filter handle.
5208 * @return 0 if success, error code(<0) if fail
5209 * @retval PMINFO_R_OK success
5210 * @retval PMINFO_R_EINVAL invalid argument
5211 * @retval PMINFO_R_ERROR internal error
5212 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5214 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5216 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5219 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5220 printf("appid : %s\n", appid);
5224 static int get_app_list(const char *mkey, const char *mvalue)
5227 pkgmgrinfo_appinfo_metadata_filter_h handle;
5228 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5229 if (ret != PMINFO_R_OK)
5231 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5232 if (ret != PMINFO_R_OK) {
5233 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5236 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5237 if (ret != PMINFO_R_OK) {
5238 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5241 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5246 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5249 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5250 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5251 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5253 * @par This API is for package-manager client application
5254 * @par Sync (or) Async : Synchronous API
5256 * @param[in] handle pointer to the application metadata info filter handle.
5257 * @param[in] key pointer to metadata key
5258 * @param[in] value pointer to metadata value
5259 * @return 0 if success, error code(<0) if fail
5260 * @retval PMINFO_R_OK success
5261 * @retval PMINFO_R_EINVAL invalid argument
5262 * @retval PMINFO_R_ERROR internal error
5263 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5264 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5265 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5267 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5270 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5271 printf("appid : %s\n", appid);
5275 static int get_app_list(const char *mkey, const char *mvalue)
5278 pkgmgrinfo_appinfo_metadata_filter_h handle;
5279 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5280 if (ret != PMINFO_R_OK)
5282 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5283 if (ret != PMINFO_R_OK) {
5284 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5287 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5288 if (ret != PMINFO_R_OK) {
5289 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5292 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5297 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5298 const char *key, const char *value);
5301 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5302 * @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)
5303 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5304 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5305 * negative value, no more callbacks will be called and API will return.
5307 * @par This API is for package-manager client application
5308 * @par Sync (or) Async : Synchronous API
5310 * @param[in] handle pointer to the application metadata info filter handle.
5311 * @param[in] app_cb function pointer to callback
5312 * @param[in] user_data pointer to user data
5313 * @param[in] uid the addressee user id of the instruction
5314 * @return 0 if success, error code(<0) if fail
5315 * @retval PMINFO_R_OK success
5316 * @retval PMINFO_R_EINVAL invalid argument
5317 * @retval PMINFO_R_ERROR internal error
5318 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5319 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5321 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5324 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5325 printf("appid : %s\n", appid);
5329 static int get_app_list(const char *mkey, const char *mvalue)
5332 pkgmgrinfo_appinfo_metadata_filter_h handle;
5333 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5334 if (ret != PMINFO_R_OK)
5336 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5337 if (ret != PMINFO_R_OK) {
5338 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5341 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5342 if (ret != PMINFO_R_OK) {
5343 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5346 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5351 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5352 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5353 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5354 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5356 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5357 * @brief This API creates the package cert information handle to get data from db.
5359 * @par This API is for package-manager client application
5360 * @par Sync (or) Async : Synchronous API
5362 * @param[out] handle pointer to the package cert handle.
5363 * @return 0 if success, error code(<0) if fail
5364 * @retval PMINFO_R_OK success
5365 * @retval PMINFO_R_EINVAL invalid argument
5366 * @retval PMINFO_R_ERROR internal error
5368 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5369 * @see pkgmgrinfo_pkginfo_get_cert_value()
5370 * @see pkgmgrinfo_pkginfo_load_certinfo()
5372 static int get_cert_info(const char *pkgid)
5375 pkgmgrinfo_certinfo_h handle;
5376 char *auth_cert = NULL;
5377 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5378 if (ret != PMINFO_R_OK)
5380 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5381 if (ret != PMINFO_R_OK) {
5382 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5385 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5386 if (ret != PMINFO_R_OK) {
5387 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5390 printf("Author root certificate: %s\n", auth_root);
5391 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5396 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5399 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5400 * @brief This API loads the package cert information handle with data from db.
5402 * @par This API is for package-manager client application
5403 * @par Sync (or) Async : Synchronous API
5405 * @param[in] pkgid pointer to the package ID.
5406 * @param[in] handle pointer to the package cert handle.
5407 * @return 0 if success, error code(<0) if fail
5408 * @retval PMINFO_R_OK success
5409 * @retval PMINFO_R_EINVAL invalid argument
5410 * @retval PMINFO_R_ERROR internal error
5411 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5412 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5413 * @see pkgmgrinfo_pkginfo_get_cert_value()
5415 static int get_cert_info(const char *pkgid)
5418 pkgmgrinfo_certinfo_h handle;
5419 char *auth_cert = NULL;
5420 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5421 if (ret != PMINFO_R_OK)
5423 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5424 if (ret != PMINFO_R_OK) {
5425 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5428 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5429 if (ret != PMINFO_R_OK) {
5430 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5433 printf("Author root certificate: %s\n", auth_root);
5434 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5439 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5442 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5443 * @brief This API gets the package cert information from the handle
5445 * @par This API is for package-manager client application
5446 * @par Sync (or) Async : Synchronous API
5448 * @param[in] handle pointer to the package cert handle.
5449 * @param[in] cert_type certificate type
5450 * @param[out] cert_value pointer to hold certificate value
5451 * @return 0 if success, error code(<0) if fail
5452 * @retval PMINFO_R_OK success
5453 * @retval PMINFO_R_EINVAL invalid argument
5454 * @retval PMINFO_R_ERROR internal error
5455 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5456 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5457 * @see pkgmgrinfo_pkginfo_load_certinfo()
5459 static int get_cert_info(const char *pkgid)
5462 pkgmgrinfo_certinfo_h handle;
5463 char *auth_cert = NULL;
5464 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5465 if (ret != PMINFO_R_OK)
5467 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5468 if (ret != PMINFO_R_OK) {
5469 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5472 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5473 if (ret != PMINFO_R_OK) {
5474 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5477 printf("Author root certificate: %s\n", auth_root);
5478 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5483 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5486 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5487 * @brief This API destroys the package cert information handle freeing up all the resources
5489 * @par This API is for package-manager client application
5490 * @par Sync (or) Async : Synchronous API
5492 * @param[in] handle pointer to the package cert handle.
5493 * @return 0 if success, error code(<0) if fail
5494 * @retval PMINFO_R_OK success
5495 * @retval PMINFO_R_EINVAL invalid argument
5496 * @retval PMINFO_R_ERROR internal error
5497 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5499 * @see pkgmgrinfo_pkginfo_load_certinfo()
5501 static int get_cert_info(const char *pkgid)
5504 pkgmgrinfo_certinfo_h handle;
5505 char *auth_cert = NULL;
5506 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5507 if (ret != PMINFO_R_OK)
5509 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5510 if (ret != PMINFO_R_OK) {
5511 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5514 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5515 if (ret != PMINFO_R_OK) {
5516 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5519 printf("Author root certificate: %s\n", auth_root);
5520 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5525 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5528 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5529 * @brief This API deletes the package cert information from DB
5531 * @par This API is for package-manager client application
5532 * @par Sync (or) Async : Synchronous API
5534 * @param[in] pkgid pointer to the package ID.
5535 * @return 0 if success, error code(<0) if fail
5536 * @retval PMINFO_R_OK success
5537 * @retval PMINFO_R_EINVAL invalid argument
5538 * @retval PMINFO_R_ERROR internal error
5542 static int delete_cert_info(const char *pkgid)
5545 ret = pkgmgrinfo_delete_certinfo(pkgid);
5546 if (ret != PMINFO_R_OK)
5552 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5553 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5556 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5557 * @brief This API creates the package cert information handle to set data in db.
5559 * @par This API is for package-manager client application
5560 * @par Sync (or) Async : Synchronous API
5562 * @param[out] handle pointer to the package cert handle.
5563 * @return 0 if success, error code(<0) if fail
5564 * @retval PMINFO_R_OK success
5565 * @retval PMINFO_R_EINVAL invalid argument
5566 * @retval PMINFO_R_ERROR internal error
5568 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5569 * @see pkgmgrinfo_set_cert_value()
5570 * @see pkgmgrinfo_save_certinfo()
5572 static int set_cert_in_db(const char *pkgid)
5575 pkgmgrinfo_instcertinfo_h handle;
5576 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5577 if (ret != PMINFO_R_OK)
5579 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5580 if (ret != PMINFO_R_OK) {
5581 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5584 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5585 if (ret != PMINFO_R_OK) {
5586 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5589 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5594 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5597 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5598 * @brief This API sets the package cert information in the handle.
5600 * @par This API is for package-manager client application
5601 * @par Sync (or) Async : Synchronous API
5603 * @param[in] handle pointer to the package cert handle.
5604 * @param[in] cert_type certificate type.
5605 * @param[in] cert_value certificate value.
5606 * @return 0 if success, error code(<0) if fail
5607 * @retval PMINFO_R_OK success
5608 * @retval PMINFO_R_EINVAL invalid argument
5609 * @retval PMINFO_R_ERROR internal error
5610 * @pre pkgmgrinfo_create_certinfo_set_handle()
5611 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5612 * @see pkgmgrinfo_save_certinfo()
5614 static int set_cert_in_db(const char *pkgid)
5617 pkgmgrinfo_instcertinfo_h handle;
5618 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5619 if (ret != PMINFO_R_OK)
5621 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5622 if (ret != PMINFO_R_OK) {
5623 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5626 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5627 if (ret != PMINFO_R_OK) {
5628 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5631 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5636 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5639 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5640 * @brief This API saves the package cert information in the DB.
5642 * @par This API is for package-manager client application
5643 * @par Sync (or) Async : Synchronous API
5645 * @param[in] pkgid pointer to the package ID.
5646 * @param[in] handle pointer to the package cert handle.
5647 * @return 0 if success, error code(<0) if fail
5648 * @retval PMINFO_R_OK success
5649 * @retval PMINFO_R_EINVAL invalid argument
5650 * @retval PMINFO_R_ERROR internal error
5651 * @pre pkgmgrinfo_create_certinfo_set_handle()
5652 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5653 * @see pkgmgrinfo_save_certinfo()
5655 static int set_cert_in_db(const char *pkgid)
5658 pkgmgrinfo_instcertinfo_h handle;
5659 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5660 if (ret != PMINFO_R_OK)
5662 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5663 if (ret != PMINFO_R_OK) {
5664 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5667 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5668 if (ret != PMINFO_R_OK) {
5669 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5672 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5677 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5680 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5681 * @brief This API destroys the package cert information handle freeing up all the resources.
5683 * @par This API is for package-manager client application
5684 * @par Sync (or) Async : Synchronous API
5686 * @param[in] handle pointer to the package cert handle.
5687 * @return 0 if success, error code(<0) if fail
5688 * @retval PMINFO_R_OK success
5689 * @retval PMINFO_R_EINVAL invalid argument
5690 * @retval PMINFO_R_ERROR internal error
5691 * @pre pkgmgrinfo_create_certinfo_set_handle()
5693 * @see pkgmgrinfo_save_certinfo()
5695 static int set_cert_in_db(const char *pkgid)
5698 pkgmgrinfo_instcertinfo_h handle;
5699 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5700 if (ret != PMINFO_R_OK)
5702 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5703 if (ret != PMINFO_R_OK) {
5704 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5707 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5708 if (ret != PMINFO_R_OK) {
5709 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5712 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5717 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5720 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5721 * @brief This API gets the datacontrol info
5723 * @par This API is for package-manager client application
5724 * @par Sync (or) Async : Synchronous API
5726 * @param[in] providerid pointer to the providerid of dataconltrol.
5727 * @param[in] type pointer to the type of dataconltrol.
5728 * @param[out] appid pointer to hold appid, need to free after using
5729 * @param[out] access pointer to hold access, need to free after using
5730 * @return 0 if success, error code(<0) if fail
5731 * @retval PMINFO_R_OK success
5732 * @retval PMINFO_R_EINVAL invalid argument
5733 * @retval PMINFO_R_ERROR internal error
5736 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5739 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5740 * @brief This API gets the application 'guest mode visibility' value from the DB
5742 * @par This API is for package-manager client application
5743 * @par Sync (or) Async : Synchronous API
5745 * @param[in] handle pointer to application info handle
5746 * @param[out] status pointer to hold app guest mode visibility value
5747 * @return 0 if success, error code(<0) if fail
5748 * @retval PMINFO_R_OK success
5749 * @retval PMINFO_R_EINVAL invalid argument
5750 * @retval PMINFO_R_ERROR internal error
5751 * @pre pkgmgrinfo_appinfo_get_appinfo()
5752 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5753 * @see pkgmgrinfo_appinfo_get_appid()
5754 * @see pkgmgrinfo_appinfo_is_multiple()
5756 static int get_app_guestmode_visibility(const char *appid)
5760 pkgmgrinfo_appinfo_h handle;
5761 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5762 if (ret != PMINFO_R_OK)
5764 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5765 if (ret != PMINFO_R_OK) {
5766 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5769 printf("app guest mode visibility: %d\n", status);
5770 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5775 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5778 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5779 * @brief This API sets the package 'installed_storage' value in db
5781 * @par This API is for package-manager client application
5782 * @par Sync (or) Async : Synchronous API
5784 * @param[in] pkgid pointer to the package ID.
5785 * @param[in] location package install location
5786 * @param[in] external_pkg_path image path if pkg has installed at external storage
5787 * @return 0 if success, error code(<0) if fail
5788 * @retval PMINFO_R_OK success
5789 * @retval PMINFO_R_EINVAL invalid argument
5790 * @retval PMINFO_R_ERROR internal error
5792 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5796 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5797 if (ret != PMINFO_R_OK) {
5804 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
5805 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
5807 /* version compare */
5808 int pkgmgrinfo_compare_package_version(const char *current_version,
5809 const char *target_version, pkgmgrinfo_version_compare_type *res);
5816 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5817 int flag, void *user_data, uid_t uid);
5818 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5819 int flag, void *user_data);
5820 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5821 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5823 int pkgmgrinfo_appinfo_get_installed_list_full(
5824 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5827 * @pkgmgrinfo client API end
5835 #endif /* __PKG_INFO_H__ */