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"
111 /** Integer property for filtering based on package info*/
112 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
114 /** String property for filtering based on app info*/
115 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
116 /** String property for filtering based on app info*/
117 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE"
143 /** Integer property for filtering app disabled by user*/
144 #define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE"
146 /** Boolean property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
148 /** Boolean property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
163 /** will be updated*/
164 /** string property for filtering based on pkg info*/
165 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
167 /* For multiuser support */
168 const char *getIconPath(uid_t uid, bool readonly);
169 const char *getUserPkgParserDBPath(void);
170 const char *getUserPkgParserDBPathUID(uid_t uid);
171 const char *getUserPkgCertDBPath(void);
172 const char *getUserPkgCertDBPathUID(uid_t uid);
173 const char *getUserManifestPath(uid_t uid, bool readonly);
176 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
177 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
178 * @brief This API gets list of installed packages
180 * @par This API is for package-manager client application
181 * @par Sync (or) Async : Synchronous API
182 * @param[in] pkg_list_cb iteration function for list
183 * @param[in] user_data user data to be passed to callback function
184 * @param[in] uid the addressee user id of the instruction
185 * @return 0 if success, error code(<0) if fail
186 * @retval PMINFO_R_OK success
187 * @retval PMINFO_R_EINVAL invalid argument
188 * @retval PMINFO_R_ERROR internal error
192 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
196 pkgid1 = (char *)user_data;
197 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
198 if (strcmp(pkgid1, pkgid2) == 0) {
205 static int list_pkgs()
208 char *name = "helloworld";
209 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
210 if (ret != PMINFO_R_OK) {
217 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
218 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
220 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
221 * @brief This API creates the package information handle from db
223 * @par This API is for package-manager client application
224 * @par Sync (or) Async : Synchronous API
226 * @param[in] pkgid pointer to package ID
227 * @param[in] uid the addressee user id of the instruction
228 * @param[out] handle pointer to the package info handle.
229 * @return 0 if success, error code(<0) if fail
230 * @retval PMINFO_R_OK success
231 * @retval PMINFO_R_EINVAL invalid argument
232 * @retval PMINFO_R_ERROR internal error
234 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
235 * @see pkgmgrinfo_pkginfo_get_pkgid()
236 * @see pkgmgrinfo_pkginfo_is_removable()
238 static int get_pkg_type(const char *pkgid)
242 pkgmgrinfo_pkginfo_h handle;
243 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
244 if (ret != PMINFO_R_OK)
246 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
247 if (ret != PMINFO_R_OK) {
248 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
251 printf("pkgtype: %s\n", type);
252 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
257 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
258 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
261 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
262 * @brief This API gets the package name from the package ID
264 * @par This API is for package-manager client application
265 * @par Sync (or) Async : Synchronous API
267 * @param[in] handle pointer to package info handle
268 * @param[out] pkg_name pointer to hold package name
269 * @return 0 if success, error code(<0) if fail
270 * @retval PMINFO_R_OK success
271 * @retval PMINFO_R_EINVAL invalid argument
272 * @retval PMINFO_R_ERROR internal error
273 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
274 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
275 * @see pkgmgrinfo_pkginfo_get_type()
276 * @see pkgmgrinfo_pkginfo_is_removable()
278 static int get_pkg_name(const char *pkgid)
281 char *pkgname = NULL;
282 pkgmgrinfo_pkginfo_h handle;
283 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
284 if (ret != PMINFO_R_OK)
286 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
287 if (ret != PMINFO_R_OK) {
288 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
291 printf("pkgname: %s\n", pkgname);
292 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
297 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
300 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
301 * @brief This API gets the package id from the package ID
303 * @par This API is for package-manager client application
304 * @par Sync (or) Async : Synchronous API
306 * @param[in] handle pointer to package info handle
307 * @param[out] pkgid pointer to hold package id
308 * @return 0 if success, error code(<0) if fail
309 * @retval PMINFO_R_OK success
310 * @retval PMINFO_R_EINVAL invalid argument
311 * @retval PMINFO_R_ERROR internal error
312 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
313 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
314 * @see pkgmgrinfo_pkginfo_get_type()
315 * @see pkgmgrinfo_pkginfo_is_removable()
317 static int get_pkgid(const char *pkgid)
321 pkgmgrinfo_pkginfo_h handle;
322 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
323 if (ret != PMINFO_R_OK)
325 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
326 if (ret != PMINFO_R_OK) {
327 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
330 printf("pkg id: %s\n", pkg_id);
331 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
336 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
339 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
340 * @brief This API gets the package type from the package ID
342 * @par This API is for package-manager client application
343 * @par Sync (or) Async : Synchronous API
345 * @param[in] handle pointer to package info handle
346 * @param[out] type pointer to hold package type
347 * @return 0 if success, error code(<0) if fail
348 * @retval PMINFO_R_OK success
349 * @retval PMINFO_R_EINVAL invalid argument
350 * @retval PMINFO_R_ERROR internal error
351 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
352 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
353 * @see pkgmgrinfo_pkginfo_get_pkgid()
354 * @see pkgmgrinfo_pkginfo_is_removable()
356 static int get_pkg_type(const char *pkgid)
360 pkgmgrinfo_pkginfo_h handle;
361 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
362 if (ret != PMINFO_R_OK)
364 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
365 if (ret != PMINFO_R_OK) {
366 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
369 printf("pkgtype: %s\n", type);
370 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
375 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
378 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
379 * @brief This API gets the package version from the package ID
381 * @par This API is for package-manager client application
382 * @par Sync (or) Async : Synchronous API
384 * @param[in] handle pointer to package info handle
385 * @param[out] version pointer to hold package version
386 * @return 0 if success, error code(<0) if fail
387 * @retval PMINFO_R_OK success
388 * @retval PMINFO_R_EINVAL invalid argument
389 * @retval PMINFO_R_ERROR internal error
390 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
391 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
392 * @see pkgmgrinfo_pkginfo_get_pkgid()
393 * @see pkgmgrinfo_pkginfo_is_removable()
395 static int get_pkg_version(const char *pkgid)
398 char *version = NULL;
399 pkgmgrinfo_pkginfo_h handle;
400 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
401 if (ret != PMINFO_R_OK)
403 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
404 if (ret != PMINFO_R_OK) {
405 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
408 printf("pkg version: %s\n", version);
409 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
414 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
417 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
418 * @brief This API gets the package api_version from the package ID
420 * @par This API is for package-manager client application
421 * @par Sync (or) Async : Synchronous API
423 * @param[in] handle pointer to package info handle
424 * @param[out] api_version pointer to hold package api_version
425 * @return 0 if success, error code(<0) if fail
426 * @retval PMINFO_R_OK success
427 * @retval PMINFO_R_EINVAL invalid argument
428 * @retval PMINFO_R_ERROR internal error
429 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
430 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
431 * @see pkgmgrinfo_pkginfo_get_pkgid()
432 * @see pkgmgrinfo_pkginfo_is_removable()
434 static int get_pkg_api_version(const char *pkgid)
437 char *api_version = NULL;
438 pkgmgrinfo_pkginfo_h handle = NULL;
439 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
440 if (ret != PMINFO_R_OK)
442 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
443 if (ret != PMINFO_R_OK) {
444 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
447 printf("pkg api_version: %s\n", api_version);
448 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
453 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
456 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
457 * @brief This API gets tep(tizen expansion package) file name associated with the package
459 * @par This API is for package-manager client application
460 * @par Sync (or) Async : Synchronous API
462 * @param[in] handle pointer to the pkginfo handle.
463 * @param[out] tep_name pointer to hold tep name
464 * @return 0 if success, error code(<0) if fail
465 * @retval PMINFO_R_OK success
466 * @retval PMINFO_R_EINVAL invalid argument
467 * @retval PMINFO_R_ERROR internal error
468 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
469 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
470 * @see pkgmgrinfo_pkginfo_get_pkgid()
472 static int get_tep_name(const char *pkgid)
475 char *tep_name = NULL;
476 pkgmgrinfo_pkginfo_h handle = NULL;
477 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
478 if (ret != PMINFO_R_OK)
480 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
481 if (ret != PMINFO_R_OK) {
482 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
485 printf("TEP name is: %s\n", tep_name);
486 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
491 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
494 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
495 * @brief This API gets the package install location from the package ID
497 * @par This API is for package-manager client application
498 * @par Sync (or) Async : Synchronous API
500 * @param[in] handle pointer to package info handle
501 * @param[out] location pointer to hold package install location
502 * @return 0 if success, error code(<0) if fail
503 * @retval PMINFO_R_OK success
504 * @retval PMINFO_R_EINVAL invalid argument
505 * @retval PMINFO_R_ERROR internal error
506 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
507 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
508 * @see pkgmgrinfo_pkginfo_get_pkgid()
509 * @see pkgmgrinfo_pkginfo_is_removable()
511 static int get_pkg_install_location(const char *pkgid)
514 pkgmgrinfo_install_location location;
515 pkgmgrinfo_pkginfo_h handle;
516 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
517 if (ret != PMINFO_R_OK)
519 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
520 if (ret != PMINFO_R_OK) {
521 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
524 printf("pkg install location: %d\n", location);
525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
530 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
533 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
534 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
535 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
536 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
538 * @par This API is for package-manager client application
539 * @par Sync (or) Async : Synchronous API
541 * @param[in] handle pointer to package info handle
542 * @param[out] size pointer to hold package size
543 * @return 0 if success, error code(<0) if fail
544 * @retval PMINFO_R_OK success
545 * @retval PMINFO_R_EINVAL invalid argument
546 * @retval PMINFO_R_ERROR internal error
547 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
548 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
549 * @see pkgmgrinfo_pkginfo_get_pkgid()
550 * @see pkgmgrinfo_pkginfo_is_removable()
552 static int get_pkg_size(const char *pkgid)
556 pkgmgrinfo_pkginfo_h handle;
557 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
558 if (ret != PMINFO_R_OK)
560 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
561 if (ret != PMINFO_R_OK) {
562 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
565 printf("pkgsize: %d\n", size);
566 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
571 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
574 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
575 * @brief This API gets the installed package total size on the target.
577 * @par This API is for package-manager client application
578 * @par Sync (or) Async : Synchronous API
580 * @param[in] handle pointer to package info handle
581 * @param[out] size pointer to hold package total size
582 * @return 0 if success, error code(<0) if fail
583 * @retval PMINFO_R_OK success
584 * @retval PMINFO_R_EINVAL invalid argument
585 * @retval PMINFO_R_ERROR internal error
587 static int get_pkg_total_size(const char *pkgid)
591 pkgmgrinfo_pkginfo_h handle;
592 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
593 if (ret != PMINFO_R_OK)
595 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
596 if (ret != PMINFO_R_OK) {
597 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
600 printf("pkg total size: %d\n", size);
601 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
606 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
609 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
610 * @brief This API gets the installed package data size on the target.
612 * @par This API is for package-manager client application
613 * @par Sync (or) Async : Synchronous API
615 * @param[in] handle pointer to package info handle
616 * @param[out] size pointer to hold package data size
617 * @return 0 if success, error code(<0) if fail
618 * @retval PMINFO_R_OK success
619 * @retval PMINFO_R_EINVAL invalid argument
620 * @retval PMINFO_R_ERROR internal error
622 static int get_pkg_data_size(const char *pkgid)
626 pkgmgrinfo_pkginfo_h handle;
627 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
628 if (ret != PMINFO_R_OK)
630 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
631 if (ret != PMINFO_R_OK) {
632 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
635 printf("pkg data size: %d\n", size);
636 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
641 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
644 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
645 * @brief This API gets the package icon from the package ID
647 * @par This API is for package-manager client application
648 * @par Sync (or) Async : Synchronous API
650 * @param[in] handle pointer to package info handle
651 * @param[out] icon pointer to hold package icon
652 * @return 0 if success, error code(<0) if fail
653 * @retval PMINFO_R_OK success
654 * @retval PMINFO_R_EINVAL invalid argument
655 * @retval PMINFO_R_ERROR internal error
656 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
657 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
658 * @see pkgmgrinfo_pkginfo_get_pkgid()
659 * @see pkgmgrinfo_pkginfo_is_removable()
661 static int get_pkg_icon(const char *pkgid)
665 pkgmgrinfo_pkginfo_h handle;
666 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
667 if (ret != PMINFO_R_OK)
669 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
670 if (ret != PMINFO_R_OK) {
671 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
674 printf("pkg icon: %s\n", icon);
675 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
680 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
683 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
684 * @brief This API gets the package label from the package ID
686 * @par This API is for package-manager client application
687 * @par Sync (or) Async : Synchronous API
689 * @param[in] handle pointer to package info handle
690 * @param[out] label pointer to hold package label
691 * @return 0 if success, error code(<0) if fail
692 * @retval PMINFO_R_OK success
693 * @retval PMINFO_R_EINVAL invalid argument
694 * @retval PMINFO_R_ERROR internal error
695 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
696 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
697 * @see pkgmgrinfo_pkginfo_get_pkgid()
698 * @see pkgmgrinfo_pkginfo_is_removable()
700 static int get_pkg_label(const char *pkgid)
704 pkgmgrinfo_pkginfo_h handle;
705 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
706 if (ret != PMINFO_R_OK)
708 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
709 if (ret != PMINFO_R_OK) {
710 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
713 printf("pkg label: %s\n", label);
714 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
719 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
722 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
723 * @brief This API gets the package description from the package ID
725 * @par This API is for package-manager client application
726 * @par Sync (or) Async : Synchronous API
728 * @param[in] handle pointer to package info handle
729 * @param[out] description pointer to hold package description
730 * @return 0 if success, error code(<0) if fail
731 * @retval PMINFO_R_OK success
732 * @retval PMINFO_R_EINVAL invalid argument
733 * @retval PMINFO_R_ERROR internal error
734 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
735 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
736 * @see pkgmgrinfo_pkginfo_get_pkgid()
737 * @see pkgmgrinfo_pkginfo_is_removable()
739 static int get_pkg_description(const char *pkgid)
742 char *description = NULL;
743 pkgmgrinfo_pkginfo_h handle;
744 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
745 if (ret != PMINFO_R_OK)
747 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
748 if (ret != PMINFO_R_OK) {
749 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
752 printf("pkg description: %s\n", description);
753 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
758 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
761 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
762 * @brief This API gets the package's author name from the package ID
764 * @par This API is for package-manager client application
765 * @par Sync (or) Async : Synchronous API
767 * @param[in] handle pointer to package info handle
768 * @param[out] author_name pointer to hold package author name
769 * @return 0 if success, error code(<0) if fail
770 * @retval PMINFO_R_OK success
771 * @retval PMINFO_R_EINVAL invalid argument
772 * @retval PMINFO_R_ERROR internal error
773 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
774 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
775 * @see pkgmgrinfo_pkginfo_get_pkgid()
776 * @see pkgmgrinfo_pkginfo_is_removable()
778 static int get_pkg_author_name(const char *pkgid)
781 char *author_name = NULL;
782 pkgmgrinfo_pkginfo_h handle;
783 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
784 if (ret != PMINFO_R_OK)
786 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
787 if (ret != PMINFO_R_OK) {
788 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
791 printf("pkg author name: %s\n", author_name);
792 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
797 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
800 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
801 * @brief This API gets the package's author email from the package ID
803 * @par This API is for package-manager client application
804 * @par Sync (or) Async : Synchronous API
806 * @param[in] handle pointer to package info handle
807 * @param[out] author_email pointer to hold package author email
808 * @return 0 if success, error code(<0) if fail
809 * @retval PMINFO_R_OK success
810 * @retval PMINFO_R_EINVAL invalid argument
811 * @retval PMINFO_R_ERROR internal error
812 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
813 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
814 * @see pkgmgrinfo_pkginfo_get_pkgid()
815 * @see pkgmgrinfo_pkginfo_is_removable()
817 static int get_pkg_author_email(const char *pkgid)
820 char *author_email = NULL;
821 pkgmgrinfo_pkginfo_h handle;
822 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
823 if (ret != PMINFO_R_OK)
825 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
826 if (ret != PMINFO_R_OK) {
827 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
830 printf("pkg author email: %s\n", author_email);
831 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
836 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
839 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
840 * @brief This API gets the package's author href from the package ID
842 * @par This API is for package-manager client application
843 * @par Sync (or) Async : Synchronous API
845 * @param[in] handle pointer to package info handle
846 * @param[out] author_href pointer to hold package author href
847 * @return 0 if success, error code(<0) if fail
848 * @retval PMINFO_R_OK success
849 * @retval PMINFO_R_EINVAL invalid argument
850 * @retval PMINFO_R_ERROR internal error
851 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
852 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
853 * @see pkgmgrinfo_pkginfo_get_pkgid()
854 * @see pkgmgrinfo_pkginfo_is_removable()
856 static int get_pkg_author_href(const char *pkgid)
859 char *author_href = NULL;
860 pkgmgrinfo_pkginfo_h handle;
861 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
862 if (ret != PMINFO_R_OK)
864 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
865 if (ret != PMINFO_R_OK) {
866 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
869 printf("pkg author href: %s\n", author_href);
870 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
875 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
878 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
879 * @brief This API gets the package installed storagae value from the package ID
881 * @par This API is for package-manager client application
882 * @par Sync (or) Async : Synchronous API
884 * @param[in] handle pointer to package info handle
885 * @param[out] storage pointer to hold package installed storage
886 * @return 0 if success, error code(<0) if fail
887 * @retval PMINFO_R_OK success
888 * @retval PMINFO_R_EINVAL invalid argument
889 * @retval PMINFO_R_ERROR internal error
890 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
891 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
892 * @see pkgmgrinfo_pkginfo_get_pkgid()
893 * @see pkgmgrinfo_pkginfo_is_removable()
895 static int get_pkg_installed_storage(const char *pkgid)
898 pkgmgrinfo_installed_storage storage;
899 pkgmgrinfo_pkginfo_h handle;
900 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
901 if (ret != PMINFO_R_OK)
903 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
904 if (ret != PMINFO_R_OK) {
905 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
908 printf("pkg installed storage: %d\n", storage);
909 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
914 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
917 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
918 * @brief This API gets the installed time of package from the package ID
920 * @par This API is for package-manager client application
921 * @par Sync (or) Async : Synchronous API
923 * @param[in] handle pointer to package info handle
924 * @param[out] installed_time pointer to hold installed time of package
925 * @return 0 if success, error code(<0) if fail
926 * @retval PMINFO_R_OK success
927 * @retval PMINFO_R_EINVAL invalid argument
928 * @retval PMINFO_R_ERROR internal error
929 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
930 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
931 * @see pkgmgrinfo_pkginfo_get_pkgid()
932 * @see pkgmgrinfo_pkginfo_is_removable()
934 static int get_pkg_installed_time(const char *pkgid)
937 int installed_time = 0;
938 pkgmgrinfo_pkginfo_h handle;
939 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
940 if (ret != PMINFO_R_OK)
942 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
943 if (ret != PMINFO_R_OK) {
944 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
947 printf("installed_time: %d\n", installed_time);
948 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
953 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
956 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
957 * @brief This API gets the launch mode of package from the package ID
959 * @par This API is for package-manager client application
960 * @par Sync (or) Async : Synchronous API
962 * @param[in] handle pointer to package info handle
963 * @param[out] mode pointer to hold launch mode of package
964 * @return 0 if success, error code(<0) if fail
965 * @retval PMINFO_R_OK success
966 * @retval PMINFO_R_EINVAL invalid argument
967 * @retval PMINFO_R_ERROR internal error
968 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
969 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
970 * @see pkgmgrinfo_pkginfo_get_pkgid()
971 * @see pkgmgrinfo_pkginfo_is_removable()
973 static int get_pkg_launch_mode(const char *pkgid)
976 char *launch_mode = NULL;
977 pkgmgrinfo_pkginfo_h handle;
978 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
979 if (ret != PMINFO_R_OK)
981 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
982 if (ret != PMINFO_R_OK) {
983 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
986 printf("launch mode: %s\n", mode);
987 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
992 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
995 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
996 * @brief This API gets the store client id of package from the package ID
998 * @par This API is for package-manager client application
999 * @par Sync (or) Async : Synchronous API
1001 * @param[in] handle pointer to package info handle
1002 * @param[out] storeclientid pointer to hold store client id of package
1003 * @return 0 if success, error code(<0) if fail
1004 * @retval PMINFO_R_OK success
1005 * @retval PMINFO_R_EINVAL invalid argument
1006 * @retval PMINFO_R_ERROR internal error
1007 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1008 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1009 * @see pkgmgrinfo_pkginfo_get_pkgid()
1010 * @see pkgmgrinfo_pkginfo_is_removable()
1012 static int get_pkg_storeclientid(const char *pkgid)
1015 char *storeclientid = 0;
1016 pkgmgrinfo_pkginfo_h handle;
1017 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1018 if (ret != PMINFO_R_OK)
1020 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1021 if (ret != PMINFO_R_OK) {
1022 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1025 printf(store client id: %s\n", storeclientid);
1026 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1031 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1034 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1035 * @brief This API gets the main app id of package from the package ID
1037 * @par This API is for package-manager client application
1038 * @par Sync (or) Async : Synchronous API
1040 * @param[in] handle pointer to package info handle
1041 * @param[out] mainappid pointer to hold main app id of package
1042 * @return 0 if success, error code(<0) if fail
1043 * @retval PMINFO_R_OK success
1044 * @retval PMINFO_R_EINVAL invalid argument
1045 * @retval PMINFO_R_ERROR internal error
1046 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1047 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1048 * @see pkgmgrinfo_pkginfo_get_pkgid()
1049 * @see pkgmgrinfo_pkginfo_is_removable()
1051 static int get_pkg_mainappid(const char *pkgid)
1054 char *mainappid = 0;
1055 pkgmgrinfo_pkginfo_h handle;
1056 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1057 if (ret != PMINFO_R_OK)
1059 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1060 if (ret != PMINFO_R_OK) {
1061 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1064 printf(main app id: %s\n", mainappid);
1065 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1070 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1073 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1074 * @brief This API gets the url of package from the package ID
1076 * @par This API is for package-manager client application
1077 * @par Sync (or) Async : Synchronous API
1079 * @param[in] handle pointer to package info handle
1080 * @param[out] url pointer to hold url of package
1081 * @return 0 if success, error code(<0) if fail
1082 * @retval PMINFO_R_OK success
1083 * @retval PMINFO_R_EINVAL invalid argument
1084 * @retval PMINFO_R_ERROR internal error
1085 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1086 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1087 * @see pkgmgrinfo_pkginfo_get_pkgid()
1088 * @see pkgmgrinfo_pkginfo_is_removable()
1090 static int get_pkg_url(const char *pkgid)
1094 pkgmgrinfo_pkginfo_h handle;
1095 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1096 if (ret != PMINFO_R_OK)
1098 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1099 if (ret != PMINFO_R_OK) {
1100 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1103 printf("url : %s\n", url);
1104 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1109 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1113 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1114 * @brief This API gets the root path of package
1116 * @par Sync (or) Async : Synchronous API
1118 * @param[in] handle pointer to package info handle
1119 * @param[out] path pointer to hold root path of package
1120 * @return 0 if success, error code(<0) if fail
1121 * @retval PMINFO_R_OK success
1122 * @retval PMINFO_R_EINVAL invalid argument
1123 * @retval PMINFO_R_ERROR internal error
1125 static int get_root_path(const char *pkgid)
1129 pkgmgrinfo_pkginfo_h handle;
1130 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1131 if (ret != PMINFO_R_OK)
1134 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1135 if (ret != PMINFO_R_OK) {
1136 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1139 printf("path : %s\n", path);
1140 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1146 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1150 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1151 * @brief This API gets the csc path of package
1153 * @par Sync (or) Async : Synchronous API
1155 * @param[in] handle pointer to package info handle
1156 * @param[out] path pointer to hold csc path of package
1157 * @return 0 if success, error code(<0) if fail
1158 * @retval PMINFO_R_OK success
1159 * @retval PMINFO_R_EINVAL invalid argument
1160 * @retval PMINFO_R_ERROR internal error
1162 static int get_csc_path(const char *pkgid)
1166 pkgmgrinfo_pkginfo_h handle;
1167 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1168 if (ret != PMINFO_R_OK)
1171 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1172 if (ret != PMINFO_R_OK) {
1173 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1176 printf("path : %s\n", path);
1177 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1183 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1186 * @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)
1187 * @brief This API compare the cert information from given package id
1189 * @par This API is for package-manager client application
1190 * @par Sync (or) Async : Synchronous API
1192 * @param[in] lhs_package_id pointer to first package ID
1193 * @param[in] rhs_package_id pointer to second package ID
1194 * @param[out] compare_result pointer to the compare result.
1195 * @return 0 if success, error code(<0) if fail
1196 * @retval PMINFO_R_OK success
1197 * @retval PMINFO_R_EINVAL invalid argument
1198 * @retval PMINFO_R_ERROR internal error
1200 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1201 * @see pkgmgrinfo_pkginfo_get_pkgid()
1202 * @see pkgmgrinfo_pkginfo_is_removable()
1204 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1207 pkgmgrinfo_cert_compare_result_type_e result;
1209 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1210 if (ret != PMINFO_R_OK) {
1213 printf("result: %d\n", result);
1218 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);
1219 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);
1221 * @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)
1222 * @brief This API compare the cert information from given app id
1224 * @par This API is for package-manager client application
1225 * @par Sync (or) Async : Synchronous API
1227 * @param[in] lhs_app_id pointer to first app ID
1228 * @param[in] rhs_app_id pointer to second app ID
1229 * @param[out] compare_result pointer to the compare result.
1230 * @return 0 if success, error code(<0) if fail
1231 * @retval PMINFO_R_OK success
1232 * @retval PMINFO_R_EINVAL invalid argument
1233 * @retval PMINFO_R_ERROR internal error
1235 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1236 * @see pkgmgrinfo_pkginfo_get_pkgid()
1237 * @see pkgmgrinfo_pkginfo_is_removable()
1239 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1242 pkgmgrinfo_cert_compare_result_type_e result;
1244 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1245 if (ret != PMINFO_R_OK) {
1248 printf("result: %d\n", result);
1253 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);
1254 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);
1256 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1257 * @brief This API gets the package 'removable' value from the package ID
1259 * @par This API is for package-manager client application
1260 * @par Sync (or) Async : Synchronous API
1262 * @param[in] handle pointer to package info handle
1263 * @param[out] removable pointer to hold package removable value
1264 * @return 0 if success, error code(<0) if fail
1265 * @retval PMINFO_R_OK success
1266 * @retval PMINFO_R_EINVAL invalid argument
1267 * @retval PMINFO_R_ERROR internal error
1268 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1269 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1270 * @see pkgmgrinfo_pkginfo_get_pkgid()
1271 * @see pkgmgrinfo_pkginfo_is_readonly()
1273 static int get_pkg_removable(const char *pkgid)
1277 pkgmgrinfo_pkginfo_h handle;
1278 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1279 if (ret != PMINFO_R_OK)
1281 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1282 if (ret != PMINFO_R_OK) {
1283 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1286 printf("pkg removable: %d\n", removable);
1287 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1292 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1295 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1296 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1298 * @par This API is for package-manager client application
1299 * @par Sync (or) Async : Synchronous API
1301 * @param[in] handle pointer to package info handle
1302 * @param[out] movable pointer to hold package movable state
1303 * @return 0 if success, error code(<0) if fail
1304 * @retval PMINFO_R_OK success
1305 * @retval PMINFO_R_EINVAL invalid argument
1306 * @retval PMINFO_R_ERROR internal error
1307 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1308 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1309 * @see pkgmgrinfo_pkginfo_get_pkgid()
1311 static int get_pkg_movable(const char *pkgid)
1315 pkgmgrinfo_pkginfo_h handle;
1316 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1317 if (ret != PMINFO_R_OK)
1319 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1320 if (ret != PMINFO_R_OK) {
1321 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1324 printf("pkg movable: %d\n", movable);
1325 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1330 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1333 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1334 * @brief This API gets the package 'preload' value from the package ID
1336 * @par This API is for package-manager client application
1337 * @par Sync (or) Async : Synchronous API
1339 * @param[in] handle pointer to package info handle
1340 * @param[out] preload pointer to hold package preload value
1341 * @return 0 if success, error code(<0) if fail
1342 * @retval PMINFO_R_OK success
1343 * @retval PMINFO_R_EINVAL invalid argument
1344 * @retval PMINFO_R_ERROR internal error
1345 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1346 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1347 * @see pkgmgrinfo_pkginfo_get_pkgid()
1348 * @see pkgmgrinfo_pkginfo_is_readonly()
1350 static int get_pkg_preload(const char *pkgid)
1354 pkgmgrinfo_pkginfo_h handle;
1355 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1356 if (ret != PMINFO_R_OK)
1358 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1359 if (ret != PMINFO_R_OK) {
1360 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1363 printf("pkg preload: %d\n", preload);
1364 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1369 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1372 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1373 * @brief This API gets the value for given handle is system or not
1375 * @par This API is for package-manager client application
1376 * @par Sync (or) Async : Synchronous API
1378 * @param[in] handle pointer to package info handle
1379 * @param[out] system pointer to hold system is or not
1380 * @return 0 if success, error code(<0) if fail
1381 * @retval PMINFO_R_OK success
1382 * @retval PMINFO_R_EINVAL invalid argument
1383 * @retval PMINFO_R_ERROR internal error
1384 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1385 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1386 * @see pkgmgrinfo_pkginfo_get_pkgid()
1387 * @see pkgmgrinfo_pkginfo_is_readonly()
1389 static int get_pkg_system(const char *pkgid)
1392 bool system = false;
1393 pkgmgrinfo_pkginfo_h handle = NULL;
1394 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1395 if (ret != PMINFO_R_OK)
1397 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1398 if (ret != PMINFO_R_OK) {
1399 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1402 printf("pkg system: %d\n", system);
1403 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1408 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1411 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1412 * @brief This API gets the package 'readonly' value from the package ID
1414 * @par This API is for package-manager client application
1415 * @par Sync (or) Async : Synchronous API
1417 * @param[in] handle pointer to package info handle
1418 * @param[out] readonly pointer to hold package readonly value
1419 * @return 0 if success, error code(<0) if fail
1420 * @retval PMINFO_R_OK success
1421 * @retval PMINFO_R_EINVAL invalid argument
1422 * @retval PMINFO_R_ERROR internal error
1423 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1424 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1425 * @see pkgmgrinfo_pkginfo_get_pkgid()
1426 * @see pkgmgrinfo_pkginfo_is_removable()
1428 static int get_pkg_readonly(const char *pkgid)
1432 pkgmgrinfo_pkginfo_h handle;
1433 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1434 if (ret != PMINFO_R_OK)
1436 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1437 if (ret != PMINFO_R_OK) {
1438 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1441 printf("pkg readonly: %d\n", readonly);
1442 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1447 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1451 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1452 * @brief This API gets the package 'upate' value from the package ID
1454 * @par This API is for package-manager client application
1455 * @par Sync (or) Async : Synchronous API
1457 * @param[in] handle pointer to package info handle
1458 * @param[out] update pointer to hold package update value
1459 * @return 0 if success, error code(<0) if fail
1460 * @retval PMINFO_R_OK success
1461 * @retval PMINFO_R_EINVAL invalid argument
1462 * @retval PMINFO_R_ERROR internal error
1463 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1464 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1465 * @see pkgmgrinfo_pkginfo_get_pkgid()
1467 static int get_pkg_update(const char *pkgid)
1471 pkgmgrinfo_pkginfo_h handle;
1472 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1473 if (ret != PMINFO_R_OK)
1475 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1476 if (ret != PMINFO_R_OK) {
1477 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1480 printf("pkg update: %d\n", update);
1481 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1486 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1489 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1490 * @brief This API gets the package 'support_disable' value from the package ID
1492 * @par This API is for package-manager client application
1493 * @par Sync (or) Async : Synchronous API
1495 * @param[in] handle pointer to package info handle
1496 * @param[out] support_disable pointer to hold package support_disable value
1497 * @return 0 if success, error code(<0) if fail
1498 * @retval PMINFO_R_OK success
1499 * @retval PMINFO_R_EINVAL invalid argument
1500 * @retval PMINFO_R_ERROR internal error
1501 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1502 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1503 * @see pkgmgrinfo_pkginfo_get_pkgid()
1505 static int get_pkg_support_disable(const char *pkgid)
1508 bool support_disable;
1509 pkgmgrinfo_pkginfo_h handle = NULL;
1510 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1511 if (ret != PMINFO_R_OK)
1513 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1514 if (ret != PMINFO_R_OK) {
1515 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1518 printf("pkg support_disable: %d\n", support_disable);
1519 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1524 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1527 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1528 * @brief This API gets whethere the given package is global package or user package
1530 * @par This API is for package-manager client application
1531 * @par Sync (or) Async : Synchronous API
1533 * @param[in] uid uid of the user to determine the database
1534 * @param[in] pkgid id of the current package
1535 * @return 1 if it a global package, 0 else
1538 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1542 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1543 * @brief This API gets the package 'accessible' value from the package ID
1545 * @par This API is for package-manager client application
1546 * @par Sync (or) Async : Synchronous API
1548 * @param[in] handle pointer to package info handle
1549 * @param[out] accessible pointer to hold package accessible value
1550 * @return 0 if success, error code(<0) if fail
1551 * @retval PMINFO_R_OK success
1552 * @retval PMINFO_R_EINVAL invalid argument
1553 * @retval PMINFO_R_ERROR internal error
1554 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1555 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1556 * @see pkgmgrinfo_pkginfo_get_pkgid()
1557 * @see pkgmgrinfo_pkginfo_is_readonly()
1559 static int get_pkg_accessible(const char *pkgid)
1563 pkgmgrinfo_pkginfo_h handle;
1564 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1565 if (ret != PMINFO_R_OK)
1567 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1568 if (ret != PMINFO_R_OK) {
1569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1572 printf("pkg accessible: %d\n", accessible);
1573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1578 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1581 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1582 * @brief This API destroys the package information handle freeing up all the resources
1584 * @par This API is for package-manager client application
1585 * @par Sync (or) Async : Synchronous API
1587 * @param[in] handle pointer to the package info handle
1588 * @return 0 if success, error code(<0) if fail
1589 * @retval PMINFO_R_OK success
1590 * @retval PMINFO_R_EINVAL invalid argument
1591 * @retval PMINFO_R_ERROR internal error
1592 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1594 * @see pkgmgrinfo_pkginfo_get_pkgid()
1595 * @see pkgmgrinfo_pkginfo_is_removable()
1597 static int get_pkg_type(const char *pkgid)
1601 pkgmgrinfo_pkginfo_h handle;
1602 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1603 if (ret != PMINFO_R_OK)
1605 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1606 if (ret != PMINFO_R_OK) {
1607 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1610 printf("pkgtype: %s\n", type);
1611 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1616 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1619 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1620 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1621 The query will search the entire package information collected from the manifest file of all the installed packages
1623 * @par This API is for package-manager client application
1624 * @par Sync (or) Async : Synchronous API
1626 * @param[out] handle pointer to the package info filter handle.
1627 * @return 0 if success, error code(<0) if fail
1628 * @retval PMINFO_R_OK success
1629 * @retval PMINFO_R_EINVAL invalid argument
1630 * @retval PMINFO_R_ERROR internal error
1632 * @post pkgmgrinfo_pkginfo_filter_destroy()
1633 * @see pkgmgrinfo_pkginfo_filter_count()
1634 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1636 static int get_tpk_pkg_count()
1640 pkgmgrinfo_pkginfo_filter_h handle;
1641 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1642 if (ret != PMINFO_R_OK)
1644 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1645 if (ret != PMINFO_R_OK) {
1646 pkgmgrinfo_pkginfo_filter_destroy(handle);
1649 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1650 if (ret != PMINFO_R_OK) {
1651 pkgmgrinfo_pkginfo_filter_destroy(handle);
1654 printf("No of tpk pkgs: %d\n", count);
1655 pkgmgrinfo_pkginfo_filter_destroy(handle);
1660 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1663 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1664 * @brief This API destroys the package information filter handle freeing up all the resources
1666 * @par This API is for package-manager client application
1667 * @par Sync (or) Async : Synchronous API
1669 * @param[in] handle pointer to the package info filter handle.
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_filter_create()
1676 * @see pkgmgrinfo_pkginfo_filter_count()
1677 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1679 static int get_tpk_pkg_count()
1683 pkgmgrinfo_pkginfo_filter_h handle;
1684 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1685 if (ret != PMINFO_R_OK)
1687 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1688 if (ret != PMINFO_R_OK) {
1689 pkgmgrinfo_pkginfo_filter_destroy(handle);
1692 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1693 if (ret != PMINFO_R_OK) {
1694 pkgmgrinfo_pkginfo_filter_destroy(handle);
1697 printf("No of tpk pkgs: %d\n", count);
1698 pkgmgrinfo_pkginfo_filter_destroy(handle);
1703 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1706 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1707 * @brief This API adds a boolean filter property to the filter handle
1709 * @par This API is for package-manager client application
1710 * @par Sync (or) Async : Synchronous API
1712 * @param[in] handle pointer to the package info filter handle.
1713 * @param[in] property boolean property name.
1714 * @param[in] value value corresponding to the property.
1715 * @return 0 if success, error code(<0) if fail
1716 * @retval PMINFO_R_OK success
1717 * @retval PMINFO_R_EINVAL invalid argument
1718 * @retval PMINFO_R_ERROR internal error
1719 * @pre pkgmgrinfo_pkginfo_filter_create()
1720 * @post pkgmgrinfo_pkginfo_filter_destroy()
1721 * @see pkgmgrinfo_pkginfo_filter_count()
1722 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1724 static int get_preload_pkg_count()
1728 pkgmgrinfo_pkginfo_filter_h handle;
1729 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1730 if (ret != PMINFO_R_OK)
1732 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1733 if (ret != PMINFO_R_OK) {
1734 pkgmgrinfo_pkginfo_filter_destroy(handle);
1737 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1738 if (ret != PMINFO_R_OK) {
1739 pkgmgrinfo_pkginfo_filter_destroy(handle);
1742 printf("No of preload pkgs: %d\n", count);
1743 pkgmgrinfo_pkginfo_filter_destroy(handle);
1748 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1749 const char *property, const bool value);
1752 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1753 * @brief This API adds an integer filter property to the filter handle
1755 * @par This API is for package-manager client application
1756 * @par Sync (or) Async : Synchronous API
1758 * @param[in] handle pointer to the package info filter handle.
1759 * @param[in] property integer property name.
1760 * @param[in] value value corresponding to the property.
1761 * @return 0 if success, error code(<0) if fail
1762 * @retval PMINFO_R_OK success
1763 * @retval PMINFO_R_EINVAL invalid argument
1764 * @retval PMINFO_R_ERROR internal error
1765 * @pre pkgmgrinfo_pkginfo_filter_create()
1766 * @post pkgmgrinfo_pkginfo_filter_destroy()
1767 * @see pkgmgrinfo_pkginfo_filter_count()
1768 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1770 static int get_pkg_count()
1774 pkgmgrinfo_pkginfo_filter_h handle;
1775 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1776 if (ret != PMINFO_R_OK)
1778 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1779 if (ret != PMINFO_R_OK) {
1780 pkgmgrinfo_pkginfo_filter_destroy(handle);
1783 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1784 if (ret != PMINFO_R_OK) {
1785 pkgmgrinfo_pkginfo_filter_destroy(handle);
1788 printf("No of preload pkgs: %d\n", count);
1789 pkgmgrinfo_pkginfo_filter_destroy(handle);
1794 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1795 const char *property, const int value);
1798 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1799 * @brief This API adds a string filter property to the filter handle
1801 * @par This API is for package-manager client application
1802 * @par Sync (or) Async : Synchronous API
1804 * @param[in] handle pointer to the package info filter handle.
1805 * @param[in] property string property name.
1806 * @param[in] value value corresponding to the property.
1807 * @return 0 if success, error code(<0) if fail
1808 * @retval PMINFO_R_OK success
1809 * @retval PMINFO_R_EINVAL invalid argument
1810 * @retval PMINFO_R_ERROR internal error
1811 * @pre pkgmgrinfo_pkginfo_filter_create()
1812 * @post pkgmgrinfo_pkginfo_filter_destroy()
1813 * @see pkgmgrinfo_pkginfo_filter_count()
1814 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1816 static int get_tpk_pkg_count()
1820 pkgmgrinfo_pkginfo_filter_h handle;
1821 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1822 if (ret != PMINFO_R_OK)
1824 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1825 if (ret != PMINFO_R_OK) {
1826 pkgmgrinfo_pkginfo_filter_destroy(handle);
1829 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1830 if (ret != PMINFO_R_OK) {
1831 pkgmgrinfo_pkginfo_filter_destroy(handle);
1834 printf("No of tpk pkgs: %d\n", count);
1835 pkgmgrinfo_pkginfo_filter_destroy(handle);
1840 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1841 const char *property, const char *value);
1844 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1845 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1847 * @par This API is for package-manager client application
1848 * @par Sync (or) Async : Synchronous API
1850 * @param[in] handle pointer to the package info filter handle.
1851 * @param[in] pkg_cb callback function.
1852 * @param[in] user_data user data to be passed to the callback function
1853 * @return 0 if success, error code(<0) if fail
1854 * @retval PMINFO_R_OK success
1855 * @retval PMINFO_R_EINVAL invalid argument
1856 * @retval PMINFO_R_ERROR internal error
1857 * @pre pkgmgrinfo_pkginfo_filter_create()
1858 * @post pkgmgrinfo_pkginfo_filter_destroy()
1859 * @see pkgmgrinfo_pkginfo_filter_count()
1861 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1864 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1865 printf("pkg id : %s\n", pkgid);
1869 static int get_tpk_pkg_list()
1872 pkgmgrinfo_pkginfo_filter_h handle;
1873 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1874 if (ret != PMINFO_R_OK)
1876 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1877 if (ret != PMINFO_R_OK) {
1878 pkgmgrinfo_pkginfo_filter_destroy(handle);
1881 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1882 if (ret != PMINFO_R_OK) {
1883 pkgmgrinfo_pkginfo_filter_destroy(handle);
1886 pkgmgrinfo_pkginfo_filter_destroy(handle);
1891 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1892 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1893 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1894 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1897 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1898 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1899 * @brief This API counts the package that satisfy the filter conditions
1901 * @par This API is for package-manager client application
1902 * @par Sync (or) Async : Synchronous API
1904 * @param[in] handle pointer to the package info filter handle.
1905 * @param[in] count pointer to store the count value.
1906 * @param[in] uid the addressee user id of the instruction
1907 * @return 0 if success, error code(<0) if fail
1908 * @retval PMINFO_R_OK success
1909 * @retval PMINFO_R_EINVAL invalid argument
1910 * @retval PMINFO_R_ERROR internal error
1911 * @pre pkgmgrinfo_pkginfo_filter_create()
1912 * @post pkgmgrinfo_pkginfo_filter_destroy()
1913 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1915 static int get_tpk_pkg_count()
1919 pkgmgrinfo_pkginfo_filter_h handle;
1920 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1921 if (ret != PMINFO_R_OK)
1923 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1924 if (ret != PMINFO_R_OK) {
1925 pkgmgrinfo_pkginfo_filter_destroy(handle);
1928 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1929 if (ret != PMINFO_R_OK) {
1930 pkgmgrinfo_pkginfo_filter_destroy(handle);
1933 printf("No of tpk pkgs: %d\n", count);
1934 pkgmgrinfo_pkginfo_filter_destroy(handle);
1939 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1940 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1942 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1943 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1944 * @brief This API gets the list of privilege for a particular package
1946 * @par This API is for package-manager client application
1947 * @par Sync (or) Async : Synchronous API
1948 * @param[in] handle pointer to the package info handle.
1949 * @param[in] privilege_func callback function for list
1950 * @param[in] user_data user data to be passed to callback function
1951 * @return 0 if success, error code(<0) if fail
1952 * @retval PMINFO_R_OK success
1953 * @retval PMINFO_R_EINVAL invalid argument
1954 * @retval PMINFO_R_ERROR internal error
1955 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1956 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1958 int privilege_func(const char *name, void *user_data)
1960 if (strcmp(name, (char *)user_data) == 0)
1966 static int list_privilege(const char *package, char *privilege)
1969 pkgmgrinfo_pkginfo_h handle;
1970 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1971 if (ret != PMINFO_R_OK)
1973 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1974 if (ret != PMINFO_R_OK) {
1975 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1978 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1983 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1984 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1986 /* TODO: add doxygen comment here */
1987 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
1988 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
1989 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1990 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1991 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1992 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1993 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1996 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
1997 * @brief This API copy the application information handle
1999 * @par This API is for package-manager client application
2000 * @par Sync (or) Async : Synchronous API
2002 * @param[in] handle pointer to the package info handle.
2003 * @param[out] handle pointer to the package info handle.
2004 * @return 0 if success, error code(<0) if fail
2005 * @retval PMINFO_R_OK success
2006 * @retval PMINFO_R_EINVAL invalid argument
2007 * @retval PMINFO_R_ERROR internal error
2009 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2011 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2015 pkgmgrinfo_pkginfo_h clone;
2017 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2018 if (ret != PMINFO_R_OK)
2022 printf("package: %s\n", clone->package);
2023 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2028 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2032 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2033 pkgmgrinfo_app_list_cb app_func, void *user_data)
2034 * @brief This API gets list of installed applications for a particular package
2036 * @par This API is for package-manager client application
2037 * @par Sync (or) Async : Synchronous API
2038 * @param[in] handle package info handle
2039 * @param[in] component application component
2040 * @param[in] app_func iteration function for list
2041 * @param[in] user_data user data to be passed to callback function
2042 * @return 0 if success, error code(<0) if fail
2043 * @retval PMINFO_R_OK success
2044 * @retval PMINFO_R_EINVAL invalid argument
2045 * @retval PMINFO_R_ERROR internal error
2046 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2047 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2049 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2052 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2053 printf("appid : %s\n", appid);
2057 static int list_apps(const char *pkgid)
2060 pkgmgrinfo_pkginfo_h handle;
2061 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2062 if (ret != PMINFO_R_OK)
2064 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2065 if (ret != PMINFO_R_OK) {
2066 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2069 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2074 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2075 pkgmgrinfo_app_list_cb app_func, void *user_data);
2076 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2077 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2079 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2080 * @brief This API gets list of installed applications from all packages with minimum informaion.
2082 * @par This API is for package-manager client application
2083 * @par Sync (or) Async : Synchronous API
2084 * @param[in] app_func iteration function for list
2085 * @param[in] user_data user data to be passed to callback function
2086 * @return 0 if success, error code(<0) if fail
2087 * @retval PMINFO_R_OK success
2088 * @retval PMINFO_R_EINVAL invalid argument
2089 * @retval PMINFO_R_ERROR internal error
2093 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2095 char *pkgid1 = NULL;
2096 char *pkgid2 = NULL;
2097 pkgid1 = (char *)user_data;
2098 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2099 if (strcmp(pkgid1, pkgid2) == 0) {
2106 static int list_apps()
2109 char *name = "helloworld";
2110 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2111 if (ret != PMINFO_R_OK) {
2118 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2119 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2121 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2122 * @brief This API gets list of installed applications from all packages.
2124 * @par This API is for package-manager client application
2125 * @par Sync (or) Async : Synchronous API
2126 * @param[in] app_func iteration function for list
2127 * @param[in] user_data user data to be passed to callback function
2128 * @return 0 if success, error code(<0) if fail
2129 * @retval PMINFO_R_OK success
2130 * @retval PMINFO_R_EINVAL invalid argument
2131 * @retval PMINFO_R_ERROR internal error
2135 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2137 char *pkgid1 = NULL;
2138 char *pkgid2 = NULL;
2139 pkgid1 = (char *)user_data;
2140 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2141 if (strcmp(pkgid1, pkgid2) == 0) {
2148 static int list_apps()
2151 char *name = "helloworld";
2152 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2153 if (ret != PMINFO_R_OK) {
2160 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2161 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2164 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2165 * @brief This API creates the disabled application information handle from db
2167 * @par This API is for package-manager client application
2168 * @par Sync (or) Async : Synchronous API
2170 * @param[in] appid pointer to appid
2171 * @param[out] handle pointer to the application info handle.
2172 * @return 0 if success, error code(<0) if fail
2173 * @retval PMINFO_R_OK success
2174 * @retval PMINFO_R_EINVAL invalid argument
2175 * @retval PMINFO_R_ERROR internal error
2177 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2178 * @see pkgmgrinfo_appinfo_get_pkgid()
2179 * @see pkgmgrinfo_appinfo_is_multiple()
2181 static int get_disabled_app_type(const char *appid)
2185 pkgmgrinfo_appinfo_h handle;
2186 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2187 if (ret != PMINFO_R_OK)
2189 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2190 if (ret != PMINFO_R_OK) {
2191 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2194 printf("apptype: %s\n", type);
2195 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2200 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2201 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2204 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2205 * @brief This API creates the application information handle from db
2207 * @par This API is for package-manager client application
2208 * @par Sync (or) Async : Synchronous API
2210 * @param[in] appid pointer to appid
2211 * @param[out] handle pointer to the application info handle.
2212 * @return 0 if success, error code(<0) if fail
2213 * @retval PMINFO_R_OK success
2214 * @retval PMINFO_R_EINVAL invalid argument
2215 * @retval PMINFO_R_ERROR internal error
2217 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2218 * @see pkgmgrinfo_appinfo_get_pkgid()
2219 * @see pkgmgrinfo_appinfo_is_multiple()
2221 static int get_app_type(const char *appid)
2225 pkgmgrinfo_appinfo_h handle;
2226 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2227 if (ret != PMINFO_R_OK)
2229 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2230 if (ret != PMINFO_R_OK) {
2231 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2234 printf("apptype: %s\n", type);
2235 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2240 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2241 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2244 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2245 * @brief This API gets the application ID
2247 * @par This API is for package-manager client application
2248 * @par Sync (or) Async : Synchronous API
2250 * @param[in] handle pointer to the application info handle.
2251 * @param[out] appid pointer to hold appid
2252 * @return 0 if success, error code(<0) if fail
2253 * @retval PMINFO_R_OK success
2254 * @retval PMINFO_R_EINVAL invalid argument
2255 * @retval PMINFO_R_ERROR internal error
2256 * @pre pkgmgrinfo_appinfo_get_appinfo()
2257 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2258 * @see pkgmgrinfo_appinfo_get_pkgid()
2259 * @see pkgmgrinfo_appinfo_is_multiple()
2261 static int get_app_id(const char *appid)
2264 char *app_id = NULL;
2265 pkgmgrinfo_appinfo_h handle;
2266 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2267 if (ret != PMINFO_R_OK)
2269 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2270 if (ret != PMINFO_R_OK) {
2271 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2274 printf("app id: %s\n", app_id);
2275 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2280 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2283 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2284 * @brief This API gets the package name of the application
2286 * @par This API is for package-manager client application
2287 * @par Sync (or) Async : Synchronous API
2289 * @param[in] handle pointer to the application info handle.
2290 * @param[out] pkg_name pointer to hold package name
2291 * @return 0 if success, error code(<0) if fail
2292 * @retval PMINFO_R_OK success
2293 * @retval PMINFO_R_EINVAL invalid argument
2294 * @retval PMINFO_R_ERROR internal error
2295 * @pre pkgmgrinfo_appinfo_get_appinfo()
2296 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2297 * @see pkgmgrinfo_appinfo_get_appid()
2298 * @see pkgmgrinfo_appinfo_is_multiple()
2300 static int get_app_pkgname(const char *appid)
2303 char *pkgname = NULL;
2304 pkgmgrinfo_appinfo_h handle;
2305 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2306 if (ret != PMINFO_R_OK)
2308 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2309 if (ret != PMINFO_R_OK) {
2310 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2313 printf("pkg name: %s\n", pkgname);
2314 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2319 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2322 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2323 * @brief This API gets the package id of the application
2325 * @par This API is for package-manager client application
2326 * @par Sync (or) Async : Synchronous API
2328 * @param[in] handle pointer to the application info handle.
2329 * @param[out] pkgid pointer to hold package id
2330 * @return 0 if success, error code(<0) if fail
2331 * @retval PMINFO_R_OK success
2332 * @retval PMINFO_R_EINVAL invalid argument
2333 * @retval PMINFO_R_ERROR internal error
2334 * @pre pkgmgrinfo_appinfo_get_appinfo()
2335 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2336 * @see pkgmgrinfo_appinfo_get_appid()
2337 * @see pkgmgrinfo_appinfo_is_multiple()
2339 static int get_app_pkgid(const char *appid)
2343 pkgmgrinfo_appinfo_h handle;
2344 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2345 if (ret != PMINFO_R_OK)
2347 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2348 if (ret != PMINFO_R_OK) {
2349 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2352 printf("pkg id: %s\n", pkgid);
2353 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2358 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2361 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2362 * @brief This API gets the package type of the application
2364 * @par This API is for package-manager client application
2365 * @par Sync (or) Async : Synchronous API
2367 * @param[in] handle pointer to the application info handle.
2368 * @param[out] pkgtype pointer to hold package type
2369 * @return 0 if success, error code(<0) if fail
2370 * @retval PMINFO_R_OK success
2371 * @retval PMINFO_R_EINVAL invalid argument
2372 * @retval PMINFO_R_ERROR internal error
2373 * @pre pkgmgrinfo_appinfo_get_appinfo()
2374 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2375 * @see pkgmgrinfo_appinfo_get_appid()
2376 * @see pkgmgrinfo_appinfo_is_multiple()
2378 static int get_app_pkgtype(const char *appid)
2381 char *pkgtype = NULL;
2382 pkgmgrinfo_appinfo_h handle = NULL;
2383 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2384 if (ret != PMINFO_R_OK)
2386 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2387 if (ret != PMINFO_R_OK) {
2388 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2391 printf("pkgtype: %s\n", pkgtype);
2392 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2397 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2400 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2401 * @brief This API gets the executable name of the application
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] exec pointer to hold app exec name
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_appid()
2415 * @see pkgmgrinfo_appinfo_is_multiple()
2417 static int get_app_exec(const char *appid)
2421 pkgmgrinfo_appinfo_h handle;
2422 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2423 if (ret != PMINFO_R_OK)
2425 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2426 if (ret != PMINFO_R_OK) {
2427 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2430 printf("exec name: %s\n", exec);
2431 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2436 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2439 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2440 * @brief This API gets the icon 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] icon pointer to hold app icon 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_icon(const char *appid)
2460 pkgmgrinfo_appinfo_h handle;
2461 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2462 if (ret != PMINFO_R_OK)
2464 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2465 if (ret != PMINFO_R_OK) {
2466 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2469 printf("icon name: %s\n", icon);
2470 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2475 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2478 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2479 * @brief This API gets the label 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] label pointer to hold app label
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_label(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_label(handle, &label);
2504 if (ret != PMINFO_R_OK) {
2505 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2508 printf("label : %s\n", label);
2509 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2514 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2517 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2518 * @brief This API gets exactly matched label by given appid and locale
2520 * @par This API is for package-manager client application
2521 * @par Sync (or) Async : Synchronous API
2523 * @param[in] appid pointer to appid
2524 * @param[in] locale pointer to locale
2525 * @param[out] label pointer to hold app label
2526 * @return 0 if success, error code(<0) if fail
2527 * @retval PMINFO_R_OK success
2528 * @retval PMINFO_R_EINVAL invalid argument
2529 * @retval PMINFO_R_ERROR internal error
2531 static int get_localed_label(const char *appid, const char *locale)
2536 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2537 if (ret != PMINFO_R_OK)
2540 printf("localed label: %s\n", label);
2548 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2549 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2552 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2553 * @brief This API gets the component of the application
2555 * @par This API is for package-manager client application
2556 * @par Sync (or) Async : Synchronous API
2558 * @param[in] handle pointer to the application info handle.
2559 * @param[out] component pointer to hold app component
2560 * @return 0 if success, error code(<0) if fail
2561 * @retval PMINFO_R_OK success
2562 * @retval PMINFO_R_EINVAL invalid argument
2563 * @retval PMINFO_R_ERROR internal error
2564 * @pre pkgmgrinfo_appinfo_get_appinfo()
2565 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2566 * @see pkgmgrinfo_appinfo_get_appid()
2567 * @see pkgmgrinfo_appinfo_is_multiple()
2569 static int get_app_component(const char *appid)
2572 pkgmgrinfo_app_component component;
2573 pkgmgrinfo_appinfo_h handle;
2574 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2575 if (ret != PMINFO_R_OK)
2577 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2578 if (ret != PMINFO_R_OK) {
2579 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2582 printf("component : %s\n", component);
2583 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2588 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2591 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2592 * @brief This API gets the apptype of the application
2594 * @par This API is for package-manager client application
2595 * @par Sync (or) Async : Synchronous API
2597 * @param[in] handle pointer to the application info handle.
2598 * @param[out] app_type pointer to hold apptype
2599 * @return 0 if success, error code(<0) if fail
2600 * @retval PMINFO_R_OK success
2601 * @retval PMINFO_R_EINVAL invalid argument
2602 * @retval PMINFO_R_ERROR internal error
2603 * @pre pkgmgrinfo_appinfo_get_appinfo()
2604 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2605 * @see pkgmgrinfo_appinfo_get_appid()
2606 * @see pkgmgrinfo_appinfo_is_multiple()
2608 static int get_app_type(const char *appid)
2611 char *apptype = NULL;
2612 pkgmgrinfo_appinfo_h handle;
2613 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2614 if (ret != PMINFO_R_OK)
2616 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2617 if (ret != PMINFO_R_OK) {
2618 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2621 printf("apptype : %s\n", apptype);
2622 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2627 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2630 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2631 int *operation_count, char ***operation)
2632 * @brief This API gets the list of operation of the application
2634 * @par This API is for package-manager client application
2635 * @par Sync (or) Async : Synchronous API
2637 * @param[in] handle pointer to the appcontrol handle.
2638 * @param[out] operation_count pointer to hold number of operations
2639 * @param[out] operation pointer to hold list of operations
2640 * @return 0 if success, error code(<0) if fail
2641 * @retval PMINFO_R_OK success
2642 * @retval PMINFO_R_EINVAL invalid argument
2643 * @retval PMINFO_R_ERROR internal error
2644 * @pre pkgmgrinfo_appinfo_get_appinfo()
2645 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2646 * @see pkgmgrinfo_appinfo_get_uri()
2647 * @see pkgmgrinfo_appinfo_get_mime()
2649 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2654 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2655 for (i = 0; i < oc; i++) {
2656 if (strcmp(operation[i], (char *)user_data) == 0)
2663 static int check_operation(const char *appid, char *operation)
2666 pkgmgrinfo_appinfo_h handle;
2667 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2668 if (ret != PMINFO_R_OK)
2670 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2671 if (ret != PMINFO_R_OK) {
2672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2675 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2680 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2681 int *operation_count, char ***operation);
2684 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2685 int *uri_count, char ***uri)
2686 * @brief This API gets the list of uri of the application
2688 * @par This API is for package-manager client application
2689 * @par Sync (or) Async : Synchronous API
2691 * @param[in] handle pointer to the appcontrol handle.
2692 * @param[out] uri_count pointer to hold number of uris
2693 * @param[out] uri pointer to hold list of uris
2694 * @return 0 if success, error code(<0) if fail
2695 * @retval PMINFO_R_OK success
2696 * @retval PMINFO_R_EINVAL invalid argument
2697 * @retval PMINFO_R_ERROR internal error
2698 * @pre pkgmgrinfo_appinfo_get_appinfo()
2699 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2700 * @see pkgmgrinfo_appinfo_get_operation()
2701 * @see pkgmgrinfo_appinfo_get_mime()
2703 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2708 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2709 for (i = 0; i < uc; i++) {
2710 if (strcmp(uri[i], (char *)user_data) == 0)
2717 static int check_uri(const char *appid, char *uri)
2720 pkgmgrinfo_appinfo_h handle;
2721 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2722 if (ret != PMINFO_R_OK)
2724 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2725 if (ret != PMINFO_R_OK) {
2726 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2729 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2734 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2735 int *uri_count, char ***uri);
2738 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2739 int *mime_count, char ***mime)
2740 * @brief This API gets the list of mime of the application
2742 * @par This API is for package-manager client application
2743 * @par Sync (or) Async : Synchronous API
2745 * @param[in] handle pointer to the appcontrol handle.
2746 * @param[out] mime_count pointer to hold number of mimes
2747 * @param[out] mime pointer to hold list of mimes
2748 * @return 0 if success, error code(<0) if fail
2749 * @retval PMINFO_R_OK success
2750 * @retval PMINFO_R_EINVAL invalid argument
2751 * @retval PMINFO_R_ERROR internal error
2752 * @pre pkgmgrinfo_appinfo_get_appinfo()
2753 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2754 * @see pkgmgrinfo_appinfo_get_uri()
2755 * @see pkgmgrinfo_appinfo_get_operation()
2757 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2762 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2763 for (i = 0; i < mc; i++) {
2764 if (strcmp(mime[i], (char *)user_data) == 0)
2771 static int check_mime(const char *appid, char *mime)
2774 pkgmgrinfo_appinfo_h handle;
2775 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2776 if (ret != PMINFO_R_OK)
2778 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2779 if (ret != PMINFO_R_OK) {
2780 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2783 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2788 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2789 int *mime_count, char ***mime);
2792 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2793 int *subapp_count, char ***subapp)
2794 * @brief This API gets the list of subapp of the application
2796 * @par This API is for package-manager client application
2797 * @par Sync (or) Async : Synchronous API
2799 * @param[in] handle pointer to the appcontrol handle.
2800 * @param[out] subapp_count pointer to hold number of subapp
2801 * @param[out] subapp pointer to hold list of subapp
2802 * @return 0 if success, error code(<0) if fail
2803 * @retval PMINFO_R_OK success
2804 * @retval PMINFO_R_EINVAL invalid argument
2805 * @retval PMINFO_R_ERROR internal error
2806 * @pre pkgmgrinfo_appinfo_get_appinfo()
2807 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2808 * @see pkgmgrinfo_appinfo_get_uri()
2809 * @see pkgmgrinfo_appinfo_get_operation()
2811 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2815 char **subapp = NULL;
2816 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2817 for (i = 0; i < sc; i++) {
2818 if (strcmp(subapp[i], (char *)user_data) == 0)
2825 static int check_subapp(const char *appid, char *subapp)
2828 pkgmgrinfo_appinfo_h handle = NULL;
2829 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2830 if (ret != PMINFO_R_OK)
2832 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2833 if (ret != PMINFO_R_OK) {
2834 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2842 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2843 int *subapp_count, char ***subapp);
2846 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2847 * @brief This API gets the notification icon of the application
2849 * @par This API is for package-manager client application
2850 * @par Sync (or) Async : Synchronous API
2852 * @param[in] handle pointer to the application info handle.
2853 * @param[out] path pointer to hold notification icon
2854 * @return 0 if success, error code(<0) if fail
2855 * @retval PMINFO_R_OK success
2856 * @retval PMINFO_R_EINVAL invalid argument
2857 * @retval PMINFO_R_ERROR internal error
2858 * @pre pkgmgrinfo_appinfo_get_appinfo()
2859 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2860 * @see pkgmgrinfo_appinfo_get_appid()
2861 * @see pkgmgrinfo_appinfo_is_multiple()
2863 static int get_app_notification_icon(const char *appid)
2866 char *notification_icon = NULL;
2867 pkgmgrinfo_appinfo_h handle;
2868 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2869 if (ret != PMINFO_R_OK)
2871 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2872 if (ret != PMINFO_R_OK) {
2873 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2876 printf("notification icon : %s\n", notification_icon);
2877 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2882 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2885 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2886 * @brief This API gets the setting icon of the application
2888 * @par This API is for package-manager client application
2889 * @par Sync (or) Async : Synchronous API
2891 * @param[in] handle pointer to the application info handle.
2892 * @param[out] path pointer to hold setting icon
2893 * @return 0 if success, error code(<0) if fail
2894 * @retval PMINFO_R_OK success
2895 * @retval PMINFO_R_EINVAL invalid argument
2896 * @retval PMINFO_R_ERROR internal error
2897 * @pre pkgmgrinfo_appinfo_get_appinfo()
2898 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2899 * @see pkgmgrinfo_appinfo_get_appid()
2900 * @see pkgmgrinfo_appinfo_is_multiple()
2902 static int get_app_setting_icon(const char *appid)
2905 char *setting_icon = NULL;
2906 pkgmgrinfo_appinfo_h handle;
2907 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2908 if (ret != PMINFO_R_OK)
2910 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2911 if (ret != PMINFO_R_OK) {
2912 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2915 printf("setting icon : %s\n", setting_icon);
2916 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2921 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2924 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2925 * @brief This API gets the type of recent image on app-tray
2927 * @par This API is for package-manager client application
2928 * @par Sync (or) Async : Synchronous API
2930 * @param[in] handle pointer to the application info handle.
2931 * @param[out] type pointer to hold image type
2932 * @return 0 if success, error code(<0) if fail
2933 * @retval PMINFO_R_OK success
2934 * @retval PMINFO_R_EINVAL invalid argument
2935 * @retval PMINFO_R_ERROR internal error
2936 * @pre pkgmgrinfo_appinfo_get_appinfo()
2937 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2938 * @see pkgmgrinfo_appinfo_get_appid()
2939 * @see pkgmgrinfo_appinfo_is_multiple()
2941 static int get_app_recent_image_type(const char *appid)
2944 pkgmgrinfo_app_recentimage type;
2945 pkgmgrinfo_appinfo_h handle;
2946 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2947 if (ret != PMINFO_R_OK)
2949 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2950 if (ret != PMINFO_R_OK) {
2951 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2954 printf("recent image type: %d\n", type);
2955 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2960 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2964 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2965 * @brief This API gets the preview image of application
2967 * @par Sync (or) Async : Synchronous API
2969 * @param[in] handle pointer to the application info handle.
2970 * @param[out] preview_img pointer to hold preview image path
2971 * @return 0 if success, error code(<0) if fail
2972 * @retval PMINFO_R_OK success
2973 * @retval PMINFO_R_EINVAL invalid argument
2974 * @retval PMINFO_R_ERROR internal error
2975 * @pre pkgmgrinfo_appinfo_get_appinfo()
2976 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2977 * @see pkgmgrinfo_appinfo_get_appid()
2979 static int get_app_previewimage(const char *appid)
2982 char *preview = NULL;
2983 pkgmgrinfo_appinfo_h handle = NULL;
2984 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2985 if (ret != PMINFO_R_OK)
2987 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2988 if (ret != PMINFO_R_OK) {
2989 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2992 printf("preview image path : %s\n", preview);
2993 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2998 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3002 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3003 * @brief This API gets the package permission type of the application
3005 * @par This API is for package-manager client application
3006 * @par Sync (or) Async : Synchronous API
3008 * @param[in] handle pointer to the application info handle.
3009 * @param[out] permission pointer to hold package permission
3010 * @return 0 if success, error code(<0) if fail
3011 * @retval PMINFO_R_OK success
3012 * @retval PMINFO_R_EINVAL invalid argument
3013 * @retval PMINFO_R_ERROR internal error
3014 * @pre pkgmgrinfo_appinfo_get_appinfo()
3015 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3016 * @see pkgmgrinfo_appinfo_get_appid()
3018 static int get_app_permission(const char *appid)
3021 pkgmgrinfo_permission_type permission = 0;
3022 pkgmgrinfo_appinfo_h handle;
3024 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3025 if (ret != PMINFO_R_OK)
3027 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3028 if (ret != PMINFO_R_OK) {
3029 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3032 printf("permission type: %d\n", permission);
3033 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3038 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3041 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3042 * @brief This API gets the component_type
3044 * @par This API is for package-manager client application
3045 * @par Sync (or) Async : Synchronous API
3047 * @param[in] handle pointer to the application info handle.
3048 * @param[out] component_type pointer to hold component_type
3049 * @return 0 if success, error code(<0) if fail
3050 * @retval PMINFO_R_OK success
3051 * @retval PMINFO_R_EINVAL invalid argument
3052 * @retval PMINFO_R_ERROR internal error
3053 * @pre pkgmgrinfo_appinfo_get_appinfo()
3054 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3055 * @see pkgmgrinfo_appinfo_get_pkgid()
3056 * @see pkgmgrinfo_appinfo_is_multiple()
3058 static int get_component_type(const char *appid)
3061 char *component_type = NULL;
3062 pkgmgrinfo_appinfo_h handle;
3063 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3064 if (ret != PMINFO_R_OK)
3066 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3067 if (ret != PMINFO_R_OK) {
3068 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3071 printf("component_type: %s\n", component_type);
3072 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3077 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3080 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3081 * @brief This API gets the application 'hwacceleration' value from the app ID
3083 * @par This API is for package-manager client application
3084 * @par Sync (or) Async : Synchronous API
3086 * @param[in] handle pointer to application info handle
3087 * @param[out] hwacceleration pointer to hold package hwacceleration value
3088 * @return 0 if success, error code(<0) if fail
3089 * @retval PMINFO_R_OK success
3090 * @retval PMINFO_R_EINVAL invalid argument
3091 * @retval PMINFO_R_ERROR internal error
3092 * @pre pkgmgrinfo_appinfo_get_appinfo()
3093 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3094 * @see pkgmgrinfo_appinfo_get_appid()
3095 * @see pkgmgrinfo_appinfo_is_multiple()
3097 static int get_app_hwacceleration(const char *appid)
3100 pkgmgrinfo_app_hwacceleration hwacceleration;
3101 pkgmgrinfo_appinfo_h handle;
3102 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3103 if (ret != PMINFO_R_OK)
3105 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3106 if (ret != PMINFO_R_OK) {
3107 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3110 printf("app hwacceleration: %d\n", hwacceleration);
3111 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3116 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3119 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3120 * @brief This API gets the application 'screenreader' value from the app ID
3122 * @par This API is for package-manager client application
3123 * @par Sync (or) Async : Synchronous API
3125 * @param[in] handle pointer to application info handle
3126 * @param[out] screenreader pointer to hold package accessibility value
3127 * @return 0 if success, error code(<0) if fail
3128 * @retval PMINFO_R_OK success
3129 * @retval PMINFO_R_EINVAL invalid argument
3130 * @retval PMINFO_R_ERROR internal error
3131 * @pre pkgmgrinfo_appinfo_get_appinfo()
3132 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3133 * @see pkgmgrinfo_appinfo_get_appid()
3134 * @see pkgmgrinfo_appinfo_is_multiple()
3136 static int get_app_screenreader(const char *appid)
3139 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3140 pkgmgrinfo_appinfo_h handle = NULL;
3141 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3142 if (ret != PMINFO_R_OK)
3144 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3145 if (ret != PMINFO_R_OK) {
3146 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3149 printf("app screenreader: %d\n", screenreader);
3150 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3155 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3158 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3159 * @brief This API gets the application's landscape & portrait effect images
3161 * @par This API is for package-manager client application
3162 * @par Sync (or) Async : Synchronous API
3164 * @param[in] handle pointer to application info handle
3165 * @param[out] portrait_img contains portrait mode effect image
3166 * @param[out] landscape_img contains landscape mode effect image
3167 * @return 0 if success, error code(<0) if fail
3168 * @retval PMINFO_R_OK success
3169 * @retval PMINFO_R_EINVAL invalid argument
3170 * @retval PMINFO_R_ERROR internal error
3171 * @pre pkgmgrinfo_appinfo_get_appinfo()
3172 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3173 * @see pkgmgrinfo_appinfo_get_appid()
3174 * @see pkgmgrinfo_appinfo_is_nodisplay()
3176 static int get_app_effectimages(const char *appid)
3179 char *portraitimg = NULL;
3180 char *landscapeimg = NULL;
3181 pkgmgrinfo_appinfo_h handle;
3182 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3183 if (ret != PMINFO_R_OK)
3185 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3186 if (ret != PMINFO_R_OK) {
3187 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3190 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3191 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3196 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3199 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3200 * @brief This API gets the application's effect image type
3202 * @par This API is for package-manager client application
3203 * @par Sync (or) Async : Synchronous API
3205 * @param[in] handle pointer to application info handle
3206 * @param[out] effectimg_type contains effect image type
3207 * @return 0 if success, error code(<0) if fail
3208 * @retval PMINFO_R_OK success
3209 * @retval PMINFO_R_EINVAL invalid argument
3210 * @retval PMINFO_R_ERROR internal error
3211 * @pre pkgmgrinfo_appinfo_get_appinfo()
3212 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3213 * @see pkgmgrinfo_appinfo_get_appid()
3214 * @see pkgmgrinfo_appinfo_is_nodisplay()
3216 static int get_app_effectimage_type(const char *appid)
3219 char *effectimg_type = NULL;
3220 pkgmgrinfo_appinfo_h handle = NULL;
3221 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3222 if (ret != PMINFO_R_OK)
3224 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3225 if (ret != PMINFO_R_OK) {
3226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3229 printf("app effect image type: %s\n", effectimg_type);
3230 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3235 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3238 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3239 * @brief This API gets the submode_mainid of the application
3241 * @par This API is for package-manager client application
3242 * @par Sync (or) Async : Synchronous API
3244 * @param[in] handle pointer to the application info handle.
3245 * @param[out] submode_mainid pointer to hold package name
3246 * @return 0 if success, error code(<0) if fail
3247 * @retval PMINFO_R_OK success
3248 * @retval PMINFO_R_EINVAL invalid argument
3249 * @retval PMINFO_R_ERROR internal error
3250 * @pre pkgmgrinfo_appinfo_get_appinfo()
3251 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3252 * @see pkgmgrinfo_appinfo_get_appid()
3253 * @see pkgmgrinfo_appinfo_is_multiple()
3255 static int get_app_submode_mainid(const char *appid)
3258 char *submode_mainid = NULL;
3259 pkgmgrinfo_appinfo_h handle = NULL;
3260 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3261 if (ret != PMINFO_R_OK)
3263 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3264 if (ret != PMINFO_R_OK) {
3265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3268 printf("submode_mainid: %s\n", submode_mainid);
3269 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3274 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3277 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3278 * @brief This API gets the datacontrol info
3280 * @par This API is for package-manager client application
3281 * @par Sync (or) Async : Synchronous API
3283 * @param[in] providerid pointer to the providerid of dataconltrol.
3284 * @param[in] type pointer to the type of dataconltrol.
3285 * @param[out] appid pointer to hold appid, need to free after using
3286 * @param[out] access pointer to hold access, need to free after using
3287 * @return 0 if success, error code(<0) if fail
3288 * @retval PMINFO_R_OK success
3289 * @retval PMINFO_R_EINVAL invalid argument
3290 * @retval PMINFO_R_ERROR internal error
3293 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3294 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3297 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3298 * @brief This API gets the appid of datacontrol
3300 * @par This API is for package-manager client application
3301 * @par Sync (or) Async : Synchronous API
3303 * @param[in] providerid pointer to the providerid of dataconltrol.
3304 * @param[out] appid pointer to hold appid, need to free after using
3305 * @return 0 if success, error code(<0) if fail
3306 * @retval PMINFO_R_OK success
3307 * @retval PMINFO_R_EINVAL invalid argument
3308 * @retval PMINFO_R_ERROR internal error
3311 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3312 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3315 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3316 * @brief This API gets the alias_appid of the application
3318 * @par This API is for package-manager client application
3319 * @par Sync (or) Async : Synchronous API
3321 * @param[in] handle pointer to the application info handle.
3322 * @param[out] alias_appid pointer to hold app alias_appid
3323 * @return 0 if success, error code(<0) if fail
3324 * @retval PMINFO_R_OK success
3325 * @retval PMINFO_R_EINVAL invalid argument
3326 * @retval PMINFO_R_ERROR internal error
3327 * @pre pkgmgrinfo_appinfo_get_appinfo()
3328 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3329 * @see pkgmgrinfo_appinfo_get_appid()
3331 static int get_alias_appid(const char *appid)
3334 char *alias_appid= 0;
3335 pkgmgrinfo_appinfo_h handle = NULL;
3336 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3337 if (ret != PMINFO_R_OK)
3339 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3340 if (ret != PMINFO_R_OK) {
3341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3344 printf("alias_appid: %s\n", alias_appid);
3345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3350 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3353 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3354 * @brief This API gets the effective_appid of the application
3356 * @par This API is for package-manager client application
3357 * @par Sync (or) Async : Synchronous API
3359 * @param[in] handle pointer to the application info handle.
3360 * @param[out] effective_appid pointer to hold app effective_appid
3361 * @return 0 if success, error code(<0) if fail
3362 * @retval PMINFO_R_OK success
3363 * @retval PMINFO_R_EINVAL invalid argument
3364 * @retval PMINFO_R_ERROR internal error
3365 * @pre pkgmgrinfo_appinfo_get_appinfo()
3366 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3367 * @see pkgmgrinfo_appinfo_get_appid()
3369 static int get_effective_appid(const char *appid)
3372 char *effective_appid= 0;
3373 pkgmgrinfo_appinfo_h handle = NULL;
3374 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3375 if (ret != PMINFO_R_OK)
3377 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3378 if (ret != PMINFO_R_OK) {
3379 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3382 printf("effective_appid: %s\n", effective_appid);
3383 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3388 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3391 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3392 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3393 * @brief This API gets the list of permission for a particular application
3395 * @par This API is for package-manager client application
3396 * @par Sync (or) Async : Synchronous API
3397 * @param[in] handle pointer to the application info handle.
3398 * @param[in] permission_func callback function for list
3399 * @param[in] user_data user data to be passed to callback function
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()
3407 int permission_func(const char *name, void *user_data)
3409 if (strcmp(name, (char *)user_data) == 0)
3415 static int list_permission(const char *appid, char *permission)
3418 pkgmgrinfo_appinfo_h handle;
3419 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3420 if (ret != PMINFO_R_OK)
3422 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3423 if (ret != PMINFO_R_OK) {
3424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3427 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3432 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3433 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3436 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3437 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3438 * @brief This API gets the list of category for a particular application
3440 * @par This API is for package-manager client application
3441 * @par Sync (or) Async : Synchronous API
3442 * @param[in] handle pointer to the application info handle.
3443 * @param[in] category_func callback function for list
3444 * @param[in] user_data user data to be passed to callback function
3445 * @return 0 if success, error code(<0) if fail
3446 * @retval PMINFO_R_OK success
3447 * @retval PMINFO_R_EINVAL invalid argument
3448 * @retval PMINFO_R_ERROR internal error
3449 * @pre pkgmgrinfo_appinfo_get_appinfo()
3450 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3452 int category_func(const char *name, void *user_data)
3454 if (strcmp(name, (char *)user_data) == 0)
3460 static int list_category(const char *appid, char *category)
3463 pkgmgrinfo_appinfo_h handle;
3464 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3465 if (ret != PMINFO_R_OK)
3467 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3468 if (ret != PMINFO_R_OK) {
3469 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3472 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3477 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3478 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3481 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3482 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3483 * @brief This API gets the list of metadata for a particular application
3485 * @par This API is for package-manager client application
3486 * @par Sync (or) Async : Synchronous API
3487 * @param[in] handle pointer to the application info handle.
3488 * @param[in] metadata_func callback function for list
3489 * @param[in] user_data user data to be passed to callback function
3490 * @return 0 if success, error code(<0) if fail
3491 * @retval PMINFO_R_OK success
3492 * @retval PMINFO_R_EINVAL invalid argument
3493 * @retval PMINFO_R_ERROR internal error
3494 * @pre pkgmgrinfo_appinfo_get_appinfo()
3495 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3497 int metadata_func(const char *key, const char *value, void *user_data)
3499 if (strcmp(key, (char *)user_data) == 0) {
3500 printf("Value is %s\n", value);
3507 static int list_metadata(const char *appid, char *key)
3510 pkgmgrinfo_appinfo_h handle;
3511 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3512 if (ret != PMINFO_R_OK)
3514 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3515 if (ret != PMINFO_R_OK) {
3516 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3519 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3524 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3525 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3529 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3530 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3531 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3532 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3533 * @brief This API gets the list of app-control for a particular application
3535 * @par This API is for package-manager client application
3536 * @par Sync (or) Async : Synchronous API
3537 * @param[in] handle pointer to the application info handle.
3538 * @param[in] appcontrol_func callback function for list
3539 * @param[in] user_data user data to be passed to callback function
3540 * @param[in] uid the addressee user id of the instruction
3541 * @return 0 if success, error code(<0) if fail
3542 * @retval PMINFO_R_OK success
3543 * @retval PMINFO_R_EINVAL invalid argument
3544 * @retval PMINFO_R_ERROR internal error
3545 * @pre pkgmgrinfo_appinfo_get_appinfo()
3546 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3548 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3553 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3554 for (i = 0; i < oc; i++) {
3555 if (strcmp(operation[i], (char *)user_data) == 0)
3562 static int check_operation(const char *appid, char *operation)
3565 pkgmgrinfo_appinfo_h handle;
3566 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3567 if (ret != PMINFO_R_OK)
3569 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3570 if (ret != PMINFO_R_OK) {
3571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3574 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3579 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3580 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3585 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3586 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3589 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3590 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3591 * @brief This API gets the list of splashscreen for a particular application
3593 * @par This API is for package-manager client application
3594 * @par Sync (or) Async : Synchronous API
3595 * @param[in] handle pointer to the application info handle.
3596 * @param[in] splash_screen_func callback function for list
3597 * @param[in] user_data user data to be passed to callback function
3598 * @return 0 if success, error code(<0) if fail
3599 * @retval PMINFO_R_OK success
3600 * @retval PMINFO_R_EINVAL invalid argument
3601 * @retval PMINFO_R_ERROR internal error
3602 * @pre pkgmgrinfo_appinfo_get_appinfo()
3603 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3606 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3607 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3610 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3611 * @brief This API gets the application 'nodisplay' value from the app ID
3613 * @par This API is for package-manager client application
3614 * @par Sync (or) Async : Synchronous API
3616 * @param[in] handle pointer to application info handle
3617 * @param[out] nodisplay pointer to hold package nodisplay value
3618 * @return 0 if success, error code(<0) if fail
3619 * @retval PMINFO_R_OK success
3620 * @retval PMINFO_R_EINVAL invalid argument
3621 * @retval PMINFO_R_ERROR internal error
3622 * @pre pkgmgrinfo_appinfo_get_appinfo()
3623 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3624 * @see pkgmgrinfo_appinfo_get_appid()
3625 * @see pkgmgrinfo_appinfo_is_multiple()
3627 static int get_app_nodisplay(const char *appid)
3631 pkgmgrinfo_appinfo_h handle;
3632 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3633 if (ret != PMINFO_R_OK)
3635 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3636 if (ret != PMINFO_R_OK) {
3637 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3640 printf("app nodisplay: %d\n", nodisplay);
3641 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3646 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3649 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3650 * @brief This API gets the application 'multiple' value from the app ID
3652 * @par This API is for package-manager client application
3653 * @par Sync (or) Async : Synchronous API
3655 * @param[in] handle pointer to application info handle
3656 * @param[out] multiple pointer to hold package multiple value
3657 * @return 0 if success, error code(<0) if fail
3658 * @retval PMINFO_R_OK success
3659 * @retval PMINFO_R_EINVAL invalid argument
3660 * @retval PMINFO_R_ERROR internal error
3661 * @pre pkgmgrinfo_appinfo_get_appinfo()
3662 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3663 * @see pkgmgrinfo_appinfo_get_appid()
3664 * @see pkgmgrinfo_appinfo_is_nodisplay()
3666 static int get_app_multiple(const char *appid)
3670 pkgmgrinfo_appinfo_h handle;
3671 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3672 if (ret != PMINFO_R_OK)
3674 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3675 if (ret != PMINFO_R_OK) {
3676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3679 printf("app multiple: %d\n", multiple);
3680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3685 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3688 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3689 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3690 * application launching effect. If fales, indicator will be hidden during application launching effect
3692 * @par This API is for package-manager client application
3693 * @par Sync (or) Async : Synchronous API
3695 * @param[in] handle pointer to application info handle
3696 * @param[out] indicator_disp contains indicator display status for application launching effect
3697 * @return 0 if success, error code(<0) if fail
3698 * @retval PMINFO_R_OK success
3699 * @retval PMINFO_R_EINVAL invalid argument
3700 * @retval PMINFO_R_ERROR internal error
3701 * @pre pkgmgrinfo_appinfo_get_appinfo()
3702 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3703 * @see pkgmgrinfo_appinfo_get_appid()
3704 * @see pkgmgrinfo_appinfo_is_nodisplay()
3706 static int get_app_indicator_display(const char *appid)
3709 bool indicator_disp;
3710 pkgmgrinfo_appinfo_h handle;
3711 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3712 if (ret != PMINFO_R_OK)
3714 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3715 if (ret != PMINFO_R_OK){
3716 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3719 printf("app indicator disp : %d\n", indicator_disp);
3720 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3725 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3728 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3729 * @brief This API gets the application 'taskmanage' value from the app ID
3731 * @par This API is for package-manager client application
3732 * @par Sync (or) Async : Synchronous API
3734 * @param[in] handle pointer to application info handle
3735 * @param[out] taskmanage pointer to hold package taskmanage value
3736 * @return 0 if success, error code(<0) if fail
3737 * @retval PMINFO_R_OK success
3738 * @retval PMINFO_R_EINVAL invalid argument
3739 * @retval PMINFO_R_ERROR internal error
3740 * @pre pkgmgrinfo_appinfo_get_appinfo()
3741 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3742 * @see pkgmgrinfo_appinfo_get_appid()
3743 * @see pkgmgrinfo_appinfo_is_multiple()
3745 static int get_app_taskmanage(const char *appid)
3749 pkgmgrinfo_appinfo_h handle;
3750 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3751 if (ret != PMINFO_R_OK)
3753 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3754 if (ret != PMINFO_R_OK) {
3755 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3758 printf("app taskmanage: %d\n", taskmanage);
3759 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3764 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3767 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3768 * @brief This API gets the application 'taskmanage' value from the app ID
3770 * @par This API is for package-manager client application
3771 * @par Sync (or) Async : Synchronous API
3773 * @param[in] handle pointer to application info handle
3774 * @param[out] enabled pointer to hold package enabled value
3775 * @return 0 if success, error code(<0) if fail
3776 * @retval PMINFO_R_OK success
3777 * @retval PMINFO_R_EINVAL invalid argument
3778 * @retval PMINFO_R_ERROR internal error
3779 * @pre pkgmgrinfo_appinfo_get_appinfo()
3780 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3781 * @see pkgmgrinfo_appinfo_get_appid()
3782 * @see pkgmgrinfo_appinfo_is_multiple()
3784 static int get_app_enabled(const char *appid)
3788 pkgmgrinfo_appinfo_h handle;
3789 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3790 if (ret != PMINFO_R_OK)
3792 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3793 if (ret != PMINFO_R_OK) {
3794 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3797 printf("app enabled: %d\n", enabled);
3798 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3803 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3806 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3807 * @brief This API gets the application 'onboot' value from the app ID
3809 * @par This API is for package-manager client application
3810 * @par Sync (or) Async : Synchronous API
3812 * @param[in] handle pointer to application info handle
3813 * @param[out] onboot pointer to hold package onboot value
3814 * @return 0 if success, error code(<0) if fail
3815 * @retval PMINFO_R_OK success
3816 * @retval PMINFO_R_EINVAL invalid argument
3817 * @retval PMINFO_R_ERROR internal error
3818 * @pre pkgmgrinfo_appinfo_get_appinfo()
3819 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3820 * @see pkgmgrinfo_appinfo_get_appid()
3821 * @see pkgmgrinfo_appinfo_is_multiple()
3823 static int get_app_onboot(const char *appid)
3827 pkgmgrinfo_appinfo_h handle;
3828 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3829 if (ret != PMINFO_R_OK)
3831 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3832 if (ret != PMINFO_R_OK) {
3833 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3836 printf("app onboot: %d\n", onboot);
3837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3842 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3845 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3846 * @brief This API gets the application 'autorestart' value from the app ID
3848 * @par This API is for package-manager client application
3849 * @par Sync (or) Async : Synchronous API
3851 * @param[in] handle pointer to application info handle
3852 * @param[out] autorestart pointer to hold package autorestart value
3853 * @return 0 if success, error code(<0) if fail
3854 * @retval PMINFO_R_OK success
3855 * @retval PMINFO_R_EINVAL invalid argument
3856 * @retval PMINFO_R_ERROR internal error
3857 * @pre pkgmgrinfo_appinfo_get_appinfo()
3858 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3859 * @see pkgmgrinfo_appinfo_get_appid()
3860 * @see pkgmgrinfo_appinfo_is_multiple()
3862 static int get_app_autorestart(const char *appid)
3866 pkgmgrinfo_appinfo_h handle;
3867 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3868 if (ret != PMINFO_R_OK)
3870 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3871 if (ret != PMINFO_R_OK) {
3872 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3875 printf("app autorestart: %d\n", autorestart);
3876 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3881 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3884 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3885 * @brief This API gets the value for given application is main app or not from handle
3887 * @par This API is for package-manager client application
3888 * @par Sync (or) Async : Synchronous API
3890 * @param[in] handle pointer to application info handle
3891 * @param[out] mainapp pointer to hold package mainapp is or not
3892 * @return 0 if success, error code(<0) if fail
3893 * @retval PMINFO_R_OK success
3894 * @retval PMINFO_R_EINVAL invalid argument
3895 * @retval PMINFO_R_ERROR internal error
3896 * @pre pkgmgrinfo_appinfo_get_appinfo()
3897 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3898 * @see pkgmgrinfo_appinfo_get_appid()
3899 * @see pkgmgrinfo_appinfo_is_multiple()
3901 static int get_app_mainapp(const char *appid)
3905 pkgmgrinfo_appinfo_h handle;
3906 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3907 if (ret != PMINFO_R_OK)
3909 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3910 if (ret != PMINFO_R_OK) {
3911 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3914 printf("mainapp: %d\n", mainapp);
3915 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3920 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3924 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3925 * @brief This API gets the value for given application is preload or not from handle
3927 * @par This API is for package-manager client application
3928 * @par Sync (or) Async : Synchronous API
3930 * @param[in] handle pointer to application info handle
3931 * @param[out] preload pointer to hold preload is or not
3932 * @return 0 if success, error code(<0) if fail
3933 * @retval PMINFO_R_OK success
3934 * @retval PMINFO_R_EINVAL invalid argument
3935 * @retval PMINFO_R_ERROR internal error
3936 * @pre pkgmgrinfo_appinfo_get_appinfo()
3937 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3938 * @see pkgmgrinfo_appinfo_get_appid()
3939 * @see pkgmgrinfo_appinfo_is_multiple()
3941 static int get_app_preload(const char *appid)
3945 pkgmgrinfo_appinfo_h handle = NULL;
3946 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3947 if (ret != PMINFO_R_OK)
3949 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3950 if (ret != PMINFO_R_OK) {
3951 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3954 printf("preload: %d\n", preload);
3955 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3960 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3963 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3964 * @brief This API gets the value for given application is submode or not from handle
3966 * @par This API is for package-manager client application
3967 * @par Sync (or) Async : Synchronous API
3969 * @param[in] handle pointer to application info handle
3970 * @param[out] submode pointer to hold submode is or not
3971 * @return 0 if success, error code(<0) if fail
3972 * @retval PMINFO_R_OK success
3973 * @retval PMINFO_R_EINVAL invalid argument
3974 * @retval PMINFO_R_ERROR internal error
3975 * @pre pkgmgrinfo_appinfo_get_appinfo()
3976 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3977 * @see pkgmgrinfo_appinfo_get_appid()
3978 * @see pkgmgrinfo_appinfo_is_multiple()
3980 static int get_app_submode(const char *appid)
3984 pkgmgrinfo_appinfo_h handle = NULL;
3985 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3986 if (ret != PMINFO_R_OK)
3988 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3989 if (ret != PMINFO_R_OK) {
3990 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3993 printf("submode: %d\n", submode);
3994 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3999 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4002 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4003 * @brief This API gets the value for given application is process_pool or not from handle
4005 * @par This API is for package-manager client application
4006 * @par Sync (or) Async : Synchronous API
4008 * @param[in] handle pointer to application info handle
4009 * @param[out] process_pool pointer to hold process_pool is or not
4010 * @return 0 if success, error code(<0) if fail
4011 * @retval PMINFO_R_OK success
4012 * @retval PMINFO_R_EINVAL invalid argument
4013 * @retval PMINFO_R_ERROR internal error
4014 * @pre pkgmgrinfo_appinfo_get_appinfo()
4015 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4016 * @see pkgmgrinfo_appinfo_get_appid()
4018 static int get_app_process_pool(const char *appid)
4021 bool process_pool = 0;
4022 pkgmgrinfo_appinfo_h handle = NULL;
4023 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4024 if (ret != PMINFO_R_OK)
4026 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4027 if (ret != PMINFO_R_OK) {
4028 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4031 printf("process_pool: %d\n", process_pool);
4032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4037 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4040 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4041 * @brief This API gets the installed storage location of the application
4043 * @par This API is for package-manager client application
4044 * @par Sync (or) Async : Synchronous API
4046 * @param[in] handle pointer to the application info handle.
4047 * @param[out] app_type pointer to hold installed storage location
4048 * @return 0 if success, error code(<0) if fail
4049 * @retval PMINFO_R_OK success
4050 * @retval PMINFO_R_EINVAL invalid argument
4051 * @retval PMINFO_R_ERROR internal error
4052 * @pre pkgmgrinfo_appinfo_get_appinfo()
4053 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4054 * @see pkgmgrinfo_appinfo_get_appid()
4056 static int get_app_installed_location(const char *appid)
4059 pkgmgrinfo_installed_storage storage;
4060 pkgmgrinfo_appinfo_h handle = NULL;
4061 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4062 if (ret != PMINFO_R_OK)
4064 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4065 if (ret != PMINFO_R_OK) {
4066 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4069 printf("Installed storage location : %d\n", storage);
4070 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4075 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4079 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4080 * @brief This API checks if the application has the given category
4082 * @par This API is for package-manager client application
4083 * @par Sync (or) Async : Synchronous API
4085 * @param[in] handle pointer to the application info handle
4086 * @param[in] category category
4087 * @param[out] exist value Gets whether the application has the given category
4088 * @return 0 if success, error code(<0) if fail
4089 * @retval PMINFO_R_OK success
4090 * @retval PMINFO_R_EINVAL invalid argument
4091 * @retval PMINFO_R_ERROR internal error
4093 static int is_category_exist(const char *appid, const char *category)
4096 pkgmgrinfo_appinfo_h handle;
4099 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4100 if (ret != PMINFO_R_OK)
4103 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4104 if (ret != PMINFO_R_OK) {
4105 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4109 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4114 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4117 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4118 * @brief This API gets the application 'ui_gadget' value from the app ID
4120 * @par This API is for package-manager client application
4121 * @par Sync (or) Async : Synchronous API
4123 * @param[in] handle pointer to application info handle
4124 * @param[out] ui_gadget pointer to hold package ui_gadget value
4125 * @return 0 if success, error code(<0) if fail
4126 * @retval PMINFO_R_OK success
4127 * @retval PMINFO_R_EINVAL invalid argument
4128 * @pre pkgmgrinfo_appinfo_get_appinfo()
4129 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4131 static int get_app_ui_gadget(const char *appid)
4135 pkgmgrinfo_appinfo_h handle = NULL;
4136 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4137 if (ret != PMINFO_R_OK)
4139 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4140 if (ret != PMINFO_R_OK) {
4141 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4144 printf("app ui_gadget: %d\n", ui_gadget);
4145 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4150 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4153 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4154 * @brief This API gets the application 'support_disable' value from the app ID
4156 * @par This API is for package-manager client application
4157 * @par Sync (or) Async : Synchronous API
4159 * @param[in] handle pointer to application info handle
4160 * @param[out] support_disable pointer to hold package support_disable value
4161 * @return 0 if success, error code(<0) if fail
4162 * @retval PMINFO_R_OK success
4163 * @retval PMINFO_R_EINVAL invalid argument
4164 * @pre pkgmgrinfo_appinfo_get_appinfo()
4165 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4167 static int get_app_support_disable(const char *appid)
4170 bool support_disable;
4171 pkgmgrinfo_appinfo_h handle = NULL;
4172 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4173 if (ret != PMINFO_R_OK)
4175 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4176 if (ret != PMINFO_R_OK) {
4177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4180 printf("app support_disable: %d\n", support_disable);
4181 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4186 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4189 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4190 * @brief This API destroys the application information handle freeing up all the resources
4192 * @par This API is for package-manager client application
4193 * @par Sync (or) Async : Synchronous API
4195 * @param[in] handle pointer to the application info handle.
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()
4202 * @see pkgmgrinfo_appinfo_get_pkgid()
4203 * @see pkgmgrinfo_appinfo_is_multiple()
4205 static int get_app_type(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_get_apptype(handle, &type);
4214 if (ret != PMINFO_R_OK) {
4215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4218 printf("apptype: %s\n", type);
4219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4224 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4227 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4228 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4229 The query will search the entire application information collected from the manifest file of all the installed packages
4231 * @par This API is for package-manager client application
4232 * @par Sync (or) Async : Synchronous API
4234 * @param[out] handle pointer to the application info filter handle.
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
4240 * @post pkgmgrinfo_appinfo_filter_destroy()
4241 * @see pkgmgrinfo_appinfo_filter_count()
4242 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4244 static int get_capp_count()
4248 pkgmgrinfo_appinfo_filter_h handle;
4249 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4250 if (ret != PMINFO_R_OK)
4252 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4253 if (ret != PMINFO_R_OK) {
4254 pkgmgrinfo_appinfo_filter_destroy(handle);
4257 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4258 if (ret != PMINFO_R_OK) {
4259 pkgmgrinfo_appinfo_filter_destroy(handle);
4262 printf("No of capp: %d\n", count);
4263 pkgmgrinfo_appinfo_filter_destroy(handle);
4268 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4271 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4272 * @brief This API destroys the application information filter handle freeing up all the resources
4274 * @par This API is for package-manager client application
4275 * @par Sync (or) Async : Synchronous API
4277 * @param[in] handle pointer to the application info filter handle.
4278 * @return 0 if success, error code(<0) if fail
4279 * @retval PMINFO_R_OK success
4280 * @retval PMINFO_R_EINVAL invalid argument
4281 * @retval PMINFO_R_ERROR internal error
4282 * @pre pkgmgrinfo_appinfo_filter_create()
4284 * @see pkgmgrinfo_appinfo_filter_count()
4285 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4287 static int get_capp_count()
4291 pkgmgrinfo_appinfo_filter_h handle;
4292 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4293 if (ret != PMINFO_R_OK)
4295 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4296 if (ret != PMINFO_R_OK) {
4297 pkgmgrinfo_appinfo_filter_destroy(handle);
4300 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4301 if (ret != PMINFO_R_OK) {
4302 pkgmgrinfo_appinfo_filter_destroy(handle);
4305 printf("No of capp: %d\n", count);
4306 pkgmgrinfo_appinfo_filter_destroy(handle);
4311 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4314 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4315 * @brief This API adds a boolean filter property to the filter handle
4317 * @par This API is for package-manager client application
4318 * @par Sync (or) Async : Synchronous API
4320 * @param[in] handle pointer to the application info filter handle.
4321 * @param[in] property boolean property name.
4322 * @param[in] value value corresponding to the property.
4323 * @return 0 if success, error code(<0) if fail
4324 * @retval PMINFO_R_OK success
4325 * @retval PMINFO_R_EINVAL invalid argument
4326 * @retval PMINFO_R_ERROR internal error
4327 * @pre pkgmgrinfo_appinfo_filter_create()
4328 * @post pkgmgrinfo_appinfo_filter_destroy()
4329 * @see pkgmgrinfo_appinfo_filter_count()
4330 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4332 static int get_taskmanageable_app_count()
4336 pkgmgrinfo_appinfo_filter_h handle;
4337 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4338 if (ret != PMINFO_R_OK)
4340 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4341 if (ret != PMINFO_R_OK) {
4342 pkgmgrinfo_appinfo_filter_destroy(handle);
4345 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4346 if (ret != PMINFO_R_OK) {
4347 pkgmgrinfo_appinfo_filter_destroy(handle);
4350 printf("No of taskmanageable apps: %d\n", count);
4351 pkgmgrinfo_appinfo_filter_destroy(handle);
4356 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4357 const char *property, const bool value);
4360 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4361 * @brief This API adds an integer filter property to the filter handle
4363 * @par This API is for package-manager client application
4364 * @par Sync (or) Async : Synchronous API
4366 * @param[in] handle pointer to the application info filter handle.
4367 * @param[in] property integer property name.
4368 * @param[in] value value corresponding to the property.
4369 * @return 0 if success, error code(<0) if fail
4370 * @retval PMINFO_R_OK success
4371 * @retval PMINFO_R_EINVAL invalid argument
4372 * @retval PMINFO_R_ERROR internal error
4373 * @pre pkgmgrinfo_appinfo_filter_create()
4374 * @post pkgmgrinfo_appinfo_filter_destroy()
4375 * @see pkgmgrinfo_appinfo_filter_count()
4376 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4378 static int get_taskmanageable_app_count()
4382 pkgmgrinfo_appinfo_filter_h handle;
4383 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4384 if (ret != PMINFO_R_OK)
4386 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4387 if (ret != PMINFO_R_OK) {
4388 pkgmgrinfo_appinfo_filter_destroy(handle);
4391 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4392 if (ret != PMINFO_R_OK) {
4393 pkgmgrinfo_appinfo_filter_destroy(handle);
4396 printf("No of apps: %d\n", count);
4397 pkgmgrinfo_appinfo_filter_destroy(handle);
4402 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4403 const char *property, const int value);
4406 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4407 * @brief This API adds a string filter property to the filter handle
4409 * @par This API is for package-manager client application
4410 * @par Sync (or) Async : Synchronous API
4412 * @param[in] handle pointer to the application info filter handle.
4413 * @param[in] property string property name.
4414 * @param[in] value value corresponding to the property.
4415 * @return 0 if success, error code(<0) if fail
4416 * @retval PMINFO_R_OK success
4417 * @retval PMINFO_R_EINVAL invalid argument
4418 * @retval PMINFO_R_ERROR internal error
4419 * @pre pkgmgrinfo_appinfo_filter_create()
4420 * @post pkgmgrinfo_appinfo_filter_destroy()
4421 * @see pkgmgrinfo_appinfo_filter_count()
4422 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4424 static int get_capp_count()
4428 pkgmgrinfo_appinfo_filter_h handle;
4429 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4430 if (ret != PMINFO_R_OK)
4432 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4433 if (ret != PMINFO_R_OK) {
4434 pkgmgrinfo_appinfo_filter_destroy(handle);
4437 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4438 if (ret != PMINFO_R_OK) {
4439 pkgmgrinfo_appinfo_filter_destroy(handle);
4442 printf("No of capp: %d\n", count);
4443 pkgmgrinfo_appinfo_filter_destroy(handle);
4448 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4449 const char *property, const char *value);
4452 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4453 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4455 * @par This API is for package-manager client application
4456 * @par Sync (or) Async : Synchronous API
4458 * @param[in] handle pointer to the application info filter handle.
4459 * @param[in] app_cb callback function.
4460 * @param[in] user_data user data to be passed to the callback function
4461 * @return 0 if success, error code(<0) if fail
4462 * @retval PMINFO_R_OK success
4463 * @retval PMINFO_R_EINVAL invalid argument
4464 * @retval PMINFO_R_ERROR internal error
4465 * @pre pkgmgrinfo_appinfo_filter_create()
4466 * @post pkgmgrinfo_appinfo_filter_destroy()
4467 * @see pkgmgrinfo_appinfo_filter_count()
4469 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4472 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4473 printf("appid : %s\n", appid);
4477 static int get_capp_list()
4480 pkgmgrinfo_appinfo_filter_h handle;
4481 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4482 if (ret != PMINFO_R_OK)
4484 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4485 if (ret != PMINFO_R_OK) {
4486 pkgmgrinfo_appinfo_filter_destroy(handle);
4489 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4490 if (ret != PMINFO_R_OK) {
4491 pkgmgrinfo_appinfo_filter_destroy(handle);
4494 pkgmgrinfo_appinfo_filter_destroy(handle);
4499 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4500 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4501 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4502 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4505 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4506 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4507 * @brief This API counts the application that satisfy the filter conditions
4509 * @par This API is for package-manager client application
4510 * @par Sync (or) Async : Synchronous API
4512 * @param[in] handle pointer to the application info filter handle.
4513 * @param[in] count pointer to store count value
4514 * @param[in] uid the addressee user id of the instruction
4515 * @return 0 if success, error code(<0) if fail
4516 * @retval PMINFO_R_OK success
4517 * @retval PMINFO_R_EINVAL invalid argument
4518 * @retval PMINFO_R_ERROR internal error
4519 * @pre pkgmgrinfo_appinfo_filter_create()
4520 * @post pkgmgrinfo_appinfo_filter_destroy()
4521 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4523 static int get_capp_count()
4527 pkgmgrinfo_appinfo_filter_h handle;
4528 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4529 if (ret != PMINFO_R_OK)
4531 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4532 if (ret != PMINFO_R_OK) {
4533 pkgmgrinfo_appinfo_filter_destroy(handle);
4536 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4537 if (ret != PMINFO_R_OK) {
4538 pkgmgrinfo_appinfo_filter_destroy(handle);
4541 printf("No of capp: %d\n", count);
4542 pkgmgrinfo_appinfo_filter_destroy(handle);
4547 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4548 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4550 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4551 * @brief This API creates the application's metadata information filter handle from db.
4553 * @par This API is for package-manager client application
4554 * @par Sync (or) Async : Synchronous API
4556 * @param[out] handle pointer to the application metadata info filter handle.
4557 * @return 0 if success, error code(<0) if fail
4558 * @retval PMINFO_R_OK success
4559 * @retval PMINFO_R_EINVAL invalid argument
4560 * @retval PMINFO_R_ERROR internal error
4562 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4563 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4565 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4568 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4569 printf("appid : %s\n", appid);
4573 static int get_app_list(const char *mkey, const char *mvalue)
4576 pkgmgrinfo_appinfo_metadata_filter_h handle;
4577 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4578 if (ret != PMINFO_R_OK)
4580 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4581 if (ret != PMINFO_R_OK) {
4582 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4585 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4586 if (ret != PMINFO_R_OK) {
4587 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4590 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4595 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4598 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4599 * @brief This API destroys the application's metadata information filter handle.
4601 * @par This API is for package-manager client application
4602 * @par Sync (or) Async : Synchronous API
4604 * @param[in] handle pointer to the application metadata info filter handle.
4605 * @return 0 if success, error code(<0) if fail
4606 * @retval PMINFO_R_OK success
4607 * @retval PMINFO_R_EINVAL invalid argument
4608 * @retval PMINFO_R_ERROR internal error
4609 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4611 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4613 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4616 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4617 printf("appid : %s\n", appid);
4621 static int get_app_list(const char *mkey, const char *mvalue)
4624 pkgmgrinfo_appinfo_metadata_filter_h handle;
4625 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4626 if (ret != PMINFO_R_OK)
4628 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4629 if (ret != PMINFO_R_OK) {
4630 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4633 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4634 if (ret != PMINFO_R_OK) {
4635 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4638 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4643 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4646 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4647 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4648 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4650 * @par This API is for package-manager client application
4651 * @par Sync (or) Async : Synchronous API
4653 * @param[in] handle pointer to the application metadata info filter handle.
4654 * @param[in] key pointer to metadata key
4655 * @param[in] value pointer to metadata 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_metadata_filter_create()
4661 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4662 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4664 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4667 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4668 printf("appid : %s\n", appid);
4672 static int get_app_list(const char *mkey, const char *mvalue)
4675 pkgmgrinfo_appinfo_metadata_filter_h handle;
4676 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4677 if (ret != PMINFO_R_OK)
4679 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4680 if (ret != PMINFO_R_OK) {
4681 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4684 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4685 if (ret != PMINFO_R_OK) {
4686 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4689 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4694 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4695 const char *key, const char *value);
4698 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4699 * @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)
4700 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4701 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4702 * negative value, no more callbacks will be called and API will return.
4704 * @par This API is for package-manager client application
4705 * @par Sync (or) Async : Synchronous API
4707 * @param[in] handle pointer to the application metadata info filter handle.
4708 * @param[in] app_cb function pointer to callback
4709 * @param[in] user_data pointer to user data
4710 * @param[in] uid the addressee user id of the instruction
4711 * @return 0 if success, error code(<0) if fail
4712 * @retval PMINFO_R_OK success
4713 * @retval PMINFO_R_EINVAL invalid argument
4714 * @retval PMINFO_R_ERROR internal error
4715 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4716 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4718 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4721 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4722 printf("appid : %s\n", appid);
4726 static int get_app_list(const char *mkey, const char *mvalue)
4729 pkgmgrinfo_appinfo_metadata_filter_h handle;
4730 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4731 if (ret != PMINFO_R_OK)
4733 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4734 if (ret != PMINFO_R_OK) {
4735 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4738 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4739 if (ret != PMINFO_R_OK) {
4740 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4743 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4748 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4749 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4750 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4751 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4753 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4754 * @brief This API creates the package cert information handle to get data from db.
4756 * @par This API is for package-manager client application
4757 * @par Sync (or) Async : Synchronous API
4759 * @param[out] handle pointer to the package cert handle.
4760 * @return 0 if success, error code(<0) if fail
4761 * @retval PMINFO_R_OK success
4762 * @retval PMINFO_R_EINVAL invalid argument
4763 * @retval PMINFO_R_ERROR internal error
4765 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4766 * @see pkgmgrinfo_pkginfo_get_cert_value()
4767 * @see pkgmgrinfo_pkginfo_load_certinfo()
4769 static int get_cert_info(const char *pkgid)
4772 pkgmgrinfo_certinfo_h handle;
4773 char *auth_cert = NULL;
4774 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4775 if (ret != PMINFO_R_OK)
4777 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4778 if (ret != PMINFO_R_OK) {
4779 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4782 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4783 if (ret != PMINFO_R_OK) {
4784 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4787 printf("Author root certificate: %s\n", auth_root);
4788 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4793 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4796 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4797 * @brief This API loads the package cert information handle with data from db.
4799 * @par This API is for package-manager client application
4800 * @par Sync (or) Async : Synchronous API
4802 * @param[in] pkgid pointer to the package ID.
4803 * @param[in] handle pointer to the package cert handle.
4804 * @return 0 if success, error code(<0) if fail
4805 * @retval PMINFO_R_OK success
4806 * @retval PMINFO_R_EINVAL invalid argument
4807 * @retval PMINFO_R_ERROR internal error
4808 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4809 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4810 * @see pkgmgrinfo_pkginfo_get_cert_value()
4812 static int get_cert_info(const char *pkgid)
4815 pkgmgrinfo_certinfo_h handle;
4816 char *auth_cert = NULL;
4817 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4818 if (ret != PMINFO_R_OK)
4820 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4821 if (ret != PMINFO_R_OK) {
4822 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4825 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4826 if (ret != PMINFO_R_OK) {
4827 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4830 printf("Author root certificate: %s\n", auth_root);
4831 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4836 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4839 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4840 * @brief This API gets the package cert information from the handle
4842 * @par This API is for package-manager client application
4843 * @par Sync (or) Async : Synchronous API
4845 * @param[in] handle pointer to the package cert handle.
4846 * @param[in] cert_type certificate type
4847 * @param[out] cert_value pointer to hold certificate value
4848 * @return 0 if success, error code(<0) if fail
4849 * @retval PMINFO_R_OK success
4850 * @retval PMINFO_R_EINVAL invalid argument
4851 * @retval PMINFO_R_ERROR internal error
4852 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4853 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4854 * @see pkgmgrinfo_pkginfo_load_certinfo()
4856 static int get_cert_info(const char *pkgid)
4859 pkgmgrinfo_certinfo_h handle;
4860 char *auth_cert = NULL;
4861 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4862 if (ret != PMINFO_R_OK)
4864 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4865 if (ret != PMINFO_R_OK) {
4866 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4869 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4870 if (ret != PMINFO_R_OK) {
4871 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4874 printf("Author root certificate: %s\n", auth_root);
4875 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4880 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4883 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4884 * @brief This API destroys the package cert information handle freeing up all the resources
4886 * @par This API is for package-manager client application
4887 * @par Sync (or) Async : Synchronous API
4889 * @param[in] handle pointer to the package cert handle.
4890 * @return 0 if success, error code(<0) if fail
4891 * @retval PMINFO_R_OK success
4892 * @retval PMINFO_R_EINVAL invalid argument
4893 * @retval PMINFO_R_ERROR internal error
4894 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4896 * @see pkgmgrinfo_pkginfo_load_certinfo()
4898 static int get_cert_info(const char *pkgid)
4901 pkgmgrinfo_certinfo_h handle;
4902 char *auth_cert = NULL;
4903 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4904 if (ret != PMINFO_R_OK)
4906 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4907 if (ret != PMINFO_R_OK) {
4908 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4911 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4912 if (ret != PMINFO_R_OK) {
4913 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4916 printf("Author root certificate: %s\n", auth_root);
4917 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4922 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4925 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4926 * @brief This API deletes the package cert information from DB
4928 * @par This API is for package-manager client application
4929 * @par Sync (or) Async : Synchronous API
4931 * @param[in] pkgid pointer to the package ID.
4932 * @return 0 if success, error code(<0) if fail
4933 * @retval PMINFO_R_OK success
4934 * @retval PMINFO_R_EINVAL invalid argument
4935 * @retval PMINFO_R_ERROR internal error
4939 static int delete_cert_info(const char *pkgid)
4942 ret = pkgmgrinfo_delete_certinfo(pkgid);
4943 if (ret != PMINFO_R_OK)
4949 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4950 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4953 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
4954 * @brief This API creates the package cert information handle to set data in db.
4956 * @par This API is for package-manager client application
4957 * @par Sync (or) Async : Synchronous API
4959 * @param[out] handle pointer to the package cert handle.
4960 * @return 0 if success, error code(<0) if fail
4961 * @retval PMINFO_R_OK success
4962 * @retval PMINFO_R_EINVAL invalid argument
4963 * @retval PMINFO_R_ERROR internal error
4965 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4966 * @see pkgmgrinfo_set_cert_value()
4967 * @see pkgmgrinfo_save_certinfo()
4969 static int set_cert_in_db(const char *pkgid)
4972 pkgmgrinfo_instcertinfo_h handle;
4973 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4974 if (ret != PMINFO_R_OK)
4976 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4977 if (ret != PMINFO_R_OK) {
4978 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4981 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
4982 if (ret != PMINFO_R_OK) {
4983 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4986 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4991 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
4994 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
4995 * @brief This API sets the package cert information in the handle.
4997 * @par This API is for package-manager client application
4998 * @par Sync (or) Async : Synchronous API
5000 * @param[in] handle pointer to the package cert handle.
5001 * @param[in] cert_type certificate type.
5002 * @param[in] cert_value certificate value.
5003 * @return 0 if success, error code(<0) if fail
5004 * @retval PMINFO_R_OK success
5005 * @retval PMINFO_R_EINVAL invalid argument
5006 * @retval PMINFO_R_ERROR internal error
5007 * @pre pkgmgrinfo_create_certinfo_set_handle()
5008 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5009 * @see pkgmgrinfo_save_certinfo()
5011 static int set_cert_in_db(const char *pkgid)
5014 pkgmgrinfo_instcertinfo_h handle;
5015 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5016 if (ret != PMINFO_R_OK)
5018 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5019 if (ret != PMINFO_R_OK) {
5020 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5023 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5024 if (ret != PMINFO_R_OK) {
5025 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5028 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5033 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5036 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5037 * @brief This API saves the package cert information in the DB.
5039 * @par This API is for package-manager client application
5040 * @par Sync (or) Async : Synchronous API
5042 * @param[in] pkgid pointer to the package ID.
5043 * @param[in] handle pointer to the package cert handle.
5044 * @return 0 if success, error code(<0) if fail
5045 * @retval PMINFO_R_OK success
5046 * @retval PMINFO_R_EINVAL invalid argument
5047 * @retval PMINFO_R_ERROR internal error
5048 * @pre pkgmgrinfo_create_certinfo_set_handle()
5049 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5050 * @see pkgmgrinfo_save_certinfo()
5052 static int set_cert_in_db(const char *pkgid)
5055 pkgmgrinfo_instcertinfo_h handle;
5056 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5057 if (ret != PMINFO_R_OK)
5059 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5060 if (ret != PMINFO_R_OK) {
5061 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5064 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5065 if (ret != PMINFO_R_OK) {
5066 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5069 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5074 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5077 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5078 * @brief This API destroys the package cert information handle freeing up all the resources.
5080 * @par This API is for package-manager client application
5081 * @par Sync (or) Async : Synchronous API
5083 * @param[in] handle pointer to the package cert handle.
5084 * @return 0 if success, error code(<0) if fail
5085 * @retval PMINFO_R_OK success
5086 * @retval PMINFO_R_EINVAL invalid argument
5087 * @retval PMINFO_R_ERROR internal error
5088 * @pre pkgmgrinfo_create_certinfo_set_handle()
5090 * @see pkgmgrinfo_save_certinfo()
5092 static int set_cert_in_db(const char *pkgid)
5095 pkgmgrinfo_instcertinfo_h handle;
5096 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5097 if (ret != PMINFO_R_OK)
5099 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5100 if (ret != PMINFO_R_OK) {
5101 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5104 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5105 if (ret != PMINFO_R_OK) {
5106 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5109 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5114 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5117 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5118 * @brief This API gets the datacontrol info
5120 * @par This API is for package-manager client application
5121 * @par Sync (or) Async : Synchronous API
5123 * @param[in] providerid pointer to the providerid of dataconltrol.
5124 * @param[in] type pointer to the type of dataconltrol.
5125 * @param[out] appid pointer to hold appid, need to free after using
5126 * @param[out] access pointer to hold access, need to free after using
5127 * @return 0 if success, error code(<0) if fail
5128 * @retval PMINFO_R_OK success
5129 * @retval PMINFO_R_EINVAL invalid argument
5130 * @retval PMINFO_R_ERROR internal error
5133 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5136 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5137 * @brief This API gets the application 'guest mode visibility' value from the DB
5139 * @par This API is for package-manager client application
5140 * @par Sync (or) Async : Synchronous API
5142 * @param[in] handle pointer to application info handle
5143 * @param[out] status pointer to hold app guest mode visibility value
5144 * @return 0 if success, error code(<0) if fail
5145 * @retval PMINFO_R_OK success
5146 * @retval PMINFO_R_EINVAL invalid argument
5147 * @retval PMINFO_R_ERROR internal error
5148 * @pre pkgmgrinfo_appinfo_get_appinfo()
5149 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5150 * @see pkgmgrinfo_appinfo_get_appid()
5151 * @see pkgmgrinfo_appinfo_is_multiple()
5153 static int get_app_guestmode_visibility(const char *appid)
5157 pkgmgrinfo_appinfo_h handle;
5158 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5159 if (ret != PMINFO_R_OK)
5161 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5162 if (ret != PMINFO_R_OK) {
5163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5166 printf("app guest mode visibility: %d\n", status);
5167 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5172 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5175 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5176 * @brief This API sets the application 'guest mode visibility' value in the DB
5178 * @par This API is for package-manager client application
5179 * @par Sync (or) Async : Synchronous API
5181 * @param[in] handle pointer to application info handle
5182 * @param[out] status app guest mode visibility value
5183 * @return 0 if success, error code(<0) if fail
5184 * @retval PMINFO_R_OK success
5185 * @retval PMINFO_R_EINVAL invalid argument
5186 * @retval PMINFO_R_ERROR internal error
5187 * @pre pkgmgrinfo_appinfo_get_appinfo()
5188 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5189 * @see pkgmgrinfo_appinfo_get_appid()
5190 * @see pkgmgrinfo_appinfo_is_multiple()
5192 static int set_app_guestmode_visibility(const char *appid, bool value)
5195 pkgmgrinfo_appinfo_h handle;
5196 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5197 if (ret != PMINFO_R_OK)
5199 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5200 if (ret != PMINFO_R_OK) {
5201 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5204 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5209 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5210 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5213 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5214 * @brief This API sets the package 'installed_storage' value in db
5216 * @par This API is for package-manager client application
5217 * @par Sync (or) Async : Synchronous API
5219 * @param[in] pkgid pointer to the package ID.
5220 * @param[in] location package install location
5221 * @return 0 if success, error code(<0) if fail
5222 * @retval PMINFO_R_OK success
5223 * @retval PMINFO_R_EINVAL invalid argument
5224 * @retval PMINFO_R_ERROR internal error
5226 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5230 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5231 if (ret != PMINFO_R_OK) {
5238 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5239 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5242 * @pkgmgrinfo client API
5246 * @brief listening status type in pkgmgrinfo.
5248 #define PMINFO_CLIENT_STATUS_ALL 0x00
5249 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5250 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5251 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5252 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5253 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5254 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5257 * @brief This APIs provides pkgmgrinfo client listener
5259 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5260 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5261 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5262 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5263 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5267 * @pkgmgrinfo client API end
5275 #endif /* __PKG_INFO_H__ */