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);
1112 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1113 * @brief This API gets the root path of package
1115 * @par Sync (or) Async : Synchronous API
1117 * @param[in] handle pointer to package info handle
1118 * @param[out] path pointer to hold root path of package
1119 * @return 0 if success, error code(<0) if fail
1120 * @retval PMINFO_R_OK success
1121 * @retval PMINFO_R_EINVAL invalid argument
1122 * @retval PMINFO_R_ERROR internal error
1124 static int get_root_path(const char *pkgid)
1128 pkgmgrinfo_pkginfo_h handle;
1129 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1130 if (ret != PMINFO_R_OK)
1133 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1134 if (ret != PMINFO_R_OK) {
1135 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1138 printf("path : %s\n", path);
1139 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1145 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1149 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1150 * @brief This API gets the csc path of package
1152 * @par Sync (or) Async : Synchronous API
1154 * @param[in] handle pointer to package info handle
1155 * @param[out] path pointer to hold csc path of package
1156 * @return 0 if success, error code(<0) if fail
1157 * @retval PMINFO_R_OK success
1158 * @retval PMINFO_R_EINVAL invalid argument
1159 * @retval PMINFO_R_ERROR internal error
1161 static int get_csc_path(const char *pkgid)
1165 pkgmgrinfo_pkginfo_h handle;
1166 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1167 if (ret != PMINFO_R_OK)
1170 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1171 if (ret != PMINFO_R_OK) {
1172 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1175 printf("path : %s\n", path);
1176 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1182 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1185 * @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)
1186 * @brief This API compare the cert information from given package id
1188 * @par This API is for package-manager client application
1189 * @par Sync (or) Async : Synchronous API
1191 * @param[in] lhs_package_id pointer to first package ID
1192 * @param[in] rhs_package_id pointer to second package ID
1193 * @param[out] compare_result pointer to the compare result.
1194 * @return 0 if success, error code(<0) if fail
1195 * @retval PMINFO_R_OK success
1196 * @retval PMINFO_R_EINVAL invalid argument
1197 * @retval PMINFO_R_ERROR internal error
1199 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1200 * @see pkgmgrinfo_pkginfo_get_pkgid()
1201 * @see pkgmgrinfo_pkginfo_is_removable()
1203 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1206 pkgmgrinfo_cert_compare_result_type_e result;
1208 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1209 if (ret != PMINFO_R_OK) {
1212 printf("result: %d\n", result);
1217 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);
1218 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);
1220 * @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)
1221 * @brief This API compare the cert information from given app id
1223 * @par This API is for package-manager client application
1224 * @par Sync (or) Async : Synchronous API
1226 * @param[in] lhs_app_id pointer to first app ID
1227 * @param[in] rhs_app_id pointer to second app ID
1228 * @param[out] compare_result pointer to the compare result.
1229 * @return 0 if success, error code(<0) if fail
1230 * @retval PMINFO_R_OK success
1231 * @retval PMINFO_R_EINVAL invalid argument
1232 * @retval PMINFO_R_ERROR internal error
1234 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1235 * @see pkgmgrinfo_pkginfo_get_pkgid()
1236 * @see pkgmgrinfo_pkginfo_is_removable()
1238 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1241 pkgmgrinfo_cert_compare_result_type_e result;
1243 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1244 if (ret != PMINFO_R_OK) {
1247 printf("result: %d\n", result);
1252 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);
1253 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);
1255 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1256 * @brief This API gets the package 'removable' value from the package ID
1258 * @par This API is for package-manager client application
1259 * @par Sync (or) Async : Synchronous API
1261 * @param[in] handle pointer to package info handle
1262 * @param[out] removable pointer to hold package removable value
1263 * @return 0 if success, error code(<0) if fail
1264 * @retval PMINFO_R_OK success
1265 * @retval PMINFO_R_EINVAL invalid argument
1266 * @retval PMINFO_R_ERROR internal error
1267 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1268 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1269 * @see pkgmgrinfo_pkginfo_get_pkgid()
1270 * @see pkgmgrinfo_pkginfo_is_readonly()
1272 static int get_pkg_removable(const char *pkgid)
1276 pkgmgrinfo_pkginfo_h handle;
1277 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1278 if (ret != PMINFO_R_OK)
1280 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1281 if (ret != PMINFO_R_OK) {
1282 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1285 printf("pkg removable: %d\n", removable);
1286 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1291 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1294 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1295 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1297 * @par This API is for package-manager client application
1298 * @par Sync (or) Async : Synchronous API
1300 * @param[in] handle pointer to package info handle
1301 * @param[out] movable pointer to hold package movable state
1302 * @return 0 if success, error code(<0) if fail
1303 * @retval PMINFO_R_OK success
1304 * @retval PMINFO_R_EINVAL invalid argument
1305 * @retval PMINFO_R_ERROR internal error
1306 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1307 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1308 * @see pkgmgrinfo_pkginfo_get_pkgid()
1310 static int get_pkg_movable(const char *pkgid)
1314 pkgmgrinfo_pkginfo_h handle;
1315 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1316 if (ret != PMINFO_R_OK)
1318 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1319 if (ret != PMINFO_R_OK) {
1320 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1323 printf("pkg movable: %d\n", movable);
1324 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1329 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1332 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1333 * @brief This API gets the package 'preload' value from the package ID
1335 * @par This API is for package-manager client application
1336 * @par Sync (or) Async : Synchronous API
1338 * @param[in] handle pointer to package info handle
1339 * @param[out] preload pointer to hold package preload value
1340 * @return 0 if success, error code(<0) if fail
1341 * @retval PMINFO_R_OK success
1342 * @retval PMINFO_R_EINVAL invalid argument
1343 * @retval PMINFO_R_ERROR internal error
1344 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1345 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1346 * @see pkgmgrinfo_pkginfo_get_pkgid()
1347 * @see pkgmgrinfo_pkginfo_is_readonly()
1349 static int get_pkg_preload(const char *pkgid)
1353 pkgmgrinfo_pkginfo_h handle;
1354 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1355 if (ret != PMINFO_R_OK)
1357 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1358 if (ret != PMINFO_R_OK) {
1359 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1362 printf("pkg preload: %d\n", preload);
1363 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1368 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1371 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1372 * @brief This API gets the value for given handle is system or not
1374 * @par This API is for package-manager client application
1375 * @par Sync (or) Async : Synchronous API
1377 * @param[in] handle pointer to package info handle
1378 * @param[out] system pointer to hold system is or not
1379 * @return 0 if success, error code(<0) if fail
1380 * @retval PMINFO_R_OK success
1381 * @retval PMINFO_R_EINVAL invalid argument
1382 * @retval PMINFO_R_ERROR internal error
1383 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1384 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1385 * @see pkgmgrinfo_pkginfo_get_pkgid()
1386 * @see pkgmgrinfo_pkginfo_is_readonly()
1388 static int get_pkg_system(const char *pkgid)
1391 bool system = false;
1392 pkgmgrinfo_pkginfo_h handle = NULL;
1393 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1394 if (ret != PMINFO_R_OK)
1396 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1397 if (ret != PMINFO_R_OK) {
1398 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1401 printf("pkg system: %d\n", system);
1402 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1407 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1410 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1411 * @brief This API gets the package 'readonly' value from the package ID
1413 * @par This API is for package-manager client application
1414 * @par Sync (or) Async : Synchronous API
1416 * @param[in] handle pointer to package info handle
1417 * @param[out] readonly pointer to hold package readonly value
1418 * @return 0 if success, error code(<0) if fail
1419 * @retval PMINFO_R_OK success
1420 * @retval PMINFO_R_EINVAL invalid argument
1421 * @retval PMINFO_R_ERROR internal error
1422 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1423 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1424 * @see pkgmgrinfo_pkginfo_get_pkgid()
1425 * @see pkgmgrinfo_pkginfo_is_removable()
1427 static int get_pkg_readonly(const char *pkgid)
1431 pkgmgrinfo_pkginfo_h handle;
1432 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1433 if (ret != PMINFO_R_OK)
1435 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1436 if (ret != PMINFO_R_OK) {
1437 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1440 printf("pkg readonly: %d\n", readonly);
1441 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1446 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1450 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1451 * @brief This API gets the package 'upate' value from the package ID
1453 * @par This API is for package-manager client application
1454 * @par Sync (or) Async : Synchronous API
1456 * @param[in] handle pointer to package info handle
1457 * @param[out] update pointer to hold package update value
1458 * @return 0 if success, error code(<0) if fail
1459 * @retval PMINFO_R_OK success
1460 * @retval PMINFO_R_EINVAL invalid argument
1461 * @retval PMINFO_R_ERROR internal error
1462 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1463 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1464 * @see pkgmgrinfo_pkginfo_get_pkgid()
1466 static int get_pkg_update(const char *pkgid)
1470 pkgmgrinfo_pkginfo_h handle;
1471 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1472 if (ret != PMINFO_R_OK)
1474 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1475 if (ret != PMINFO_R_OK) {
1476 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1479 printf("pkg update: %d\n", update);
1480 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1485 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1488 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1489 * @brief This API gets the package 'support_disable' value from the package ID
1491 * @par This API is for package-manager client application
1492 * @par Sync (or) Async : Synchronous API
1494 * @param[in] handle pointer to package info handle
1495 * @param[out] support_disable pointer to hold package support_disable value
1496 * @return 0 if success, error code(<0) if fail
1497 * @retval PMINFO_R_OK success
1498 * @retval PMINFO_R_EINVAL invalid argument
1499 * @retval PMINFO_R_ERROR internal error
1500 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1501 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1502 * @see pkgmgrinfo_pkginfo_get_pkgid()
1504 static int get_pkg_support_disable(const char *pkgid)
1507 bool support_disable;
1508 pkgmgrinfo_pkginfo_h handle = NULL;
1509 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1510 if (ret != PMINFO_R_OK)
1512 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1513 if (ret != PMINFO_R_OK) {
1514 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1517 printf("pkg support_disable: %d\n", support_disable);
1518 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1523 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1526 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1527 * @brief This API gets whethere the given package is global package or user package
1529 * @par This API is for package-manager client application
1530 * @par Sync (or) Async : Synchronous API
1532 * @param[in] handle pointer to package info handle
1533 * @param[in] global pointer to hold package global value
1534 * @return 0 if success, error code(<0) if fail
1535 * @retval PMINFO_R_OK success
1536 * @retval PMINFO_R_EINVAL invalid argument
1537 * @retval PMINFO_R_ERROR internal error
1538 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1539 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1540 * @see pkgmgrinfo_pkginfo_get_pkgid()
1541 static int get_pkg_support_disable(const char *pkgid)
1545 pkgmgrinfo_pkginfo_h handle = NULL;
1546 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1547 if (ret != PMINFO_R_OK)
1549 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1550 if (ret != PMINFO_R_OK) {
1551 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1554 printf("pkg is_global: %d\n", global);
1555 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1560 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1563 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1564 * @brief This API gets the package 'accessible' value from the package ID
1566 * @par This API is for package-manager client application
1567 * @par Sync (or) Async : Synchronous API
1569 * @param[in] handle pointer to package info handle
1570 * @param[out] accessible pointer to hold package accessible value
1571 * @return 0 if success, error code(<0) if fail
1572 * @retval PMINFO_R_OK success
1573 * @retval PMINFO_R_EINVAL invalid argument
1574 * @retval PMINFO_R_ERROR internal error
1575 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1576 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1577 * @see pkgmgrinfo_pkginfo_get_pkgid()
1578 * @see pkgmgrinfo_pkginfo_is_readonly()
1580 static int get_pkg_accessible(const char *pkgid)
1584 pkgmgrinfo_pkginfo_h handle;
1585 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1586 if (ret != PMINFO_R_OK)
1588 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1589 if (ret != PMINFO_R_OK) {
1590 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1593 printf("pkg accessible: %d\n", accessible);
1594 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1599 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1602 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1603 * @brief This API destroys the package information handle freeing up all the resources
1605 * @par This API is for package-manager client application
1606 * @par Sync (or) Async : Synchronous API
1608 * @param[in] handle pointer to the package info handle
1609 * @return 0 if success, error code(<0) if fail
1610 * @retval PMINFO_R_OK success
1611 * @retval PMINFO_R_EINVAL invalid argument
1612 * @retval PMINFO_R_ERROR internal error
1613 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1615 * @see pkgmgrinfo_pkginfo_get_pkgid()
1616 * @see pkgmgrinfo_pkginfo_is_removable()
1618 static int get_pkg_type(const char *pkgid)
1622 pkgmgrinfo_pkginfo_h handle;
1623 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1624 if (ret != PMINFO_R_OK)
1626 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1627 if (ret != PMINFO_R_OK) {
1628 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1631 printf("pkgtype: %s\n", type);
1632 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1637 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1640 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1641 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1642 The query will search the entire package information collected from the manifest file of all the installed packages
1644 * @par This API is for package-manager client application
1645 * @par Sync (or) Async : Synchronous API
1647 * @param[out] handle pointer to the package info filter handle.
1648 * @return 0 if success, error code(<0) if fail
1649 * @retval PMINFO_R_OK success
1650 * @retval PMINFO_R_EINVAL invalid argument
1651 * @retval PMINFO_R_ERROR internal error
1653 * @post pkgmgrinfo_pkginfo_filter_destroy()
1654 * @see pkgmgrinfo_pkginfo_filter_count()
1655 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1657 static int get_tpk_pkg_count()
1661 pkgmgrinfo_pkginfo_filter_h handle;
1662 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1663 if (ret != PMINFO_R_OK)
1665 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1666 if (ret != PMINFO_R_OK) {
1667 pkgmgrinfo_pkginfo_filter_destroy(handle);
1670 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1671 if (ret != PMINFO_R_OK) {
1672 pkgmgrinfo_pkginfo_filter_destroy(handle);
1675 printf("No of tpk pkgs: %d\n", count);
1676 pkgmgrinfo_pkginfo_filter_destroy(handle);
1681 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1684 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1685 * @brief This API destroys the package information filter handle freeing up all the resources
1687 * @par This API is for package-manager client application
1688 * @par Sync (or) Async : Synchronous API
1690 * @param[in] handle pointer to the package info filter handle.
1691 * @return 0 if success, error code(<0) if fail
1692 * @retval PMINFO_R_OK success
1693 * @retval PMINFO_R_EINVAL invalid argument
1694 * @retval PMINFO_R_ERROR internal error
1695 * @pre pkgmgrinfo_pkginfo_filter_create()
1697 * @see pkgmgrinfo_pkginfo_filter_count()
1698 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1700 static int get_tpk_pkg_count()
1704 pkgmgrinfo_pkginfo_filter_h handle;
1705 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1706 if (ret != PMINFO_R_OK)
1708 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1709 if (ret != PMINFO_R_OK) {
1710 pkgmgrinfo_pkginfo_filter_destroy(handle);
1713 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1714 if (ret != PMINFO_R_OK) {
1715 pkgmgrinfo_pkginfo_filter_destroy(handle);
1718 printf("No of tpk pkgs: %d\n", count);
1719 pkgmgrinfo_pkginfo_filter_destroy(handle);
1724 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1727 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1728 * @brief This API adds a boolean filter property to the filter handle
1730 * @par This API is for package-manager client application
1731 * @par Sync (or) Async : Synchronous API
1733 * @param[in] handle pointer to the package info filter handle.
1734 * @param[in] property boolean property name.
1735 * @param[in] value value corresponding to the property.
1736 * @return 0 if success, error code(<0) if fail
1737 * @retval PMINFO_R_OK success
1738 * @retval PMINFO_R_EINVAL invalid argument
1739 * @retval PMINFO_R_ERROR internal error
1740 * @pre pkgmgrinfo_pkginfo_filter_create()
1741 * @post pkgmgrinfo_pkginfo_filter_destroy()
1742 * @see pkgmgrinfo_pkginfo_filter_count()
1743 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1745 static int get_preload_pkg_count()
1749 pkgmgrinfo_pkginfo_filter_h handle;
1750 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1751 if (ret != PMINFO_R_OK)
1753 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1754 if (ret != PMINFO_R_OK) {
1755 pkgmgrinfo_pkginfo_filter_destroy(handle);
1758 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1759 if (ret != PMINFO_R_OK) {
1760 pkgmgrinfo_pkginfo_filter_destroy(handle);
1763 printf("No of preload pkgs: %d\n", count);
1764 pkgmgrinfo_pkginfo_filter_destroy(handle);
1769 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1770 const char *property, const bool value);
1773 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1774 * @brief This API adds an integer filter property to the filter handle
1776 * @par This API is for package-manager client application
1777 * @par Sync (or) Async : Synchronous API
1779 * @param[in] handle pointer to the package info filter handle.
1780 * @param[in] property integer property name.
1781 * @param[in] value value corresponding to the property.
1782 * @return 0 if success, error code(<0) if fail
1783 * @retval PMINFO_R_OK success
1784 * @retval PMINFO_R_EINVAL invalid argument
1785 * @retval PMINFO_R_ERROR internal error
1786 * @pre pkgmgrinfo_pkginfo_filter_create()
1787 * @post pkgmgrinfo_pkginfo_filter_destroy()
1788 * @see pkgmgrinfo_pkginfo_filter_count()
1789 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1791 static int get_pkg_count()
1795 pkgmgrinfo_pkginfo_filter_h handle;
1796 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1797 if (ret != PMINFO_R_OK)
1799 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1800 if (ret != PMINFO_R_OK) {
1801 pkgmgrinfo_pkginfo_filter_destroy(handle);
1804 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1805 if (ret != PMINFO_R_OK) {
1806 pkgmgrinfo_pkginfo_filter_destroy(handle);
1809 printf("No of preload pkgs: %d\n", count);
1810 pkgmgrinfo_pkginfo_filter_destroy(handle);
1815 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1816 const char *property, const int value);
1819 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1820 * @brief This API adds a string filter property to the filter handle
1822 * @par This API is for package-manager client application
1823 * @par Sync (or) Async : Synchronous API
1825 * @param[in] handle pointer to the package info filter handle.
1826 * @param[in] property string property name.
1827 * @param[in] value value corresponding to the property.
1828 * @return 0 if success, error code(<0) if fail
1829 * @retval PMINFO_R_OK success
1830 * @retval PMINFO_R_EINVAL invalid argument
1831 * @retval PMINFO_R_ERROR internal error
1832 * @pre pkgmgrinfo_pkginfo_filter_create()
1833 * @post pkgmgrinfo_pkginfo_filter_destroy()
1834 * @see pkgmgrinfo_pkginfo_filter_count()
1835 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1837 static int get_tpk_pkg_count()
1841 pkgmgrinfo_pkginfo_filter_h handle;
1842 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1843 if (ret != PMINFO_R_OK)
1845 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1846 if (ret != PMINFO_R_OK) {
1847 pkgmgrinfo_pkginfo_filter_destroy(handle);
1850 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1851 if (ret != PMINFO_R_OK) {
1852 pkgmgrinfo_pkginfo_filter_destroy(handle);
1855 printf("No of tpk pkgs: %d\n", count);
1856 pkgmgrinfo_pkginfo_filter_destroy(handle);
1861 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1862 const char *property, const char *value);
1865 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1866 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1868 * @par This API is for package-manager client application
1869 * @par Sync (or) Async : Synchronous API
1871 * @param[in] handle pointer to the package info filter handle.
1872 * @param[in] pkg_cb callback function.
1873 * @param[in] user_data user data to be passed to the callback function
1874 * @return 0 if success, error code(<0) if fail
1875 * @retval PMINFO_R_OK success
1876 * @retval PMINFO_R_EINVAL invalid argument
1877 * @retval PMINFO_R_ERROR internal error
1878 * @pre pkgmgrinfo_pkginfo_filter_create()
1879 * @post pkgmgrinfo_pkginfo_filter_destroy()
1880 * @see pkgmgrinfo_pkginfo_filter_count()
1882 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1885 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1886 printf("pkg id : %s\n", pkgid);
1890 static int get_tpk_pkg_list()
1893 pkgmgrinfo_pkginfo_filter_h handle;
1894 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1895 if (ret != PMINFO_R_OK)
1897 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1898 if (ret != PMINFO_R_OK) {
1899 pkgmgrinfo_pkginfo_filter_destroy(handle);
1902 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1903 if (ret != PMINFO_R_OK) {
1904 pkgmgrinfo_pkginfo_filter_destroy(handle);
1907 pkgmgrinfo_pkginfo_filter_destroy(handle);
1912 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1913 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1914 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1915 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1918 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1919 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1920 * @brief This API counts the package that satisfy the filter conditions
1922 * @par This API is for package-manager client application
1923 * @par Sync (or) Async : Synchronous API
1925 * @param[in] handle pointer to the package info filter handle.
1926 * @param[in] count pointer to store the count value.
1927 * @param[in] uid the addressee user id of the instruction
1928 * @return 0 if success, error code(<0) if fail
1929 * @retval PMINFO_R_OK success
1930 * @retval PMINFO_R_EINVAL invalid argument
1931 * @retval PMINFO_R_ERROR internal error
1932 * @pre pkgmgrinfo_pkginfo_filter_create()
1933 * @post pkgmgrinfo_pkginfo_filter_destroy()
1934 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1936 static int get_tpk_pkg_count()
1940 pkgmgrinfo_pkginfo_filter_h handle;
1941 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1942 if (ret != PMINFO_R_OK)
1944 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1945 if (ret != PMINFO_R_OK) {
1946 pkgmgrinfo_pkginfo_filter_destroy(handle);
1949 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1950 if (ret != PMINFO_R_OK) {
1951 pkgmgrinfo_pkginfo_filter_destroy(handle);
1954 printf("No of tpk pkgs: %d\n", count);
1955 pkgmgrinfo_pkginfo_filter_destroy(handle);
1960 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1961 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1963 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1964 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1965 * @brief This API gets the list of privilege for a particular package
1967 * @par This API is for package-manager client application
1968 * @par Sync (or) Async : Synchronous API
1969 * @param[in] handle pointer to the package info handle.
1970 * @param[in] privilege_func callback function for list
1971 * @param[in] user_data user data to be passed to callback function
1972 * @return 0 if success, error code(<0) if fail
1973 * @retval PMINFO_R_OK success
1974 * @retval PMINFO_R_EINVAL invalid argument
1975 * @retval PMINFO_R_ERROR internal error
1976 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1977 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1979 int privilege_func(const char *name, void *user_data)
1981 if (strcmp(name, (char *)user_data) == 0)
1987 static int list_privilege(const char *package, char *privilege)
1990 pkgmgrinfo_pkginfo_h handle;
1991 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1992 if (ret != PMINFO_R_OK)
1994 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1995 if (ret != PMINFO_R_OK) {
1996 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1999 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2004 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2005 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2007 /* TODO: add doxygen comment here */
2008 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2009 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2010 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2011 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2012 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2013 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2014 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2017 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2018 * @brief This API copy the application information handle
2020 * @par This API is for package-manager client application
2021 * @par Sync (or) Async : Synchronous API
2023 * @param[in] handle pointer to the package info handle.
2024 * @param[out] handle pointer to the package info handle.
2025 * @return 0 if success, error code(<0) if fail
2026 * @retval PMINFO_R_OK success
2027 * @retval PMINFO_R_EINVAL invalid argument
2028 * @retval PMINFO_R_ERROR internal error
2030 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2032 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2036 pkgmgrinfo_pkginfo_h clone;
2038 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2039 if (ret != PMINFO_R_OK)
2043 printf("package: %s\n", clone->package);
2044 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2049 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2053 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2054 pkgmgrinfo_app_list_cb app_func, void *user_data)
2055 * @brief This API gets list of installed applications for a particular package
2057 * @par This API is for package-manager client application
2058 * @par Sync (or) Async : Synchronous API
2059 * @param[in] handle package info handle
2060 * @param[in] component application component
2061 * @param[in] app_func iteration function for list
2062 * @param[in] user_data user data to be passed to callback function
2063 * @return 0 if success, error code(<0) if fail
2064 * @retval PMINFO_R_OK success
2065 * @retval PMINFO_R_EINVAL invalid argument
2066 * @retval PMINFO_R_ERROR internal error
2067 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2068 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2070 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2073 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2074 printf("appid : %s\n", appid);
2078 static int list_apps(const char *pkgid)
2081 pkgmgrinfo_pkginfo_h handle;
2082 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2083 if (ret != PMINFO_R_OK)
2085 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2086 if (ret != PMINFO_R_OK) {
2087 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2090 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2095 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2096 pkgmgrinfo_app_list_cb app_func, void *user_data);
2097 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2098 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2101 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2102 * @brief This API gets list of installed applications from all packages with minimum informaion.
2104 * @par This API is for package-manager client application
2105 * @par Sync (or) Async : Synchronous API
2106 * @param[in] app_func iteration function for list
2107 * @param[in] user_data user data to be passed to callback function
2108 * @return 0 if success, error code(<0) if fail
2109 * @retval PMINFO_R_OK success
2110 * @retval PMINFO_R_EINVAL invalid argument
2111 * @retval PMINFO_R_ERROR internal error
2115 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2117 char *pkgid1 = NULL;
2118 char *pkgid2 = NULL;
2119 pkgid1 = (char *)user_data;
2120 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2121 if (strcmp(pkgid1, pkgid2) == 0) {
2128 static int list_apps()
2131 char *name = "helloworld";
2132 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2133 if (ret != PMINFO_R_OK) {
2140 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2141 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2144 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2145 * @brief This API gets list of installed applications from all packages.
2147 * @par This API is for package-manager client application
2148 * @par Sync (or) Async : Synchronous API
2149 * @param[in] app_func iteration function for list
2150 * @param[in] user_data user data to be passed to callback function
2151 * @return 0 if success, error code(<0) if fail
2152 * @retval PMINFO_R_OK success
2153 * @retval PMINFO_R_EINVAL invalid argument
2154 * @retval PMINFO_R_ERROR internal error
2158 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2160 char *pkgid1 = NULL;
2161 char *pkgid2 = NULL;
2162 pkgid1 = (char *)user_data;
2163 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2164 if (strcmp(pkgid1, pkgid2) == 0) {
2171 static int list_apps()
2174 char *name = "helloworld";
2175 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2176 if (ret != PMINFO_R_OK) {
2183 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2184 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2187 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2188 * @brief This API creates the disabled application information handle from db
2190 * @par This API is for package-manager client application
2191 * @par Sync (or) Async : Synchronous API
2193 * @param[in] appid pointer to appid
2194 * @param[out] handle pointer to the application info handle.
2195 * @return 0 if success, error code(<0) if fail
2196 * @retval PMINFO_R_OK success
2197 * @retval PMINFO_R_EINVAL invalid argument
2198 * @retval PMINFO_R_ERROR internal error
2200 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2201 * @see pkgmgrinfo_appinfo_get_pkgid()
2202 * @see pkgmgrinfo_appinfo_is_multiple()
2204 static int get_disabled_app_type(const char *appid)
2208 pkgmgrinfo_appinfo_h handle;
2209 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2210 if (ret != PMINFO_R_OK)
2212 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2213 if (ret != PMINFO_R_OK) {
2214 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2217 printf("apptype: %s\n", type);
2218 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2223 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2224 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2227 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2228 * @brief This API creates the application information handle from db
2230 * @par This API is for package-manager client application
2231 * @par Sync (or) Async : Synchronous API
2233 * @param[in] appid pointer to appid
2234 * @param[out] handle pointer to the application info handle.
2235 * @return 0 if success, error code(<0) if fail
2236 * @retval PMINFO_R_OK success
2237 * @retval PMINFO_R_EINVAL invalid argument
2238 * @retval PMINFO_R_ERROR internal error
2240 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2241 * @see pkgmgrinfo_appinfo_get_pkgid()
2242 * @see pkgmgrinfo_appinfo_is_multiple()
2244 static int get_app_type(const char *appid)
2248 pkgmgrinfo_appinfo_h handle;
2249 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2250 if (ret != PMINFO_R_OK)
2252 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2253 if (ret != PMINFO_R_OK) {
2254 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2257 printf("apptype: %s\n", type);
2258 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2263 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2264 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2267 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2268 * @brief This API gets the application ID
2270 * @par This API is for package-manager client application
2271 * @par Sync (or) Async : Synchronous API
2273 * @param[in] handle pointer to the application info handle.
2274 * @param[out] appid pointer to hold appid
2275 * @return 0 if success, error code(<0) if fail
2276 * @retval PMINFO_R_OK success
2277 * @retval PMINFO_R_EINVAL invalid argument
2278 * @retval PMINFO_R_ERROR internal error
2279 * @pre pkgmgrinfo_appinfo_get_appinfo()
2280 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2281 * @see pkgmgrinfo_appinfo_get_pkgid()
2282 * @see pkgmgrinfo_appinfo_is_multiple()
2284 static int get_app_id(const char *appid)
2287 char *app_id = NULL;
2288 pkgmgrinfo_appinfo_h handle;
2289 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2290 if (ret != PMINFO_R_OK)
2292 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2293 if (ret != PMINFO_R_OK) {
2294 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2297 printf("app id: %s\n", app_id);
2298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2303 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2306 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2307 * @brief This API gets the package name of the application
2309 * @par This API is for package-manager client application
2310 * @par Sync (or) Async : Synchronous API
2312 * @param[in] handle pointer to the application info handle.
2313 * @param[out] pkg_name pointer to hold package name
2314 * @return 0 if success, error code(<0) if fail
2315 * @retval PMINFO_R_OK success
2316 * @retval PMINFO_R_EINVAL invalid argument
2317 * @retval PMINFO_R_ERROR internal error
2318 * @pre pkgmgrinfo_appinfo_get_appinfo()
2319 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2320 * @see pkgmgrinfo_appinfo_get_appid()
2321 * @see pkgmgrinfo_appinfo_is_multiple()
2323 static int get_app_pkgname(const char *appid)
2326 char *pkgname = NULL;
2327 pkgmgrinfo_appinfo_h handle;
2328 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2329 if (ret != PMINFO_R_OK)
2331 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2332 if (ret != PMINFO_R_OK) {
2333 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2336 printf("pkg name: %s\n", pkgname);
2337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2342 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2345 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2346 * @brief This API gets the package id of the application
2348 * @par This API is for package-manager client application
2349 * @par Sync (or) Async : Synchronous API
2351 * @param[in] handle pointer to the application info handle.
2352 * @param[out] pkgid pointer to hold package id
2353 * @return 0 if success, error code(<0) if fail
2354 * @retval PMINFO_R_OK success
2355 * @retval PMINFO_R_EINVAL invalid argument
2356 * @retval PMINFO_R_ERROR internal error
2357 * @pre pkgmgrinfo_appinfo_get_appinfo()
2358 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2359 * @see pkgmgrinfo_appinfo_get_appid()
2360 * @see pkgmgrinfo_appinfo_is_multiple()
2362 static int get_app_pkgid(const char *appid)
2366 pkgmgrinfo_appinfo_h handle;
2367 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2368 if (ret != PMINFO_R_OK)
2370 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2371 if (ret != PMINFO_R_OK) {
2372 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2375 printf("pkg id: %s\n", pkgid);
2376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2381 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2384 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2385 * @brief This API gets the package type of the application
2387 * @par This API is for package-manager client application
2388 * @par Sync (or) Async : Synchronous API
2390 * @param[in] handle pointer to the application info handle.
2391 * @param[out] pkgtype pointer to hold package type
2392 * @return 0 if success, error code(<0) if fail
2393 * @retval PMINFO_R_OK success
2394 * @retval PMINFO_R_EINVAL invalid argument
2395 * @retval PMINFO_R_ERROR internal error
2396 * @pre pkgmgrinfo_appinfo_get_appinfo()
2397 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2398 * @see pkgmgrinfo_appinfo_get_appid()
2399 * @see pkgmgrinfo_appinfo_is_multiple()
2401 static int get_app_pkgtype(const char *appid)
2404 char *pkgtype = NULL;
2405 pkgmgrinfo_appinfo_h handle = NULL;
2406 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2407 if (ret != PMINFO_R_OK)
2409 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2410 if (ret != PMINFO_R_OK) {
2411 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2414 printf("pkgtype: %s\n", pkgtype);
2415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2420 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2423 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2424 * @brief This API gets the executable name of the application
2426 * @par This API is for package-manager client application
2427 * @par Sync (or) Async : Synchronous API
2429 * @param[in] handle pointer to the application info handle.
2430 * @param[out] exec pointer to hold app exec name
2431 * @return 0 if success, error code(<0) if fail
2432 * @retval PMINFO_R_OK success
2433 * @retval PMINFO_R_EINVAL invalid argument
2434 * @retval PMINFO_R_ERROR internal error
2435 * @pre pkgmgrinfo_appinfo_get_appinfo()
2436 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2437 * @see pkgmgrinfo_appinfo_get_appid()
2438 * @see pkgmgrinfo_appinfo_is_multiple()
2440 static int get_app_exec(const char *appid)
2444 pkgmgrinfo_appinfo_h handle;
2445 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2446 if (ret != PMINFO_R_OK)
2448 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2449 if (ret != PMINFO_R_OK) {
2450 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2453 printf("exec name: %s\n", exec);
2454 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2459 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2462 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2463 * @brief This API gets the icon name of the application
2465 * @par This API is for package-manager client application
2466 * @par Sync (or) Async : Synchronous API
2468 * @param[in] handle pointer to the application info handle.
2469 * @param[out] icon pointer to hold app icon name
2470 * @return 0 if success, error code(<0) if fail
2471 * @retval PMINFO_R_OK success
2472 * @retval PMINFO_R_EINVAL invalid argument
2473 * @retval PMINFO_R_ERROR internal error
2474 * @pre pkgmgrinfo_appinfo_get_appinfo()
2475 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2476 * @see pkgmgrinfo_appinfo_get_appid()
2477 * @see pkgmgrinfo_appinfo_is_multiple()
2479 static int get_app_icon(const char *appid)
2483 pkgmgrinfo_appinfo_h handle;
2484 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2485 if (ret != PMINFO_R_OK)
2487 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2488 if (ret != PMINFO_R_OK) {
2489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2492 printf("icon name: %s\n", icon);
2493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2498 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2501 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2502 * @brief This API gets the label of the application
2504 * @par This API is for package-manager client application
2505 * @par Sync (or) Async : Synchronous API
2507 * @param[in] handle pointer to the application info handle.
2508 * @param[out] label pointer to hold app label
2509 * @return 0 if success, error code(<0) if fail
2510 * @retval PMINFO_R_OK success
2511 * @retval PMINFO_R_EINVAL invalid argument
2512 * @retval PMINFO_R_ERROR internal error
2513 * @pre pkgmgrinfo_appinfo_get_appinfo()
2514 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2515 * @see pkgmgrinfo_appinfo_get_appid()
2516 * @see pkgmgrinfo_appinfo_is_multiple()
2518 static int get_app_label(const char *appid)
2522 pkgmgrinfo_appinfo_h handle;
2523 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2524 if (ret != PMINFO_R_OK)
2526 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2527 if (ret != PMINFO_R_OK) {
2528 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2531 printf("label : %s\n", label);
2532 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2537 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2540 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2541 * @brief This API gets exactly matched label by given appid and locale
2543 * @par This API is for package-manager client application
2544 * @par Sync (or) Async : Synchronous API
2546 * @param[in] appid pointer to appid
2547 * @param[in] locale pointer to locale
2548 * @param[out] label pointer to hold app label
2549 * @return 0 if success, error code(<0) if fail
2550 * @retval PMINFO_R_OK success
2551 * @retval PMINFO_R_EINVAL invalid argument
2552 * @retval PMINFO_R_ERROR internal error
2554 static int get_localed_label(const char *appid, const char *locale)
2559 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2560 if (ret != PMINFO_R_OK)
2563 printf("localed label: %s\n", label);
2571 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2572 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2575 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2576 * @brief This API gets the component of the application
2578 * @par This API is for package-manager client application
2579 * @par Sync (or) Async : Synchronous API
2581 * @param[in] handle pointer to the application info handle.
2582 * @param[out] component pointer to hold app component
2583 * @return 0 if success, error code(<0) if fail
2584 * @retval PMINFO_R_OK success
2585 * @retval PMINFO_R_EINVAL invalid argument
2586 * @retval PMINFO_R_ERROR internal error
2587 * @pre pkgmgrinfo_appinfo_get_appinfo()
2588 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2589 * @see pkgmgrinfo_appinfo_get_appid()
2590 * @see pkgmgrinfo_appinfo_is_multiple()
2592 static int get_app_component(const char *appid)
2595 pkgmgrinfo_app_component component;
2596 pkgmgrinfo_appinfo_h handle;
2597 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2598 if (ret != PMINFO_R_OK)
2600 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2601 if (ret != PMINFO_R_OK) {
2602 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2605 printf("component : %s\n", component);
2606 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2611 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2614 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2615 * @brief This API gets the apptype of the application
2617 * @par This API is for package-manager client application
2618 * @par Sync (or) Async : Synchronous API
2620 * @param[in] handle pointer to the application info handle.
2621 * @param[out] app_type pointer to hold apptype
2622 * @return 0 if success, error code(<0) if fail
2623 * @retval PMINFO_R_OK success
2624 * @retval PMINFO_R_EINVAL invalid argument
2625 * @retval PMINFO_R_ERROR internal error
2626 * @pre pkgmgrinfo_appinfo_get_appinfo()
2627 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2628 * @see pkgmgrinfo_appinfo_get_appid()
2629 * @see pkgmgrinfo_appinfo_is_multiple()
2631 static int get_app_type(const char *appid)
2634 char *apptype = NULL;
2635 pkgmgrinfo_appinfo_h handle;
2636 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2637 if (ret != PMINFO_R_OK)
2639 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2640 if (ret != PMINFO_R_OK) {
2641 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2644 printf("apptype : %s\n", apptype);
2645 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2650 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2653 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2654 int *operation_count, char ***operation)
2655 * @brief This API gets the list of operation of the application
2657 * @par This API is for package-manager client application
2658 * @par Sync (or) Async : Synchronous API
2660 * @param[in] handle pointer to the appcontrol handle.
2661 * @param[out] operation_count pointer to hold number of operations
2662 * @param[out] operation pointer to hold list of operations
2663 * @return 0 if success, error code(<0) if fail
2664 * @retval PMINFO_R_OK success
2665 * @retval PMINFO_R_EINVAL invalid argument
2666 * @retval PMINFO_R_ERROR internal error
2667 * @pre pkgmgrinfo_appinfo_get_appinfo()
2668 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2669 * @see pkgmgrinfo_appinfo_get_uri()
2670 * @see pkgmgrinfo_appinfo_get_mime()
2672 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2677 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2678 for (i = 0; i < oc; i++) {
2679 if (strcmp(operation[i], (char *)user_data) == 0)
2686 static int check_operation(const char *appid, char *operation)
2689 pkgmgrinfo_appinfo_h handle;
2690 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2691 if (ret != PMINFO_R_OK)
2693 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2694 if (ret != PMINFO_R_OK) {
2695 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2698 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2703 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2704 int *operation_count, char ***operation);
2707 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2708 int *uri_count, char ***uri)
2709 * @brief This API gets the list of uri of the application
2711 * @par This API is for package-manager client application
2712 * @par Sync (or) Async : Synchronous API
2714 * @param[in] handle pointer to the appcontrol handle.
2715 * @param[out] uri_count pointer to hold number of uris
2716 * @param[out] uri pointer to hold list of uris
2717 * @return 0 if success, error code(<0) if fail
2718 * @retval PMINFO_R_OK success
2719 * @retval PMINFO_R_EINVAL invalid argument
2720 * @retval PMINFO_R_ERROR internal error
2721 * @pre pkgmgrinfo_appinfo_get_appinfo()
2722 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2723 * @see pkgmgrinfo_appinfo_get_operation()
2724 * @see pkgmgrinfo_appinfo_get_mime()
2726 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2731 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2732 for (i = 0; i < uc; i++) {
2733 if (strcmp(uri[i], (char *)user_data) == 0)
2740 static int check_uri(const char *appid, char *uri)
2743 pkgmgrinfo_appinfo_h handle;
2744 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2745 if (ret != PMINFO_R_OK)
2747 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2748 if (ret != PMINFO_R_OK) {
2749 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2752 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2757 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2758 int *uri_count, char ***uri);
2761 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2762 int *mime_count, char ***mime)
2763 * @brief This API gets the list of mime of the application
2765 * @par This API is for package-manager client application
2766 * @par Sync (or) Async : Synchronous API
2768 * @param[in] handle pointer to the appcontrol handle.
2769 * @param[out] mime_count pointer to hold number of mimes
2770 * @param[out] mime pointer to hold list of mimes
2771 * @return 0 if success, error code(<0) if fail
2772 * @retval PMINFO_R_OK success
2773 * @retval PMINFO_R_EINVAL invalid argument
2774 * @retval PMINFO_R_ERROR internal error
2775 * @pre pkgmgrinfo_appinfo_get_appinfo()
2776 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2777 * @see pkgmgrinfo_appinfo_get_uri()
2778 * @see pkgmgrinfo_appinfo_get_operation()
2780 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2785 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2786 for (i = 0; i < mc; i++) {
2787 if (strcmp(mime[i], (char *)user_data) == 0)
2794 static int check_mime(const char *appid, char *mime)
2797 pkgmgrinfo_appinfo_h handle;
2798 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2799 if (ret != PMINFO_R_OK)
2801 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2802 if (ret != PMINFO_R_OK) {
2803 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2806 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2811 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2812 int *mime_count, char ***mime);
2815 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2816 int *subapp_count, char ***subapp)
2817 * @brief This API gets the list of subapp of the application
2819 * @par This API is for package-manager client application
2820 * @par Sync (or) Async : Synchronous API
2822 * @param[in] handle pointer to the appcontrol handle.
2823 * @param[out] subapp_count pointer to hold number of subapp
2824 * @param[out] subapp pointer to hold list of subapp
2825 * @return 0 if success, error code(<0) if fail
2826 * @retval PMINFO_R_OK success
2827 * @retval PMINFO_R_EINVAL invalid argument
2828 * @retval PMINFO_R_ERROR internal error
2829 * @pre pkgmgrinfo_appinfo_get_appinfo()
2830 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2831 * @see pkgmgrinfo_appinfo_get_uri()
2832 * @see pkgmgrinfo_appinfo_get_operation()
2834 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2838 char **subapp = NULL;
2839 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2840 for (i = 0; i < sc; i++) {
2841 if (strcmp(subapp[i], (char *)user_data) == 0)
2848 static int check_subapp(const char *appid, char *subapp)
2851 pkgmgrinfo_appinfo_h handle = NULL;
2852 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2853 if (ret != PMINFO_R_OK)
2855 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2856 if (ret != PMINFO_R_OK) {
2857 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2860 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2865 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2866 int *subapp_count, char ***subapp);
2869 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2870 * @brief This API gets the notification icon of the application
2872 * @par This API is for package-manager client application
2873 * @par Sync (or) Async : Synchronous API
2875 * @param[in] handle pointer to the application info handle.
2876 * @param[out] path pointer to hold notification icon
2877 * @return 0 if success, error code(<0) if fail
2878 * @retval PMINFO_R_OK success
2879 * @retval PMINFO_R_EINVAL invalid argument
2880 * @retval PMINFO_R_ERROR internal error
2881 * @pre pkgmgrinfo_appinfo_get_appinfo()
2882 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2883 * @see pkgmgrinfo_appinfo_get_appid()
2884 * @see pkgmgrinfo_appinfo_is_multiple()
2886 static int get_app_notification_icon(const char *appid)
2889 char *notification_icon = NULL;
2890 pkgmgrinfo_appinfo_h handle;
2891 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2892 if (ret != PMINFO_R_OK)
2894 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2895 if (ret != PMINFO_R_OK) {
2896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2899 printf("notification icon : %s\n", notification_icon);
2900 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2905 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2908 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2909 * @brief This API gets the setting icon of the application
2911 * @par This API is for package-manager client application
2912 * @par Sync (or) Async : Synchronous API
2914 * @param[in] handle pointer to the application info handle.
2915 * @param[out] path pointer to hold setting icon
2916 * @return 0 if success, error code(<0) if fail
2917 * @retval PMINFO_R_OK success
2918 * @retval PMINFO_R_EINVAL invalid argument
2919 * @retval PMINFO_R_ERROR internal error
2920 * @pre pkgmgrinfo_appinfo_get_appinfo()
2921 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2922 * @see pkgmgrinfo_appinfo_get_appid()
2923 * @see pkgmgrinfo_appinfo_is_multiple()
2925 static int get_app_setting_icon(const char *appid)
2928 char *setting_icon = NULL;
2929 pkgmgrinfo_appinfo_h handle;
2930 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2931 if (ret != PMINFO_R_OK)
2933 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2934 if (ret != PMINFO_R_OK) {
2935 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2938 printf("setting icon : %s\n", setting_icon);
2939 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2944 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2947 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2948 * @brief This API gets the type of recent image on app-tray
2950 * @par This API is for package-manager client application
2951 * @par Sync (or) Async : Synchronous API
2953 * @param[in] handle pointer to the application info handle.
2954 * @param[out] type pointer to hold image type
2955 * @return 0 if success, error code(<0) if fail
2956 * @retval PMINFO_R_OK success
2957 * @retval PMINFO_R_EINVAL invalid argument
2958 * @retval PMINFO_R_ERROR internal error
2959 * @pre pkgmgrinfo_appinfo_get_appinfo()
2960 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2961 * @see pkgmgrinfo_appinfo_get_appid()
2962 * @see pkgmgrinfo_appinfo_is_multiple()
2964 static int get_app_recent_image_type(const char *appid)
2967 pkgmgrinfo_app_recentimage type;
2968 pkgmgrinfo_appinfo_h handle;
2969 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2970 if (ret != PMINFO_R_OK)
2972 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2973 if (ret != PMINFO_R_OK) {
2974 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2977 printf("recent image type: %d\n", type);
2978 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2983 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2987 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2988 * @brief This API gets the preview image of application
2990 * @par Sync (or) Async : Synchronous API
2992 * @param[in] handle pointer to the application info handle.
2993 * @param[out] preview_img pointer to hold preview image path
2994 * @return 0 if success, error code(<0) if fail
2995 * @retval PMINFO_R_OK success
2996 * @retval PMINFO_R_EINVAL invalid argument
2997 * @retval PMINFO_R_ERROR internal error
2998 * @pre pkgmgrinfo_appinfo_get_appinfo()
2999 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3000 * @see pkgmgrinfo_appinfo_get_appid()
3002 static int get_app_previewimage(const char *appid)
3005 char *preview = NULL;
3006 pkgmgrinfo_appinfo_h handle = NULL;
3007 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3008 if (ret != PMINFO_R_OK)
3010 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3011 if (ret != PMINFO_R_OK) {
3012 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3015 printf("preview image path : %s\n", preview);
3016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3021 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3025 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3026 * @brief This API gets the package permission type of the application
3028 * @par This API is for package-manager client application
3029 * @par Sync (or) Async : Synchronous API
3031 * @param[in] handle pointer to the application info handle.
3032 * @param[out] permission pointer to hold package permission
3033 * @return 0 if success, error code(<0) if fail
3034 * @retval PMINFO_R_OK success
3035 * @retval PMINFO_R_EINVAL invalid argument
3036 * @retval PMINFO_R_ERROR internal error
3037 * @pre pkgmgrinfo_appinfo_get_appinfo()
3038 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3039 * @see pkgmgrinfo_appinfo_get_appid()
3041 static int get_app_permission(const char *appid)
3044 pkgmgrinfo_permission_type permission = 0;
3045 pkgmgrinfo_appinfo_h handle;
3047 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3048 if (ret != PMINFO_R_OK)
3050 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3051 if (ret != PMINFO_R_OK) {
3052 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3055 printf("permission type: %d\n", permission);
3056 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3061 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3064 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3065 * @brief This API gets the component_type
3067 * @par This API is for package-manager client application
3068 * @par Sync (or) Async : Synchronous API
3070 * @param[in] handle pointer to the application info handle.
3071 * @param[out] component_type pointer to hold component_type
3072 * @return 0 if success, error code(<0) if fail
3073 * @retval PMINFO_R_OK success
3074 * @retval PMINFO_R_EINVAL invalid argument
3075 * @retval PMINFO_R_ERROR internal error
3076 * @pre pkgmgrinfo_appinfo_get_appinfo()
3077 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3078 * @see pkgmgrinfo_appinfo_get_pkgid()
3079 * @see pkgmgrinfo_appinfo_is_multiple()
3081 static int get_component_type(const char *appid)
3084 char *component_type = NULL;
3085 pkgmgrinfo_appinfo_h handle;
3086 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3087 if (ret != PMINFO_R_OK)
3089 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3090 if (ret != PMINFO_R_OK) {
3091 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3094 printf("component_type: %s\n", component_type);
3095 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3100 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3103 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3104 * @brief This API gets the application 'hwacceleration' value from the app ID
3106 * @par This API is for package-manager client application
3107 * @par Sync (or) Async : Synchronous API
3109 * @param[in] handle pointer to application info handle
3110 * @param[out] hwacceleration pointer to hold package hwacceleration value
3111 * @return 0 if success, error code(<0) if fail
3112 * @retval PMINFO_R_OK success
3113 * @retval PMINFO_R_EINVAL invalid argument
3114 * @retval PMINFO_R_ERROR internal error
3115 * @pre pkgmgrinfo_appinfo_get_appinfo()
3116 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3117 * @see pkgmgrinfo_appinfo_get_appid()
3118 * @see pkgmgrinfo_appinfo_is_multiple()
3120 static int get_app_hwacceleration(const char *appid)
3123 pkgmgrinfo_app_hwacceleration hwacceleration;
3124 pkgmgrinfo_appinfo_h handle;
3125 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3126 if (ret != PMINFO_R_OK)
3128 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3129 if (ret != PMINFO_R_OK) {
3130 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3133 printf("app hwacceleration: %d\n", hwacceleration);
3134 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3139 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3142 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3143 * @brief This API gets the application 'screenreader' value from the app ID
3145 * @par This API is for package-manager client application
3146 * @par Sync (or) Async : Synchronous API
3148 * @param[in] handle pointer to application info handle
3149 * @param[out] screenreader pointer to hold package accessibility value
3150 * @return 0 if success, error code(<0) if fail
3151 * @retval PMINFO_R_OK success
3152 * @retval PMINFO_R_EINVAL invalid argument
3153 * @retval PMINFO_R_ERROR internal error
3154 * @pre pkgmgrinfo_appinfo_get_appinfo()
3155 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3156 * @see pkgmgrinfo_appinfo_get_appid()
3157 * @see pkgmgrinfo_appinfo_is_multiple()
3159 static int get_app_screenreader(const char *appid)
3162 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3163 pkgmgrinfo_appinfo_h handle = NULL;
3164 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3165 if (ret != PMINFO_R_OK)
3167 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3168 if (ret != PMINFO_R_OK) {
3169 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3172 printf("app screenreader: %d\n", screenreader);
3173 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3178 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3181 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3182 * @brief This API gets the application's landscape & portrait effect images
3184 * @par This API is for package-manager client application
3185 * @par Sync (or) Async : Synchronous API
3187 * @param[in] handle pointer to application info handle
3188 * @param[out] portrait_img contains portrait mode effect image
3189 * @param[out] landscape_img contains landscape mode effect image
3190 * @return 0 if success, error code(<0) if fail
3191 * @retval PMINFO_R_OK success
3192 * @retval PMINFO_R_EINVAL invalid argument
3193 * @retval PMINFO_R_ERROR internal error
3194 * @pre pkgmgrinfo_appinfo_get_appinfo()
3195 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3196 * @see pkgmgrinfo_appinfo_get_appid()
3197 * @see pkgmgrinfo_appinfo_is_nodisplay()
3199 static int get_app_effectimages(const char *appid)
3202 char *portraitimg = NULL;
3203 char *landscapeimg = NULL;
3204 pkgmgrinfo_appinfo_h handle;
3205 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3206 if (ret != PMINFO_R_OK)
3208 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3209 if (ret != PMINFO_R_OK) {
3210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3213 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3214 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3219 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3222 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3223 * @brief This API gets the application's effect image type
3225 * @par This API is for package-manager client application
3226 * @par Sync (or) Async : Synchronous API
3228 * @param[in] handle pointer to application info handle
3229 * @param[out] effectimg_type contains effect image type
3230 * @return 0 if success, error code(<0) if fail
3231 * @retval PMINFO_R_OK success
3232 * @retval PMINFO_R_EINVAL invalid argument
3233 * @retval PMINFO_R_ERROR internal error
3234 * @pre pkgmgrinfo_appinfo_get_appinfo()
3235 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3236 * @see pkgmgrinfo_appinfo_get_appid()
3237 * @see pkgmgrinfo_appinfo_is_nodisplay()
3239 static int get_app_effectimage_type(const char *appid)
3242 char *effectimg_type = NULL;
3243 pkgmgrinfo_appinfo_h handle = NULL;
3244 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3245 if (ret != PMINFO_R_OK)
3247 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3248 if (ret != PMINFO_R_OK) {
3249 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3252 printf("app effect image type: %s\n", effectimg_type);
3253 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3258 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3261 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3262 * @brief This API gets the submode_mainid of the application
3264 * @par This API is for package-manager client application
3265 * @par Sync (or) Async : Synchronous API
3267 * @param[in] handle pointer to the application info handle.
3268 * @param[out] submode_mainid pointer to hold package name
3269 * @return 0 if success, error code(<0) if fail
3270 * @retval PMINFO_R_OK success
3271 * @retval PMINFO_R_EINVAL invalid argument
3272 * @retval PMINFO_R_ERROR internal error
3273 * @pre pkgmgrinfo_appinfo_get_appinfo()
3274 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3275 * @see pkgmgrinfo_appinfo_get_appid()
3276 * @see pkgmgrinfo_appinfo_is_multiple()
3278 static int get_app_submode_mainid(const char *appid)
3281 char *submode_mainid = NULL;
3282 pkgmgrinfo_appinfo_h handle = NULL;
3283 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3284 if (ret != PMINFO_R_OK)
3286 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3287 if (ret != PMINFO_R_OK) {
3288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3291 printf("submode_mainid: %s\n", submode_mainid);
3292 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3297 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3300 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3301 * @brief This API gets the datacontrol info
3303 * @par This API is for package-manager client application
3304 * @par Sync (or) Async : Synchronous API
3306 * @param[in] providerid pointer to the providerid of dataconltrol.
3307 * @param[in] type pointer to the type of dataconltrol.
3308 * @param[out] appid pointer to hold appid, need to free after using
3309 * @param[out] access pointer to hold access, need to free after using
3310 * @return 0 if success, error code(<0) if fail
3311 * @retval PMINFO_R_OK success
3312 * @retval PMINFO_R_EINVAL invalid argument
3313 * @retval PMINFO_R_ERROR internal error
3316 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3317 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3320 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3321 * @brief This API gets the appid of datacontrol
3323 * @par This API is for package-manager client application
3324 * @par Sync (or) Async : Synchronous API
3326 * @param[in] providerid pointer to the providerid of dataconltrol.
3327 * @param[out] appid pointer to hold appid, need to free after using
3328 * @return 0 if success, error code(<0) if fail
3329 * @retval PMINFO_R_OK success
3330 * @retval PMINFO_R_EINVAL invalid argument
3331 * @retval PMINFO_R_ERROR internal error
3334 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3335 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3338 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3339 * @brief This API gets the alias_appid of the application
3341 * @par This API is for package-manager client application
3342 * @par Sync (or) Async : Synchronous API
3344 * @param[in] handle pointer to the application info handle.
3345 * @param[out] alias_appid pointer to hold app alias_appid
3346 * @return 0 if success, error code(<0) if fail
3347 * @retval PMINFO_R_OK success
3348 * @retval PMINFO_R_EINVAL invalid argument
3349 * @retval PMINFO_R_ERROR internal error
3350 * @pre pkgmgrinfo_appinfo_get_appinfo()
3351 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3352 * @see pkgmgrinfo_appinfo_get_appid()
3354 static int get_alias_appid(const char *appid)
3357 char *alias_appid= 0;
3358 pkgmgrinfo_appinfo_h handle = NULL;
3359 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3360 if (ret != PMINFO_R_OK)
3362 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3363 if (ret != PMINFO_R_OK) {
3364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3367 printf("alias_appid: %s\n", alias_appid);
3368 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3373 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3376 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3377 * @brief This API gets the effective_appid of the application
3379 * @par This API is for package-manager client application
3380 * @par Sync (or) Async : Synchronous API
3382 * @param[in] handle pointer to the application info handle.
3383 * @param[out] effective_appid pointer to hold app effective_appid
3384 * @return 0 if success, error code(<0) if fail
3385 * @retval PMINFO_R_OK success
3386 * @retval PMINFO_R_EINVAL invalid argument
3387 * @retval PMINFO_R_ERROR internal error
3388 * @pre pkgmgrinfo_appinfo_get_appinfo()
3389 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3390 * @see pkgmgrinfo_appinfo_get_appid()
3392 static int get_effective_appid(const char *appid)
3395 char *effective_appid= 0;
3396 pkgmgrinfo_appinfo_h handle = NULL;
3397 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3398 if (ret != PMINFO_R_OK)
3400 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3401 if (ret != PMINFO_R_OK) {
3402 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3405 printf("effective_appid: %s\n", effective_appid);
3406 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3411 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3414 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3415 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3417 * @par This API is for package-manager client application
3418 * @par Sync (or) Async : Synchronous API
3420 * @param[in] handle pointer to the appinfo handle.
3421 * @param[out] tep_name pointer to hold tep name
3422 * @return 0 if success, error code(<0) if fail
3423 * @retval PMINFO_R_OK success
3424 * @retval PMINFO_R_EINVAL invalid argument
3425 * @retval PMINFO_R_ERROR internal error
3426 * @pre pkgmgrinfo_appinfo_get_appinfo()
3427 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3428 * @see pkgmgrinfo_appinfo_get_appid()
3430 static int get_tep_name(const char *appid)
3433 char *tep_name = NULL;
3434 pkgmgrinfo_appinfo_h handle = NULL;
3435 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3436 if (ret != PMINFO_R_OK)
3438 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3439 if (ret != PMINFO_R_OK) {
3440 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3443 printf("TEP name is: %s\n", tep_name);
3444 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3449 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3452 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3453 * @brief This API gets the root path of application
3455 * @par Sync (or) Async : Synchronous API
3457 * @param[in] handle pointer to appinfo handle
3458 * @param[out] path pointer to hold root path of application
3459 * @return 0 if success, error code(<0) if fail
3460 * @retval PMINFO_R_OK success
3461 * @retval PMINFO_R_EINVAL invalid argument
3462 * @retval PMINFO_R_ERROR internal error
3464 static int get_root_path(const char *appid)
3468 pkgmgrinfo_appinfo_h handle;
3469 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3470 if (ret != PMINFO_R_OK)
3473 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3474 if (ret != PMINFO_R_OK) {
3475 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3478 printf("path : %s\n", path);
3479 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3485 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3488 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3489 * @brief This API gets the application api_version from the application ID
3491 * @par This API is for package-manager client application
3492 * @par Sync (or) Async : Synchronous API
3494 * @param[in] handle pointer to appinfo handle
3495 * @param[out] api_version pointer to hold application api_version
3496 * @return 0 if success, error code(<0) if fail
3497 * @retval PMINFO_R_OK success
3498 * @retval PMINFO_R_EINVAL invalid argument
3499 * @retval PMINFO_R_ERROR internal error
3500 * @pre pkgmgrinfo_appinfo_get_appinfo()
3501 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3502 * @see pkgmgrinfo_appinfo_get_appid()
3504 static int get_app_api_version(const char *appid)
3507 char *api_version = NULL;
3508 pkgmgrinfo_appinfo_h handle = NULL;
3509 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3510 if (ret != PMINFO_R_OK)
3512 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3513 if (ret != PMINFO_R_OK) {
3514 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3517 printf("app api_version: %s\n", api_version);
3518 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3523 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3526 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3527 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3528 * @brief This API gets the list of permission for a particular application
3530 * @par This API is for package-manager client application
3531 * @par Sync (or) Async : Synchronous API
3532 * @param[in] handle pointer to the application info handle.
3533 * @param[in] permission_func callback function for list
3534 * @param[in] user_data user data to be passed to callback function
3535 * @return 0 if success, error code(<0) if fail
3536 * @retval PMINFO_R_OK success
3537 * @retval PMINFO_R_EINVAL invalid argument
3538 * @retval PMINFO_R_ERROR internal error
3539 * @pre pkgmgrinfo_appinfo_get_appinfo()
3540 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3542 int permission_func(const char *name, void *user_data)
3544 if (strcmp(name, (char *)user_data) == 0)
3550 static int list_permission(const char *appid, char *permission)
3553 pkgmgrinfo_appinfo_h handle;
3554 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3555 if (ret != PMINFO_R_OK)
3557 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3558 if (ret != PMINFO_R_OK) {
3559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3562 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3567 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3568 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3571 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3572 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3573 * @brief This API gets the list of category for a particular application
3575 * @par This API is for package-manager client application
3576 * @par Sync (or) Async : Synchronous API
3577 * @param[in] handle pointer to the application info handle.
3578 * @param[in] category_func callback function for list
3579 * @param[in] user_data user data to be passed to callback function
3580 * @return 0 if success, error code(<0) if fail
3581 * @retval PMINFO_R_OK success
3582 * @retval PMINFO_R_EINVAL invalid argument
3583 * @retval PMINFO_R_ERROR internal error
3584 * @pre pkgmgrinfo_appinfo_get_appinfo()
3585 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3587 int category_func(const char *name, void *user_data)
3589 if (strcmp(name, (char *)user_data) == 0)
3595 static int list_category(const char *appid, char *category)
3598 pkgmgrinfo_appinfo_h handle;
3599 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3600 if (ret != PMINFO_R_OK)
3602 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3603 if (ret != PMINFO_R_OK) {
3604 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3607 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3612 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3613 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3616 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3617 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3618 * @brief This API gets the list of metadata for a particular application
3620 * @par This API is for package-manager client application
3621 * @par Sync (or) Async : Synchronous API
3622 * @param[in] handle pointer to the application info handle.
3623 * @param[in] metadata_func callback function for list
3624 * @param[in] user_data user data to be passed to callback function
3625 * @return 0 if success, error code(<0) if fail
3626 * @retval PMINFO_R_OK success
3627 * @retval PMINFO_R_EINVAL invalid argument
3628 * @retval PMINFO_R_ERROR internal error
3629 * @pre pkgmgrinfo_appinfo_get_appinfo()
3630 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3632 int metadata_func(const char *key, const char *value, void *user_data)
3634 if (strcmp(key, (char *)user_data) == 0) {
3635 printf("Value is %s\n", value);
3642 static int list_metadata(const char *appid, char *key)
3645 pkgmgrinfo_appinfo_h handle;
3646 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3647 if (ret != PMINFO_R_OK)
3649 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3650 if (ret != PMINFO_R_OK) {
3651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3654 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3659 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3660 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3664 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3665 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3666 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3667 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3668 * @brief This API gets the list of app-control for a particular application
3670 * @par This API is for package-manager client application
3671 * @par Sync (or) Async : Synchronous API
3672 * @param[in] handle pointer to the application info handle.
3673 * @param[in] appcontrol_func callback function for list
3674 * @param[in] user_data user data to be passed to callback function
3675 * @param[in] uid the addressee user id of the instruction
3676 * @return 0 if success, error code(<0) if fail
3677 * @retval PMINFO_R_OK success
3678 * @retval PMINFO_R_EINVAL invalid argument
3679 * @retval PMINFO_R_ERROR internal error
3680 * @pre pkgmgrinfo_appinfo_get_appinfo()
3681 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3683 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3688 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3689 for (i = 0; i < oc; i++) {
3690 if (strcmp(operation[i], (char *)user_data) == 0)
3697 static int check_operation(const char *appid, char *operation)
3700 pkgmgrinfo_appinfo_h handle;
3701 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3702 if (ret != PMINFO_R_OK)
3704 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3705 if (ret != PMINFO_R_OK) {
3706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3709 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3714 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3715 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3720 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3721 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3724 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3725 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3726 * @brief This API gets the list of splashscreen for a particular application
3728 * @par This API is for package-manager client application
3729 * @par Sync (or) Async : Synchronous API
3730 * @param[in] handle pointer to the application info handle.
3731 * @param[in] splash_screen_func callback function for list
3732 * @param[in] user_data user data to be passed to callback function
3733 * @return 0 if success, error code(<0) if fail
3734 * @retval PMINFO_R_OK success
3735 * @retval PMINFO_R_EINVAL invalid argument
3736 * @retval PMINFO_R_ERROR internal error
3737 * @pre pkgmgrinfo_appinfo_get_appinfo()
3738 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3741 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3742 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3745 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3746 * @brief This API gets the application 'nodisplay' value from the app ID
3748 * @par This API is for package-manager client application
3749 * @par Sync (or) Async : Synchronous API
3751 * @param[in] handle pointer to application info handle
3752 * @param[out] nodisplay pointer to hold package nodisplay value
3753 * @return 0 if success, error code(<0) if fail
3754 * @retval PMINFO_R_OK success
3755 * @retval PMINFO_R_EINVAL invalid argument
3756 * @retval PMINFO_R_ERROR internal error
3757 * @pre pkgmgrinfo_appinfo_get_appinfo()
3758 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3759 * @see pkgmgrinfo_appinfo_get_appid()
3760 * @see pkgmgrinfo_appinfo_is_multiple()
3762 static int get_app_nodisplay(const char *appid)
3766 pkgmgrinfo_appinfo_h handle;
3767 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3768 if (ret != PMINFO_R_OK)
3770 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3771 if (ret != PMINFO_R_OK) {
3772 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3775 printf("app nodisplay: %d\n", nodisplay);
3776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3781 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3784 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3785 * @brief This API gets the application 'multiple' value from the app ID
3787 * @par This API is for package-manager client application
3788 * @par Sync (or) Async : Synchronous API
3790 * @param[in] handle pointer to application info handle
3791 * @param[out] multiple pointer to hold package multiple value
3792 * @return 0 if success, error code(<0) if fail
3793 * @retval PMINFO_R_OK success
3794 * @retval PMINFO_R_EINVAL invalid argument
3795 * @retval PMINFO_R_ERROR internal error
3796 * @pre pkgmgrinfo_appinfo_get_appinfo()
3797 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3798 * @see pkgmgrinfo_appinfo_get_appid()
3799 * @see pkgmgrinfo_appinfo_is_nodisplay()
3801 static int get_app_multiple(const char *appid)
3805 pkgmgrinfo_appinfo_h handle;
3806 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3807 if (ret != PMINFO_R_OK)
3809 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3810 if (ret != PMINFO_R_OK) {
3811 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3814 printf("app multiple: %d\n", multiple);
3815 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3820 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3823 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3824 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3825 * application launching effect. If fales, indicator will be hidden during application launching effect
3827 * @par This API is for package-manager client application
3828 * @par Sync (or) Async : Synchronous API
3830 * @param[in] handle pointer to application info handle
3831 * @param[out] indicator_disp contains indicator display status for application launching effect
3832 * @return 0 if success, error code(<0) if fail
3833 * @retval PMINFO_R_OK success
3834 * @retval PMINFO_R_EINVAL invalid argument
3835 * @retval PMINFO_R_ERROR internal error
3836 * @pre pkgmgrinfo_appinfo_get_appinfo()
3837 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3838 * @see pkgmgrinfo_appinfo_get_appid()
3839 * @see pkgmgrinfo_appinfo_is_nodisplay()
3841 static int get_app_indicator_display(const char *appid)
3844 bool indicator_disp;
3845 pkgmgrinfo_appinfo_h handle;
3846 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3847 if (ret != PMINFO_R_OK)
3849 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3850 if (ret != PMINFO_R_OK){
3851 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3854 printf("app indicator disp : %d\n", indicator_disp);
3855 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3860 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3863 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3864 * @brief This API gets the application 'taskmanage' value from the app ID
3866 * @par This API is for package-manager client application
3867 * @par Sync (or) Async : Synchronous API
3869 * @param[in] handle pointer to application info handle
3870 * @param[out] taskmanage pointer to hold package taskmanage value
3871 * @return 0 if success, error code(<0) if fail
3872 * @retval PMINFO_R_OK success
3873 * @retval PMINFO_R_EINVAL invalid argument
3874 * @retval PMINFO_R_ERROR internal error
3875 * @pre pkgmgrinfo_appinfo_get_appinfo()
3876 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3877 * @see pkgmgrinfo_appinfo_get_appid()
3878 * @see pkgmgrinfo_appinfo_is_multiple()
3880 static int get_app_taskmanage(const char *appid)
3884 pkgmgrinfo_appinfo_h handle;
3885 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3886 if (ret != PMINFO_R_OK)
3888 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3889 if (ret != PMINFO_R_OK) {
3890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3893 printf("app taskmanage: %d\n", taskmanage);
3894 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3899 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3902 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3903 * @brief This API gets the application 'taskmanage' value from the app ID
3905 * @par This API is for package-manager client application
3906 * @par Sync (or) Async : Synchronous API
3908 * @param[in] handle pointer to application info handle
3909 * @param[out] enabled pointer to hold package enabled value
3910 * @return 0 if success, error code(<0) if fail
3911 * @retval PMINFO_R_OK success
3912 * @retval PMINFO_R_EINVAL invalid argument
3913 * @retval PMINFO_R_ERROR internal error
3914 * @pre pkgmgrinfo_appinfo_get_appinfo()
3915 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3916 * @see pkgmgrinfo_appinfo_get_appid()
3917 * @see pkgmgrinfo_appinfo_is_multiple()
3919 static int get_app_enabled(const char *appid)
3923 pkgmgrinfo_appinfo_h handle;
3924 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3925 if (ret != PMINFO_R_OK)
3927 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3928 if (ret != PMINFO_R_OK) {
3929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3932 printf("app enabled: %d\n", enabled);
3933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3938 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3941 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3942 * @brief This API gets the application 'onboot' value from the app ID
3944 * @par This API is for package-manager client application
3945 * @par Sync (or) Async : Synchronous API
3947 * @param[in] handle pointer to application info handle
3948 * @param[out] onboot pointer to hold package onboot value
3949 * @return 0 if success, error code(<0) if fail
3950 * @retval PMINFO_R_OK success
3951 * @retval PMINFO_R_EINVAL invalid argument
3952 * @retval PMINFO_R_ERROR internal error
3953 * @pre pkgmgrinfo_appinfo_get_appinfo()
3954 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3955 * @see pkgmgrinfo_appinfo_get_appid()
3956 * @see pkgmgrinfo_appinfo_is_multiple()
3958 static int get_app_onboot(const char *appid)
3962 pkgmgrinfo_appinfo_h handle;
3963 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3964 if (ret != PMINFO_R_OK)
3966 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3967 if (ret != PMINFO_R_OK) {
3968 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3971 printf("app onboot: %d\n", onboot);
3972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3977 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3980 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3981 * @brief This API gets the application 'autorestart' value from the app ID
3983 * @par This API is for package-manager client application
3984 * @par Sync (or) Async : Synchronous API
3986 * @param[in] handle pointer to application info handle
3987 * @param[out] autorestart pointer to hold package autorestart value
3988 * @return 0 if success, error code(<0) if fail
3989 * @retval PMINFO_R_OK success
3990 * @retval PMINFO_R_EINVAL invalid argument
3991 * @retval PMINFO_R_ERROR internal error
3992 * @pre pkgmgrinfo_appinfo_get_appinfo()
3993 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3994 * @see pkgmgrinfo_appinfo_get_appid()
3995 * @see pkgmgrinfo_appinfo_is_multiple()
3997 static int get_app_autorestart(const char *appid)
4001 pkgmgrinfo_appinfo_h handle;
4002 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4003 if (ret != PMINFO_R_OK)
4005 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4006 if (ret != PMINFO_R_OK) {
4007 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4010 printf("app autorestart: %d\n", autorestart);
4011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4016 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4019 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4020 * @brief This API gets the value for given application is main app or not from handle
4022 * @par This API is for package-manager client application
4023 * @par Sync (or) Async : Synchronous API
4025 * @param[in] handle pointer to application info handle
4026 * @param[out] mainapp pointer to hold package mainapp is or not
4027 * @return 0 if success, error code(<0) if fail
4028 * @retval PMINFO_R_OK success
4029 * @retval PMINFO_R_EINVAL invalid argument
4030 * @retval PMINFO_R_ERROR internal error
4031 * @pre pkgmgrinfo_appinfo_get_appinfo()
4032 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4033 * @see pkgmgrinfo_appinfo_get_appid()
4034 * @see pkgmgrinfo_appinfo_is_multiple()
4036 static int get_app_mainapp(const char *appid)
4040 pkgmgrinfo_appinfo_h handle;
4041 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4042 if (ret != PMINFO_R_OK)
4044 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4045 if (ret != PMINFO_R_OK) {
4046 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4049 printf("mainapp: %d\n", mainapp);
4050 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4055 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4059 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4060 * @brief This API gets the value for given application is preload or not from handle
4062 * @par This API is for package-manager client application
4063 * @par Sync (or) Async : Synchronous API
4065 * @param[in] handle pointer to application info handle
4066 * @param[out] preload pointer to hold preload is or not
4067 * @return 0 if success, error code(<0) if fail
4068 * @retval PMINFO_R_OK success
4069 * @retval PMINFO_R_EINVAL invalid argument
4070 * @retval PMINFO_R_ERROR internal error
4071 * @pre pkgmgrinfo_appinfo_get_appinfo()
4072 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4073 * @see pkgmgrinfo_appinfo_get_appid()
4074 * @see pkgmgrinfo_appinfo_is_multiple()
4076 static int get_app_preload(const char *appid)
4080 pkgmgrinfo_appinfo_h handle = NULL;
4081 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4082 if (ret != PMINFO_R_OK)
4084 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4085 if (ret != PMINFO_R_OK) {
4086 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4089 printf("preload: %d\n", preload);
4090 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4095 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4098 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4099 * @brief This API gets the value for given application is submode or not from handle
4101 * @par This API is for package-manager client application
4102 * @par Sync (or) Async : Synchronous API
4104 * @param[in] handle pointer to application info handle
4105 * @param[out] submode pointer to hold submode is or not
4106 * @return 0 if success, error code(<0) if fail
4107 * @retval PMINFO_R_OK success
4108 * @retval PMINFO_R_EINVAL invalid argument
4109 * @retval PMINFO_R_ERROR internal error
4110 * @pre pkgmgrinfo_appinfo_get_appinfo()
4111 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4112 * @see pkgmgrinfo_appinfo_get_appid()
4113 * @see pkgmgrinfo_appinfo_is_multiple()
4115 static int get_app_submode(const char *appid)
4119 pkgmgrinfo_appinfo_h handle = NULL;
4120 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4121 if (ret != PMINFO_R_OK)
4123 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4124 if (ret != PMINFO_R_OK) {
4125 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4128 printf("submode: %d\n", submode);
4129 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4134 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4137 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4138 * @brief This API gets the value for given application is process_pool or not from handle
4140 * @par This API is for package-manager client application
4141 * @par Sync (or) Async : Synchronous API
4143 * @param[in] handle pointer to application info handle
4144 * @param[out] process_pool pointer to hold process_pool is or not
4145 * @return 0 if success, error code(<0) if fail
4146 * @retval PMINFO_R_OK success
4147 * @retval PMINFO_R_EINVAL invalid argument
4148 * @retval PMINFO_R_ERROR internal error
4149 * @pre pkgmgrinfo_appinfo_get_appinfo()
4150 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4151 * @see pkgmgrinfo_appinfo_get_appid()
4153 static int get_app_process_pool(const char *appid)
4156 bool process_pool = 0;
4157 pkgmgrinfo_appinfo_h handle = NULL;
4158 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4159 if (ret != PMINFO_R_OK)
4161 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4162 if (ret != PMINFO_R_OK) {
4163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4166 printf("process_pool: %d\n", process_pool);
4167 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4172 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4175 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4176 * @brief This API gets the installed storage location of the application
4178 * @par This API is for package-manager client application
4179 * @par Sync (or) Async : Synchronous API
4181 * @param[in] handle pointer to the application info handle.
4182 * @param[out] app_type pointer to hold installed storage location
4183 * @return 0 if success, error code(<0) if fail
4184 * @retval PMINFO_R_OK success
4185 * @retval PMINFO_R_EINVAL invalid argument
4186 * @retval PMINFO_R_ERROR internal error
4187 * @pre pkgmgrinfo_appinfo_get_appinfo()
4188 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4189 * @see pkgmgrinfo_appinfo_get_appid()
4191 static int get_app_installed_location(const char *appid)
4194 pkgmgrinfo_installed_storage storage;
4195 pkgmgrinfo_appinfo_h handle = NULL;
4196 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4197 if (ret != PMINFO_R_OK)
4199 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4200 if (ret != PMINFO_R_OK) {
4201 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4204 printf("Installed storage location : %d\n", storage);
4205 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4210 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4214 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4215 * @brief This API checks if the application has the given category
4217 * @par This API is for package-manager client application
4218 * @par Sync (or) Async : Synchronous API
4220 * @param[in] handle pointer to the application info handle
4221 * @param[in] category category
4222 * @param[out] exist value Gets whether the application has the given category
4223 * @return 0 if success, error code(<0) if fail
4224 * @retval PMINFO_R_OK success
4225 * @retval PMINFO_R_EINVAL invalid argument
4226 * @retval PMINFO_R_ERROR internal error
4228 static int is_category_exist(const char *appid, const char *category)
4231 pkgmgrinfo_appinfo_h handle;
4234 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4235 if (ret != PMINFO_R_OK)
4238 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4239 if (ret != PMINFO_R_OK) {
4240 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4244 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4249 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4252 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4253 * @brief This API gets the application 'ui_gadget' value from the app ID
4255 * @par This API is for package-manager client application
4256 * @par Sync (or) Async : Synchronous API
4258 * @param[in] handle pointer to application info handle
4259 * @param[out] ui_gadget pointer to hold package ui_gadget value
4260 * @return 0 if success, error code(<0) if fail
4261 * @retval PMINFO_R_OK success
4262 * @retval PMINFO_R_EINVAL invalid argument
4263 * @pre pkgmgrinfo_appinfo_get_appinfo()
4264 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4266 static int get_app_ui_gadget(const char *appid)
4270 pkgmgrinfo_appinfo_h handle = NULL;
4271 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4272 if (ret != PMINFO_R_OK)
4274 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4275 if (ret != PMINFO_R_OK) {
4276 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4279 printf("app ui_gadget: %d\n", ui_gadget);
4280 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4285 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4288 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4289 * @brief This API gets the application 'support_disable' value from the app ID
4291 * @par This API is for package-manager client application
4292 * @par Sync (or) Async : Synchronous API
4294 * @param[in] handle pointer to application info handle
4295 * @param[out] support_disable pointer to hold package support_disable value
4296 * @return 0 if success, error code(<0) if fail
4297 * @retval PMINFO_R_OK success
4298 * @retval PMINFO_R_EINVAL invalid argument
4299 * @pre pkgmgrinfo_appinfo_get_appinfo()
4300 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4302 static int get_app_support_disable(const char *appid)
4305 bool support_disable;
4306 pkgmgrinfo_appinfo_h handle = NULL;
4307 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4308 if (ret != PMINFO_R_OK)
4310 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4311 if (ret != PMINFO_R_OK) {
4312 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4315 printf("app support_disable: %d\n", support_disable);
4316 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4321 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4324 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4325 * @brief This API gets whethere the given application is global application or user application
4327 * @par This API is for package-manager client application
4328 * @par Sync (or) Async : Synchronous API
4330 * @param[in] handle pointer to application info handle
4331 * @param[in] global pointer to hold application global value
4332 * @return 0 if success, error code(<0) if fail
4333 * @retval PMINFO_R_OK success
4334 * @retval PMINFO_R_EINVAL invalid argument
4335 * @retval PMINFO_R_ERROR internal error
4336 * @pre pkgmgrinfo_appinfo_get_appinfo()
4337 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4338 * @see pkgmgrinfo_appinfo_get_appid()
4339 static int get_app_is_global(const char *appid)
4343 pkgmgrinfo_appinfo_h handle = NULL;
4344 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4345 if (ret != PMINFO_R_OK)
4347 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4348 if (ret != PMINFO_R_OK) {
4349 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4352 printf("app is_global: %d\n", global);
4353 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4358 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4361 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4362 * @brief This API destroys the application information handle freeing up all the resources
4364 * @par This API is for package-manager client application
4365 * @par Sync (or) Async : Synchronous API
4367 * @param[in] handle pointer to the application info handle.
4368 * @return 0 if success, error code(<0) if fail
4369 * @retval PMINFO_R_OK success
4370 * @retval PMINFO_R_EINVAL invalid argument
4371 * @retval PMINFO_R_ERROR internal error
4372 * @pre pkgmgrinfo_appinfo_get_appinfo()
4374 * @see pkgmgrinfo_appinfo_get_pkgid()
4375 * @see pkgmgrinfo_appinfo_is_multiple()
4377 static int get_app_type(const char *appid)
4381 pkgmgrinfo_appinfo_h handle;
4382 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4383 if (ret != PMINFO_R_OK)
4385 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4386 if (ret != PMINFO_R_OK) {
4387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4390 printf("apptype: %s\n", type);
4391 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4396 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4399 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4400 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4401 The query will search the entire application information collected from the manifest file of all the installed packages
4403 * @par This API is for package-manager client application
4404 * @par Sync (or) Async : Synchronous API
4406 * @param[out] handle pointer to the application info filter handle.
4407 * @return 0 if success, error code(<0) if fail
4408 * @retval PMINFO_R_OK success
4409 * @retval PMINFO_R_EINVAL invalid argument
4410 * @retval PMINFO_R_ERROR internal error
4412 * @post pkgmgrinfo_appinfo_filter_destroy()
4413 * @see pkgmgrinfo_appinfo_filter_count()
4414 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4416 static int get_capp_count()
4420 pkgmgrinfo_appinfo_filter_h handle;
4421 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4422 if (ret != PMINFO_R_OK)
4424 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4425 if (ret != PMINFO_R_OK) {
4426 pkgmgrinfo_appinfo_filter_destroy(handle);
4429 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4430 if (ret != PMINFO_R_OK) {
4431 pkgmgrinfo_appinfo_filter_destroy(handle);
4434 printf("No of capp: %d\n", count);
4435 pkgmgrinfo_appinfo_filter_destroy(handle);
4440 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4443 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4444 * @brief This API destroys the application information filter handle freeing up all the resources
4446 * @par This API is for package-manager client application
4447 * @par Sync (or) Async : Synchronous API
4449 * @param[in] handle pointer to the application info filter handle.
4450 * @return 0 if success, error code(<0) if fail
4451 * @retval PMINFO_R_OK success
4452 * @retval PMINFO_R_EINVAL invalid argument
4453 * @retval PMINFO_R_ERROR internal error
4454 * @pre pkgmgrinfo_appinfo_filter_create()
4456 * @see pkgmgrinfo_appinfo_filter_count()
4457 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4459 static int get_capp_count()
4463 pkgmgrinfo_appinfo_filter_h handle;
4464 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4465 if (ret != PMINFO_R_OK)
4467 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4468 if (ret != PMINFO_R_OK) {
4469 pkgmgrinfo_appinfo_filter_destroy(handle);
4472 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4473 if (ret != PMINFO_R_OK) {
4474 pkgmgrinfo_appinfo_filter_destroy(handle);
4477 printf("No of capp: %d\n", count);
4478 pkgmgrinfo_appinfo_filter_destroy(handle);
4483 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4486 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4487 * @brief This API adds a boolean filter property to the filter handle
4489 * @par This API is for package-manager client application
4490 * @par Sync (or) Async : Synchronous API
4492 * @param[in] handle pointer to the application info filter handle.
4493 * @param[in] property boolean property name.
4494 * @param[in] value value corresponding to the property.
4495 * @return 0 if success, error code(<0) if fail
4496 * @retval PMINFO_R_OK success
4497 * @retval PMINFO_R_EINVAL invalid argument
4498 * @retval PMINFO_R_ERROR internal error
4499 * @pre pkgmgrinfo_appinfo_filter_create()
4500 * @post pkgmgrinfo_appinfo_filter_destroy()
4501 * @see pkgmgrinfo_appinfo_filter_count()
4502 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4504 static int get_taskmanageable_app_count()
4508 pkgmgrinfo_appinfo_filter_h handle;
4509 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4510 if (ret != PMINFO_R_OK)
4512 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4513 if (ret != PMINFO_R_OK) {
4514 pkgmgrinfo_appinfo_filter_destroy(handle);
4517 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4518 if (ret != PMINFO_R_OK) {
4519 pkgmgrinfo_appinfo_filter_destroy(handle);
4522 printf("No of taskmanageable apps: %d\n", count);
4523 pkgmgrinfo_appinfo_filter_destroy(handle);
4528 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4529 const char *property, const bool value);
4532 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4533 * @brief This API adds an integer filter property to the filter handle
4535 * @par This API is for package-manager client application
4536 * @par Sync (or) Async : Synchronous API
4538 * @param[in] handle pointer to the application info filter handle.
4539 * @param[in] property integer property name.
4540 * @param[in] value value corresponding to the property.
4541 * @return 0 if success, error code(<0) if fail
4542 * @retval PMINFO_R_OK success
4543 * @retval PMINFO_R_EINVAL invalid argument
4544 * @retval PMINFO_R_ERROR internal error
4545 * @pre pkgmgrinfo_appinfo_filter_create()
4546 * @post pkgmgrinfo_appinfo_filter_destroy()
4547 * @see pkgmgrinfo_appinfo_filter_count()
4548 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4550 static int get_taskmanageable_app_count()
4554 pkgmgrinfo_appinfo_filter_h handle;
4555 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4556 if (ret != PMINFO_R_OK)
4558 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4559 if (ret != PMINFO_R_OK) {
4560 pkgmgrinfo_appinfo_filter_destroy(handle);
4563 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4564 if (ret != PMINFO_R_OK) {
4565 pkgmgrinfo_appinfo_filter_destroy(handle);
4568 printf("No of apps: %d\n", count);
4569 pkgmgrinfo_appinfo_filter_destroy(handle);
4574 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4575 const char *property, const int value);
4578 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4579 * @brief This API adds a string filter property to the filter handle
4581 * @par This API is for package-manager client application
4582 * @par Sync (or) Async : Synchronous API
4584 * @param[in] handle pointer to the application info filter handle.
4585 * @param[in] property string property name.
4586 * @param[in] value value corresponding to the property.
4587 * @return 0 if success, error code(<0) if fail
4588 * @retval PMINFO_R_OK success
4589 * @retval PMINFO_R_EINVAL invalid argument
4590 * @retval PMINFO_R_ERROR internal error
4591 * @pre pkgmgrinfo_appinfo_filter_create()
4592 * @post pkgmgrinfo_appinfo_filter_destroy()
4593 * @see pkgmgrinfo_appinfo_filter_count()
4594 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4596 static int get_capp_count()
4600 pkgmgrinfo_appinfo_filter_h handle;
4601 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4602 if (ret != PMINFO_R_OK)
4604 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4605 if (ret != PMINFO_R_OK) {
4606 pkgmgrinfo_appinfo_filter_destroy(handle);
4609 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4610 if (ret != PMINFO_R_OK) {
4611 pkgmgrinfo_appinfo_filter_destroy(handle);
4614 printf("No of capp: %d\n", count);
4615 pkgmgrinfo_appinfo_filter_destroy(handle);
4620 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4621 const char *property, const char *value);
4624 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4625 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4627 * @par This API is for package-manager client application
4628 * @par Sync (or) Async : Synchronous API
4630 * @param[in] handle pointer to the application info filter handle.
4631 * @param[in] app_cb callback function.
4632 * @param[in] user_data user data to be passed to the callback function
4633 * @return 0 if success, error code(<0) if fail
4634 * @retval PMINFO_R_OK success
4635 * @retval PMINFO_R_EINVAL invalid argument
4636 * @retval PMINFO_R_ERROR internal error
4637 * @pre pkgmgrinfo_appinfo_filter_create()
4638 * @post pkgmgrinfo_appinfo_filter_destroy()
4639 * @see pkgmgrinfo_appinfo_filter_count()
4641 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4644 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4645 printf("appid : %s\n", appid);
4649 static int get_capp_list()
4652 pkgmgrinfo_appinfo_filter_h handle;
4653 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4654 if (ret != PMINFO_R_OK)
4656 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4657 if (ret != PMINFO_R_OK) {
4658 pkgmgrinfo_appinfo_filter_destroy(handle);
4661 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4662 if (ret != PMINFO_R_OK) {
4663 pkgmgrinfo_appinfo_filter_destroy(handle);
4666 pkgmgrinfo_appinfo_filter_destroy(handle);
4671 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4672 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4673 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4674 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4677 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4678 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4679 * @brief This API counts the application that satisfy the filter conditions
4681 * @par This API is for package-manager client application
4682 * @par Sync (or) Async : Synchronous API
4684 * @param[in] handle pointer to the application info filter handle.
4685 * @param[in] count pointer to store count value
4686 * @param[in] uid the addressee user id of the instruction
4687 * @return 0 if success, error code(<0) if fail
4688 * @retval PMINFO_R_OK success
4689 * @retval PMINFO_R_EINVAL invalid argument
4690 * @retval PMINFO_R_ERROR internal error
4691 * @pre pkgmgrinfo_appinfo_filter_create()
4692 * @post pkgmgrinfo_appinfo_filter_destroy()
4693 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4695 static int get_capp_count()
4699 pkgmgrinfo_appinfo_filter_h handle;
4700 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4701 if (ret != PMINFO_R_OK)
4703 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4704 if (ret != PMINFO_R_OK) {
4705 pkgmgrinfo_appinfo_filter_destroy(handle);
4708 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4709 if (ret != PMINFO_R_OK) {
4710 pkgmgrinfo_appinfo_filter_destroy(handle);
4713 printf("No of capp: %d\n", count);
4714 pkgmgrinfo_appinfo_filter_destroy(handle);
4719 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4720 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4722 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4723 * @brief This API creates the application's metadata information filter handle from db.
4725 * @par This API is for package-manager client application
4726 * @par Sync (or) Async : Synchronous API
4728 * @param[out] handle pointer to the application metadata info filter handle.
4729 * @return 0 if success, error code(<0) if fail
4730 * @retval PMINFO_R_OK success
4731 * @retval PMINFO_R_EINVAL invalid argument
4732 * @retval PMINFO_R_ERROR internal error
4734 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4735 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4737 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4740 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4741 printf("appid : %s\n", appid);
4745 static int get_app_list(const char *mkey, const char *mvalue)
4748 pkgmgrinfo_appinfo_metadata_filter_h handle;
4749 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4750 if (ret != PMINFO_R_OK)
4752 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4753 if (ret != PMINFO_R_OK) {
4754 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4757 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4758 if (ret != PMINFO_R_OK) {
4759 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4762 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4767 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4770 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4771 * @brief This API destroys the application's metadata information filter handle.
4773 * @par This API is for package-manager client application
4774 * @par Sync (or) Async : Synchronous API
4776 * @param[in] handle pointer to the application metadata info filter handle.
4777 * @return 0 if success, error code(<0) if fail
4778 * @retval PMINFO_R_OK success
4779 * @retval PMINFO_R_EINVAL invalid argument
4780 * @retval PMINFO_R_ERROR internal error
4781 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4783 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4785 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4788 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4789 printf("appid : %s\n", appid);
4793 static int get_app_list(const char *mkey, const char *mvalue)
4796 pkgmgrinfo_appinfo_metadata_filter_h handle;
4797 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4798 if (ret != PMINFO_R_OK)
4800 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4801 if (ret != PMINFO_R_OK) {
4802 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4805 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4806 if (ret != PMINFO_R_OK) {
4807 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4810 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4815 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4818 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4819 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4820 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4822 * @par This API is for package-manager client application
4823 * @par Sync (or) Async : Synchronous API
4825 * @param[in] handle pointer to the application metadata info filter handle.
4826 * @param[in] key pointer to metadata key
4827 * @param[in] value pointer to metadata value
4828 * @return 0 if success, error code(<0) if fail
4829 * @retval PMINFO_R_OK success
4830 * @retval PMINFO_R_EINVAL invalid argument
4831 * @retval PMINFO_R_ERROR internal error
4832 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4833 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4834 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4836 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4839 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4840 printf("appid : %s\n", appid);
4844 static int get_app_list(const char *mkey, const char *mvalue)
4847 pkgmgrinfo_appinfo_metadata_filter_h handle;
4848 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4849 if (ret != PMINFO_R_OK)
4851 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4852 if (ret != PMINFO_R_OK) {
4853 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4856 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4857 if (ret != PMINFO_R_OK) {
4858 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4861 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4866 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4867 const char *key, const char *value);
4870 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4871 * @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)
4872 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4873 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4874 * negative value, no more callbacks will be called and API will return.
4876 * @par This API is for package-manager client application
4877 * @par Sync (or) Async : Synchronous API
4879 * @param[in] handle pointer to the application metadata info filter handle.
4880 * @param[in] app_cb function pointer to callback
4881 * @param[in] user_data pointer to user data
4882 * @param[in] uid the addressee user id of the instruction
4883 * @return 0 if success, error code(<0) if fail
4884 * @retval PMINFO_R_OK success
4885 * @retval PMINFO_R_EINVAL invalid argument
4886 * @retval PMINFO_R_ERROR internal error
4887 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4888 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4890 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4893 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4894 printf("appid : %s\n", appid);
4898 static int get_app_list(const char *mkey, const char *mvalue)
4901 pkgmgrinfo_appinfo_metadata_filter_h handle;
4902 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4903 if (ret != PMINFO_R_OK)
4905 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4906 if (ret != PMINFO_R_OK) {
4907 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4910 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4911 if (ret != PMINFO_R_OK) {
4912 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4915 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4920 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4921 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4922 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4923 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4925 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4926 * @brief This API creates the package cert information handle to get data from db.
4928 * @par This API is for package-manager client application
4929 * @par Sync (or) Async : Synchronous API
4931 * @param[out] handle pointer to the package cert handle.
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
4937 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4938 * @see pkgmgrinfo_pkginfo_get_cert_value()
4939 * @see pkgmgrinfo_pkginfo_load_certinfo()
4941 static int get_cert_info(const char *pkgid)
4944 pkgmgrinfo_certinfo_h handle;
4945 char *auth_cert = NULL;
4946 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4947 if (ret != PMINFO_R_OK)
4949 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4950 if (ret != PMINFO_R_OK) {
4951 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4954 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4955 if (ret != PMINFO_R_OK) {
4956 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4959 printf("Author root certificate: %s\n", auth_root);
4960 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4965 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4968 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4969 * @brief This API loads the package cert information handle with data from db.
4971 * @par This API is for package-manager client application
4972 * @par Sync (or) Async : Synchronous API
4974 * @param[in] pkgid pointer to the package ID.
4975 * @param[in] handle pointer to the package cert handle.
4976 * @return 0 if success, error code(<0) if fail
4977 * @retval PMINFO_R_OK success
4978 * @retval PMINFO_R_EINVAL invalid argument
4979 * @retval PMINFO_R_ERROR internal error
4980 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4981 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4982 * @see pkgmgrinfo_pkginfo_get_cert_value()
4984 static int get_cert_info(const char *pkgid)
4987 pkgmgrinfo_certinfo_h handle;
4988 char *auth_cert = NULL;
4989 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4990 if (ret != PMINFO_R_OK)
4992 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4993 if (ret != PMINFO_R_OK) {
4994 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4997 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4998 if (ret != PMINFO_R_OK) {
4999 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5002 printf("Author root certificate: %s\n", auth_root);
5003 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5008 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5011 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5012 * @brief This API gets the package cert information from the handle
5014 * @par This API is for package-manager client application
5015 * @par Sync (or) Async : Synchronous API
5017 * @param[in] handle pointer to the package cert handle.
5018 * @param[in] cert_type certificate type
5019 * @param[out] cert_value pointer to hold certificate value
5020 * @return 0 if success, error code(<0) if fail
5021 * @retval PMINFO_R_OK success
5022 * @retval PMINFO_R_EINVAL invalid argument
5023 * @retval PMINFO_R_ERROR internal error
5024 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5025 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5026 * @see pkgmgrinfo_pkginfo_load_certinfo()
5028 static int get_cert_info(const char *pkgid)
5031 pkgmgrinfo_certinfo_h handle;
5032 char *auth_cert = NULL;
5033 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5034 if (ret != PMINFO_R_OK)
5036 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5037 if (ret != PMINFO_R_OK) {
5038 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5041 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5042 if (ret != PMINFO_R_OK) {
5043 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5046 printf("Author root certificate: %s\n", auth_root);
5047 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5052 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5055 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5056 * @brief This API destroys the package cert information handle freeing up all the resources
5058 * @par This API is for package-manager client application
5059 * @par Sync (or) Async : Synchronous API
5061 * @param[in] handle pointer to the package cert handle.
5062 * @return 0 if success, error code(<0) if fail
5063 * @retval PMINFO_R_OK success
5064 * @retval PMINFO_R_EINVAL invalid argument
5065 * @retval PMINFO_R_ERROR internal error
5066 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5068 * @see pkgmgrinfo_pkginfo_load_certinfo()
5070 static int get_cert_info(const char *pkgid)
5073 pkgmgrinfo_certinfo_h handle;
5074 char *auth_cert = NULL;
5075 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5076 if (ret != PMINFO_R_OK)
5078 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5079 if (ret != PMINFO_R_OK) {
5080 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5083 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5084 if (ret != PMINFO_R_OK) {
5085 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5088 printf("Author root certificate: %s\n", auth_root);
5089 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5094 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5097 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5098 * @brief This API deletes the package cert information from DB
5100 * @par This API is for package-manager client application
5101 * @par Sync (or) Async : Synchronous API
5103 * @param[in] pkgid pointer to the package ID.
5104 * @return 0 if success, error code(<0) if fail
5105 * @retval PMINFO_R_OK success
5106 * @retval PMINFO_R_EINVAL invalid argument
5107 * @retval PMINFO_R_ERROR internal error
5111 static int delete_cert_info(const char *pkgid)
5114 ret = pkgmgrinfo_delete_certinfo(pkgid);
5115 if (ret != PMINFO_R_OK)
5121 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5122 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5125 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5126 * @brief This API creates the package cert information handle to set data in db.
5128 * @par This API is for package-manager client application
5129 * @par Sync (or) Async : Synchronous API
5131 * @param[out] handle pointer to the package cert handle.
5132 * @return 0 if success, error code(<0) if fail
5133 * @retval PMINFO_R_OK success
5134 * @retval PMINFO_R_EINVAL invalid argument
5135 * @retval PMINFO_R_ERROR internal error
5137 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5138 * @see pkgmgrinfo_set_cert_value()
5139 * @see pkgmgrinfo_save_certinfo()
5141 static int set_cert_in_db(const char *pkgid)
5144 pkgmgrinfo_instcertinfo_h handle;
5145 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5146 if (ret != PMINFO_R_OK)
5148 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5149 if (ret != PMINFO_R_OK) {
5150 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5153 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5154 if (ret != PMINFO_R_OK) {
5155 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5158 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5163 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5166 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5167 * @brief This API sets the package cert information in the handle.
5169 * @par This API is for package-manager client application
5170 * @par Sync (or) Async : Synchronous API
5172 * @param[in] handle pointer to the package cert handle.
5173 * @param[in] cert_type certificate type.
5174 * @param[in] cert_value certificate value.
5175 * @return 0 if success, error code(<0) if fail
5176 * @retval PMINFO_R_OK success
5177 * @retval PMINFO_R_EINVAL invalid argument
5178 * @retval PMINFO_R_ERROR internal error
5179 * @pre pkgmgrinfo_create_certinfo_set_handle()
5180 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5181 * @see pkgmgrinfo_save_certinfo()
5183 static int set_cert_in_db(const char *pkgid)
5186 pkgmgrinfo_instcertinfo_h handle;
5187 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5188 if (ret != PMINFO_R_OK)
5190 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5191 if (ret != PMINFO_R_OK) {
5192 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5195 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5196 if (ret != PMINFO_R_OK) {
5197 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5200 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5205 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5208 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5209 * @brief This API saves the package cert information in the DB.
5211 * @par This API is for package-manager client application
5212 * @par Sync (or) Async : Synchronous API
5214 * @param[in] pkgid pointer to the package ID.
5215 * @param[in] handle pointer to the package cert handle.
5216 * @return 0 if success, error code(<0) if fail
5217 * @retval PMINFO_R_OK success
5218 * @retval PMINFO_R_EINVAL invalid argument
5219 * @retval PMINFO_R_ERROR internal error
5220 * @pre pkgmgrinfo_create_certinfo_set_handle()
5221 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5222 * @see pkgmgrinfo_save_certinfo()
5224 static int set_cert_in_db(const char *pkgid)
5227 pkgmgrinfo_instcertinfo_h handle;
5228 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5229 if (ret != PMINFO_R_OK)
5231 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5232 if (ret != PMINFO_R_OK) {
5233 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5236 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5237 if (ret != PMINFO_R_OK) {
5238 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5241 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5246 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5249 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5250 * @brief This API destroys the package cert information handle freeing up all the resources.
5252 * @par This API is for package-manager client application
5253 * @par Sync (or) Async : Synchronous API
5255 * @param[in] handle pointer to the package cert handle.
5256 * @return 0 if success, error code(<0) if fail
5257 * @retval PMINFO_R_OK success
5258 * @retval PMINFO_R_EINVAL invalid argument
5259 * @retval PMINFO_R_ERROR internal error
5260 * @pre pkgmgrinfo_create_certinfo_set_handle()
5262 * @see pkgmgrinfo_save_certinfo()
5264 static int set_cert_in_db(const char *pkgid)
5267 pkgmgrinfo_instcertinfo_h handle;
5268 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5269 if (ret != PMINFO_R_OK)
5271 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5272 if (ret != PMINFO_R_OK) {
5273 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5276 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5277 if (ret != PMINFO_R_OK) {
5278 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5281 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5286 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5289 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5290 * @brief This API gets the datacontrol info
5292 * @par This API is for package-manager client application
5293 * @par Sync (or) Async : Synchronous API
5295 * @param[in] providerid pointer to the providerid of dataconltrol.
5296 * @param[in] type pointer to the type of dataconltrol.
5297 * @param[out] appid pointer to hold appid, need to free after using
5298 * @param[out] access pointer to hold access, need to free after using
5299 * @return 0 if success, error code(<0) if fail
5300 * @retval PMINFO_R_OK success
5301 * @retval PMINFO_R_EINVAL invalid argument
5302 * @retval PMINFO_R_ERROR internal error
5305 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5308 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5309 * @brief This API gets the application 'guest mode visibility' value from the DB
5311 * @par This API is for package-manager client application
5312 * @par Sync (or) Async : Synchronous API
5314 * @param[in] handle pointer to application info handle
5315 * @param[out] status pointer to hold app guest mode visibility value
5316 * @return 0 if success, error code(<0) if fail
5317 * @retval PMINFO_R_OK success
5318 * @retval PMINFO_R_EINVAL invalid argument
5319 * @retval PMINFO_R_ERROR internal error
5320 * @pre pkgmgrinfo_appinfo_get_appinfo()
5321 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5322 * @see pkgmgrinfo_appinfo_get_appid()
5323 * @see pkgmgrinfo_appinfo_is_multiple()
5325 static int get_app_guestmode_visibility(const char *appid)
5329 pkgmgrinfo_appinfo_h handle;
5330 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5331 if (ret != PMINFO_R_OK)
5333 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5334 if (ret != PMINFO_R_OK) {
5335 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5338 printf("app guest mode visibility: %d\n", status);
5339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5344 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5347 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5348 * @brief This API sets the application 'guest mode visibility' value in the DB
5350 * @par This API is for package-manager client application
5351 * @par Sync (or) Async : Synchronous API
5353 * @param[in] handle pointer to application info handle
5354 * @param[out] status app guest mode visibility value
5355 * @return 0 if success, error code(<0) if fail
5356 * @retval PMINFO_R_OK success
5357 * @retval PMINFO_R_EINVAL invalid argument
5358 * @retval PMINFO_R_ERROR internal error
5359 * @pre pkgmgrinfo_appinfo_get_appinfo()
5360 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5361 * @see pkgmgrinfo_appinfo_get_appid()
5362 * @see pkgmgrinfo_appinfo_is_multiple()
5364 static int set_app_guestmode_visibility(const char *appid, bool value)
5367 pkgmgrinfo_appinfo_h handle;
5368 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5369 if (ret != PMINFO_R_OK)
5371 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5372 if (ret != PMINFO_R_OK) {
5373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5381 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5382 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5385 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5386 * @brief This API sets the package 'installed_storage' value in db
5388 * @par This API is for package-manager client application
5389 * @par Sync (or) Async : Synchronous API
5391 * @param[in] pkgid pointer to the package ID.
5392 * @param[in] location package install location
5393 * @return 0 if success, error code(<0) if fail
5394 * @retval PMINFO_R_OK success
5395 * @retval PMINFO_R_EINVAL invalid argument
5396 * @retval PMINFO_R_ERROR internal error
5398 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5402 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5403 if (ret != PMINFO_R_OK) {
5410 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5411 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5414 * @pkgmgrinfo client API
5418 * @brief listening status type in pkgmgrinfo.
5420 #define PMINFO_CLIENT_STATUS_ALL 0x00
5421 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5422 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5423 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5424 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5425 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5426 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5429 * @brief This APIs provides pkgmgrinfo client listener
5431 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5432 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5433 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5434 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5435 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5439 * @pkgmgrinfo client API end
5447 #endif /* __PKG_INFO_H__ */