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_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2576 * @brief This API gets metadata value by given metadata key
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[in] metadata_key metadata key
2583 * @param[out] metadata_value pointer to hold metadata value
2584 * @return 0 if success, error code(<0) if fail
2585 * @retval PMINFO_R_OK success
2586 * @retval PMINFO_R_EINVAL invalid argument
2588 static int get_metadata_value(const char *appid, const char *metadata_key)
2591 pkgmgrinfo_appinfo_h handle = NULL;
2592 char *metadata_value = NULL;
2594 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2595 if (ret != PMINFO_R_OK)
2598 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2599 if (ret != PMINFO_R_OK) {
2600 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2604 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2609 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2612 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2613 * @brief This API gets the component of the application
2615 * @par This API is for package-manager client application
2616 * @par Sync (or) Async : Synchronous API
2618 * @param[in] handle pointer to the application info handle.
2619 * @param[out] component pointer to hold app component
2620 * @return 0 if success, error code(<0) if fail
2621 * @retval PMINFO_R_OK success
2622 * @retval PMINFO_R_EINVAL invalid argument
2623 * @retval PMINFO_R_ERROR internal error
2624 * @pre pkgmgrinfo_appinfo_get_appinfo()
2625 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2626 * @see pkgmgrinfo_appinfo_get_appid()
2627 * @see pkgmgrinfo_appinfo_is_multiple()
2629 static int get_app_component(const char *appid)
2632 pkgmgrinfo_app_component component;
2633 pkgmgrinfo_appinfo_h handle;
2634 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2635 if (ret != PMINFO_R_OK)
2637 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2638 if (ret != PMINFO_R_OK) {
2639 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2642 printf("component : %s\n", component);
2643 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2648 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2651 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2652 * @brief This API gets the apptype of the application
2654 * @par This API is for package-manager client application
2655 * @par Sync (or) Async : Synchronous API
2657 * @param[in] handle pointer to the application info handle.
2658 * @param[out] app_type pointer to hold apptype
2659 * @return 0 if success, error code(<0) if fail
2660 * @retval PMINFO_R_OK success
2661 * @retval PMINFO_R_EINVAL invalid argument
2662 * @retval PMINFO_R_ERROR internal error
2663 * @pre pkgmgrinfo_appinfo_get_appinfo()
2664 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2665 * @see pkgmgrinfo_appinfo_get_appid()
2666 * @see pkgmgrinfo_appinfo_is_multiple()
2668 static int get_app_type(const char *appid)
2671 char *apptype = NULL;
2672 pkgmgrinfo_appinfo_h handle;
2673 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2674 if (ret != PMINFO_R_OK)
2676 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2677 if (ret != PMINFO_R_OK) {
2678 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2681 printf("apptype : %s\n", apptype);
2682 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2687 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2690 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2691 int *operation_count, char ***operation)
2692 * @brief This API gets the list of operation of the application
2694 * @par This API is for package-manager client application
2695 * @par Sync (or) Async : Synchronous API
2697 * @param[in] handle pointer to the appcontrol handle.
2698 * @param[out] operation_count pointer to hold number of operations
2699 * @param[out] operation pointer to hold list of operations
2700 * @return 0 if success, error code(<0) if fail
2701 * @retval PMINFO_R_OK success
2702 * @retval PMINFO_R_EINVAL invalid argument
2703 * @retval PMINFO_R_ERROR internal error
2704 * @pre pkgmgrinfo_appinfo_get_appinfo()
2705 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2706 * @see pkgmgrinfo_appinfo_get_uri()
2707 * @see pkgmgrinfo_appinfo_get_mime()
2709 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2714 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2715 for (i = 0; i < oc; i++) {
2716 if (strcmp(operation[i], (char *)user_data) == 0)
2723 static int check_operation(const char *appid, char *operation)
2726 pkgmgrinfo_appinfo_h handle;
2727 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2728 if (ret != PMINFO_R_OK)
2730 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2731 if (ret != PMINFO_R_OK) {
2732 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2735 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2740 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2741 int *operation_count, char ***operation);
2744 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2745 int *uri_count, char ***uri)
2746 * @brief This API gets the list of uri of the application
2748 * @par This API is for package-manager client application
2749 * @par Sync (or) Async : Synchronous API
2751 * @param[in] handle pointer to the appcontrol handle.
2752 * @param[out] uri_count pointer to hold number of uris
2753 * @param[out] uri pointer to hold list of uris
2754 * @return 0 if success, error code(<0) if fail
2755 * @retval PMINFO_R_OK success
2756 * @retval PMINFO_R_EINVAL invalid argument
2757 * @retval PMINFO_R_ERROR internal error
2758 * @pre pkgmgrinfo_appinfo_get_appinfo()
2759 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2760 * @see pkgmgrinfo_appinfo_get_operation()
2761 * @see pkgmgrinfo_appinfo_get_mime()
2763 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2768 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2769 for (i = 0; i < uc; i++) {
2770 if (strcmp(uri[i], (char *)user_data) == 0)
2777 static int check_uri(const char *appid, char *uri)
2780 pkgmgrinfo_appinfo_h handle;
2781 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2782 if (ret != PMINFO_R_OK)
2784 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2785 if (ret != PMINFO_R_OK) {
2786 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2789 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2794 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2795 int *uri_count, char ***uri);
2798 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2799 int *mime_count, char ***mime)
2800 * @brief This API gets the list of mime of the application
2802 * @par This API is for package-manager client application
2803 * @par Sync (or) Async : Synchronous API
2805 * @param[in] handle pointer to the appcontrol handle.
2806 * @param[out] mime_count pointer to hold number of mimes
2807 * @param[out] mime pointer to hold list of mimes
2808 * @return 0 if success, error code(<0) if fail
2809 * @retval PMINFO_R_OK success
2810 * @retval PMINFO_R_EINVAL invalid argument
2811 * @retval PMINFO_R_ERROR internal error
2812 * @pre pkgmgrinfo_appinfo_get_appinfo()
2813 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2814 * @see pkgmgrinfo_appinfo_get_uri()
2815 * @see pkgmgrinfo_appinfo_get_operation()
2817 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2822 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2823 for (i = 0; i < mc; i++) {
2824 if (strcmp(mime[i], (char *)user_data) == 0)
2831 static int check_mime(const char *appid, char *mime)
2834 pkgmgrinfo_appinfo_h handle;
2835 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2836 if (ret != PMINFO_R_OK)
2838 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2839 if (ret != PMINFO_R_OK) {
2840 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2843 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2848 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2849 int *mime_count, char ***mime);
2852 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2853 int *subapp_count, char ***subapp)
2854 * @brief This API gets the list of subapp of the application
2856 * @par This API is for package-manager client application
2857 * @par Sync (or) Async : Synchronous API
2859 * @param[in] handle pointer to the appcontrol handle.
2860 * @param[out] subapp_count pointer to hold number of subapp
2861 * @param[out] subapp pointer to hold list of subapp
2862 * @return 0 if success, error code(<0) if fail
2863 * @retval PMINFO_R_OK success
2864 * @retval PMINFO_R_EINVAL invalid argument
2865 * @retval PMINFO_R_ERROR internal error
2866 * @pre pkgmgrinfo_appinfo_get_appinfo()
2867 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2868 * @see pkgmgrinfo_appinfo_get_uri()
2869 * @see pkgmgrinfo_appinfo_get_operation()
2871 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2875 char **subapp = NULL;
2876 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2877 for (i = 0; i < sc; i++) {
2878 if (strcmp(subapp[i], (char *)user_data) == 0)
2885 static int check_subapp(const char *appid, char *subapp)
2888 pkgmgrinfo_appinfo_h handle = NULL;
2889 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2890 if (ret != PMINFO_R_OK)
2892 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2893 if (ret != PMINFO_R_OK) {
2894 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2897 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2902 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2903 int *subapp_count, char ***subapp);
2906 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2907 * @brief This API gets the notification icon of the application
2909 * @par This API is for package-manager client application
2910 * @par Sync (or) Async : Synchronous API
2912 * @param[in] handle pointer to the application info handle.
2913 * @param[out] path pointer to hold notification icon
2914 * @return 0 if success, error code(<0) if fail
2915 * @retval PMINFO_R_OK success
2916 * @retval PMINFO_R_EINVAL invalid argument
2917 * @retval PMINFO_R_ERROR internal error
2918 * @pre pkgmgrinfo_appinfo_get_appinfo()
2919 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2920 * @see pkgmgrinfo_appinfo_get_appid()
2921 * @see pkgmgrinfo_appinfo_is_multiple()
2923 static int get_app_notification_icon(const char *appid)
2926 char *notification_icon = NULL;
2927 pkgmgrinfo_appinfo_h handle;
2928 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2929 if (ret != PMINFO_R_OK)
2931 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2932 if (ret != PMINFO_R_OK) {
2933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2936 printf("notification icon : %s\n", notification_icon);
2937 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2942 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2945 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2946 * @brief This API gets the setting icon of the application
2948 * @par This API is for package-manager client application
2949 * @par Sync (or) Async : Synchronous API
2951 * @param[in] handle pointer to the application info handle.
2952 * @param[out] path pointer to hold setting icon
2953 * @return 0 if success, error code(<0) if fail
2954 * @retval PMINFO_R_OK success
2955 * @retval PMINFO_R_EINVAL invalid argument
2956 * @retval PMINFO_R_ERROR internal error
2957 * @pre pkgmgrinfo_appinfo_get_appinfo()
2958 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2959 * @see pkgmgrinfo_appinfo_get_appid()
2960 * @see pkgmgrinfo_appinfo_is_multiple()
2962 static int get_app_setting_icon(const char *appid)
2965 char *setting_icon = NULL;
2966 pkgmgrinfo_appinfo_h handle;
2967 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2968 if (ret != PMINFO_R_OK)
2970 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2971 if (ret != PMINFO_R_OK) {
2972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2975 printf("setting icon : %s\n", setting_icon);
2976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2981 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2984 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2985 * @brief This API gets the type of recent image on app-tray
2987 * @par This API is for package-manager client application
2988 * @par Sync (or) Async : Synchronous API
2990 * @param[in] handle pointer to the application info handle.
2991 * @param[out] type pointer to hold image type
2992 * @return 0 if success, error code(<0) if fail
2993 * @retval PMINFO_R_OK success
2994 * @retval PMINFO_R_EINVAL invalid argument
2995 * @retval PMINFO_R_ERROR internal error
2996 * @pre pkgmgrinfo_appinfo_get_appinfo()
2997 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2998 * @see pkgmgrinfo_appinfo_get_appid()
2999 * @see pkgmgrinfo_appinfo_is_multiple()
3001 static int get_app_recent_image_type(const char *appid)
3004 pkgmgrinfo_app_recentimage type;
3005 pkgmgrinfo_appinfo_h handle;
3006 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3007 if (ret != PMINFO_R_OK)
3009 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3010 if (ret != PMINFO_R_OK) {
3011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3014 printf("recent image type: %d\n", type);
3015 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3020 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3024 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3025 * @brief This API gets the preview image of application
3027 * @par Sync (or) Async : Synchronous API
3029 * @param[in] handle pointer to the application info handle.
3030 * @param[out] preview_img pointer to hold preview image path
3031 * @return 0 if success, error code(<0) if fail
3032 * @retval PMINFO_R_OK success
3033 * @retval PMINFO_R_EINVAL invalid argument
3034 * @retval PMINFO_R_ERROR internal error
3035 * @pre pkgmgrinfo_appinfo_get_appinfo()
3036 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3037 * @see pkgmgrinfo_appinfo_get_appid()
3039 static int get_app_previewimage(const char *appid)
3042 char *preview = NULL;
3043 pkgmgrinfo_appinfo_h handle = NULL;
3044 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3045 if (ret != PMINFO_R_OK)
3047 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3048 if (ret != PMINFO_R_OK) {
3049 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3052 printf("preview image path : %s\n", preview);
3053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3058 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3062 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3063 * @brief This API gets the package permission type of the application
3065 * @par This API is for package-manager client application
3066 * @par Sync (or) Async : Synchronous API
3068 * @param[in] handle pointer to the application info handle.
3069 * @param[out] permission pointer to hold package permission
3070 * @return 0 if success, error code(<0) if fail
3071 * @retval PMINFO_R_OK success
3072 * @retval PMINFO_R_EINVAL invalid argument
3073 * @retval PMINFO_R_ERROR internal error
3074 * @pre pkgmgrinfo_appinfo_get_appinfo()
3075 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3076 * @see pkgmgrinfo_appinfo_get_appid()
3078 static int get_app_permission(const char *appid)
3081 pkgmgrinfo_permission_type permission = 0;
3082 pkgmgrinfo_appinfo_h handle;
3084 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3085 if (ret != PMINFO_R_OK)
3087 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3088 if (ret != PMINFO_R_OK) {
3089 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3092 printf("permission type: %d\n", permission);
3093 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3098 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3101 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3102 * @brief This API gets the component_type
3104 * @par This API is for package-manager client application
3105 * @par Sync (or) Async : Synchronous API
3107 * @param[in] handle pointer to the application info handle.
3108 * @param[out] component_type pointer to hold component_type
3109 * @return 0 if success, error code(<0) if fail
3110 * @retval PMINFO_R_OK success
3111 * @retval PMINFO_R_EINVAL invalid argument
3112 * @retval PMINFO_R_ERROR internal error
3113 * @pre pkgmgrinfo_appinfo_get_appinfo()
3114 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3115 * @see pkgmgrinfo_appinfo_get_pkgid()
3116 * @see pkgmgrinfo_appinfo_is_multiple()
3118 static int get_component_type(const char *appid)
3121 char *component_type = NULL;
3122 pkgmgrinfo_appinfo_h handle;
3123 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3124 if (ret != PMINFO_R_OK)
3126 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3127 if (ret != PMINFO_R_OK) {
3128 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3131 printf("component_type: %s\n", component_type);
3132 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3137 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3140 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3141 * @brief This API gets the application 'hwacceleration' value from the app ID
3143 * @par This API is for package-manager client application
3144 * @par Sync (or) Async : Synchronous API
3146 * @param[in] handle pointer to application info handle
3147 * @param[out] hwacceleration pointer to hold package hwacceleration value
3148 * @return 0 if success, error code(<0) if fail
3149 * @retval PMINFO_R_OK success
3150 * @retval PMINFO_R_EINVAL invalid argument
3151 * @retval PMINFO_R_ERROR internal error
3152 * @pre pkgmgrinfo_appinfo_get_appinfo()
3153 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3154 * @see pkgmgrinfo_appinfo_get_appid()
3155 * @see pkgmgrinfo_appinfo_is_multiple()
3157 static int get_app_hwacceleration(const char *appid)
3160 pkgmgrinfo_app_hwacceleration hwacceleration;
3161 pkgmgrinfo_appinfo_h handle;
3162 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3163 if (ret != PMINFO_R_OK)
3165 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3166 if (ret != PMINFO_R_OK) {
3167 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3170 printf("app hwacceleration: %d\n", hwacceleration);
3171 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3176 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3179 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3180 * @brief This API gets the application 'screenreader' value from the app ID
3182 * @par This API is for package-manager client application
3183 * @par Sync (or) Async : Synchronous API
3185 * @param[in] handle pointer to application info handle
3186 * @param[out] screenreader pointer to hold package accessibility value
3187 * @return 0 if success, error code(<0) if fail
3188 * @retval PMINFO_R_OK success
3189 * @retval PMINFO_R_EINVAL invalid argument
3190 * @retval PMINFO_R_ERROR internal error
3191 * @pre pkgmgrinfo_appinfo_get_appinfo()
3192 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3193 * @see pkgmgrinfo_appinfo_get_appid()
3194 * @see pkgmgrinfo_appinfo_is_multiple()
3196 static int get_app_screenreader(const char *appid)
3199 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3200 pkgmgrinfo_appinfo_h handle = NULL;
3201 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3202 if (ret != PMINFO_R_OK)
3204 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3205 if (ret != PMINFO_R_OK) {
3206 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3209 printf("app screenreader: %d\n", screenreader);
3210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3215 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3218 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3219 * @brief This API gets the application's landscape & portrait effect images
3221 * @par This API is for package-manager client application
3222 * @par Sync (or) Async : Synchronous API
3224 * @param[in] handle pointer to application info handle
3225 * @param[out] portrait_img contains portrait mode effect image
3226 * @param[out] landscape_img contains landscape mode effect image
3227 * @return 0 if success, error code(<0) if fail
3228 * @retval PMINFO_R_OK success
3229 * @retval PMINFO_R_EINVAL invalid argument
3230 * @retval PMINFO_R_ERROR internal error
3231 * @pre pkgmgrinfo_appinfo_get_appinfo()
3232 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3233 * @see pkgmgrinfo_appinfo_get_appid()
3234 * @see pkgmgrinfo_appinfo_is_nodisplay()
3236 static int get_app_effectimages(const char *appid)
3239 char *portraitimg = NULL;
3240 char *landscapeimg = NULL;
3241 pkgmgrinfo_appinfo_h handle;
3242 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3243 if (ret != PMINFO_R_OK)
3245 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3246 if (ret != PMINFO_R_OK) {
3247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3250 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3251 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3256 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3259 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3260 * @brief This API gets the application's effect image type
3262 * @par This API is for package-manager client application
3263 * @par Sync (or) Async : Synchronous API
3265 * @param[in] handle pointer to application info handle
3266 * @param[out] effectimg_type contains effect image type
3267 * @return 0 if success, error code(<0) if fail
3268 * @retval PMINFO_R_OK success
3269 * @retval PMINFO_R_EINVAL invalid argument
3270 * @retval PMINFO_R_ERROR internal error
3271 * @pre pkgmgrinfo_appinfo_get_appinfo()
3272 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3273 * @see pkgmgrinfo_appinfo_get_appid()
3274 * @see pkgmgrinfo_appinfo_is_nodisplay()
3276 static int get_app_effectimage_type(const char *appid)
3279 char *effectimg_type = NULL;
3280 pkgmgrinfo_appinfo_h handle = NULL;
3281 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3282 if (ret != PMINFO_R_OK)
3284 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3285 if (ret != PMINFO_R_OK) {
3286 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3289 printf("app effect image type: %s\n", effectimg_type);
3290 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3295 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3298 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3299 * @brief This API gets the submode_mainid of the application
3301 * @par This API is for package-manager client application
3302 * @par Sync (or) Async : Synchronous API
3304 * @param[in] handle pointer to the application info handle.
3305 * @param[out] submode_mainid pointer to hold package name
3306 * @return 0 if success, error code(<0) if fail
3307 * @retval PMINFO_R_OK success
3308 * @retval PMINFO_R_EINVAL invalid argument
3309 * @retval PMINFO_R_ERROR internal error
3310 * @pre pkgmgrinfo_appinfo_get_appinfo()
3311 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3312 * @see pkgmgrinfo_appinfo_get_appid()
3313 * @see pkgmgrinfo_appinfo_is_multiple()
3315 static int get_app_submode_mainid(const char *appid)
3318 char *submode_mainid = NULL;
3319 pkgmgrinfo_appinfo_h handle = NULL;
3320 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3321 if (ret != PMINFO_R_OK)
3323 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3324 if (ret != PMINFO_R_OK) {
3325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3328 printf("submode_mainid: %s\n", submode_mainid);
3329 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3334 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3337 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3338 * @brief This API gets the datacontrol info
3340 * @par This API is for package-manager client application
3341 * @par Sync (or) Async : Synchronous API
3343 * @param[in] providerid pointer to the providerid of dataconltrol.
3344 * @param[in] type pointer to the type of dataconltrol.
3345 * @param[out] appid pointer to hold appid, need to free after using
3346 * @param[out] access pointer to hold access, need to free after using
3347 * @return 0 if success, error code(<0) if fail
3348 * @retval PMINFO_R_OK success
3349 * @retval PMINFO_R_EINVAL invalid argument
3350 * @retval PMINFO_R_ERROR internal error
3353 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3354 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3357 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3358 * @brief This API gets the appid of datacontrol
3360 * @par This API is for package-manager client application
3361 * @par Sync (or) Async : Synchronous API
3363 * @param[in] providerid pointer to the providerid of dataconltrol.
3364 * @param[out] appid pointer to hold appid, need to free after using
3365 * @return 0 if success, error code(<0) if fail
3366 * @retval PMINFO_R_OK success
3367 * @retval PMINFO_R_EINVAL invalid argument
3368 * @retval PMINFO_R_ERROR internal error
3371 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3372 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3375 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3376 * @brief This API gets the alias_appid of the application
3378 * @par This API is for package-manager client application
3379 * @par Sync (or) Async : Synchronous API
3381 * @param[in] handle pointer to the application info handle.
3382 * @param[out] alias_appid pointer to hold app alias_appid
3383 * @return 0 if success, error code(<0) if fail
3384 * @retval PMINFO_R_OK success
3385 * @retval PMINFO_R_EINVAL invalid argument
3386 * @retval PMINFO_R_ERROR internal error
3387 * @pre pkgmgrinfo_appinfo_get_appinfo()
3388 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3389 * @see pkgmgrinfo_appinfo_get_appid()
3391 static int get_alias_appid(const char *appid)
3394 char *alias_appid= 0;
3395 pkgmgrinfo_appinfo_h handle = NULL;
3396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3397 if (ret != PMINFO_R_OK)
3399 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3400 if (ret != PMINFO_R_OK) {
3401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3404 printf("alias_appid: %s\n", alias_appid);
3405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3410 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3413 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3414 * @brief This API gets the effective_appid of the application
3416 * @par This API is for package-manager client application
3417 * @par Sync (or) Async : Synchronous API
3419 * @param[in] handle pointer to the application info handle.
3420 * @param[out] effective_appid pointer to hold app effective_appid
3421 * @return 0 if success, error code(<0) if fail
3422 * @retval PMINFO_R_OK success
3423 * @retval PMINFO_R_EINVAL invalid argument
3424 * @retval PMINFO_R_ERROR internal error
3425 * @pre pkgmgrinfo_appinfo_get_appinfo()
3426 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3427 * @see pkgmgrinfo_appinfo_get_appid()
3429 static int get_effective_appid(const char *appid)
3432 char *effective_appid= 0;
3433 pkgmgrinfo_appinfo_h handle = NULL;
3434 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3435 if (ret != PMINFO_R_OK)
3437 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3438 if (ret != PMINFO_R_OK) {
3439 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3442 printf("effective_appid: %s\n", effective_appid);
3443 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3448 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3451 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3452 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3454 * @par This API is for package-manager client application
3455 * @par Sync (or) Async : Synchronous API
3457 * @param[in] handle pointer to the appinfo handle.
3458 * @param[out] tep_name pointer to hold tep name
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
3463 * @pre pkgmgrinfo_appinfo_get_appinfo()
3464 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3465 * @see pkgmgrinfo_appinfo_get_appid()
3467 static int get_tep_name(const char *appid)
3470 char *tep_name = NULL;
3471 pkgmgrinfo_appinfo_h handle = NULL;
3472 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3473 if (ret != PMINFO_R_OK)
3475 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3476 if (ret != PMINFO_R_OK) {
3477 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3480 printf("TEP name is: %s\n", tep_name);
3481 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3486 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3489 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3490 * @brief This API gets the root path of application
3492 * @par Sync (or) Async : Synchronous API
3494 * @param[in] handle pointer to appinfo handle
3495 * @param[out] path pointer to hold root path of application
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
3501 static int get_root_path(const char *appid)
3505 pkgmgrinfo_appinfo_h handle;
3506 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3507 if (ret != PMINFO_R_OK)
3510 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3511 if (ret != PMINFO_R_OK) {
3512 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3515 printf("path : %s\n", path);
3516 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3522 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3525 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3526 * @brief This API gets the application api_version from the application ID
3528 * @par This API is for package-manager client application
3529 * @par Sync (or) Async : Synchronous API
3531 * @param[in] handle pointer to appinfo handle
3532 * @param[out] api_version pointer to hold application api_version
3533 * @return 0 if success, error code(<0) if fail
3534 * @retval PMINFO_R_OK success
3535 * @retval PMINFO_R_EINVAL invalid argument
3536 * @retval PMINFO_R_ERROR internal error
3537 * @pre pkgmgrinfo_appinfo_get_appinfo()
3538 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3539 * @see pkgmgrinfo_appinfo_get_appid()
3541 static int get_app_api_version(const char *appid)
3544 char *api_version = NULL;
3545 pkgmgrinfo_appinfo_h handle = NULL;
3546 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3547 if (ret != PMINFO_R_OK)
3549 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3550 if (ret != PMINFO_R_OK) {
3551 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3554 printf("app api_version: %s\n", api_version);
3555 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3560 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3563 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3564 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3565 * @brief This API gets the list of permission for a particular application
3567 * @par This API is for package-manager client application
3568 * @par Sync (or) Async : Synchronous API
3569 * @param[in] handle pointer to the application info handle.
3570 * @param[in] permission_func callback function for list
3571 * @param[in] user_data user data to be passed to callback function
3572 * @return 0 if success, error code(<0) if fail
3573 * @retval PMINFO_R_OK success
3574 * @retval PMINFO_R_EINVAL invalid argument
3575 * @retval PMINFO_R_ERROR internal error
3576 * @pre pkgmgrinfo_appinfo_get_appinfo()
3577 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3579 int permission_func(const char *name, void *user_data)
3581 if (strcmp(name, (char *)user_data) == 0)
3587 static int list_permission(const char *appid, char *permission)
3590 pkgmgrinfo_appinfo_h handle;
3591 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3592 if (ret != PMINFO_R_OK)
3594 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3595 if (ret != PMINFO_R_OK) {
3596 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3599 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3604 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3605 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3608 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3609 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3610 * @brief This API gets the list of category for a particular application
3612 * @par This API is for package-manager client application
3613 * @par Sync (or) Async : Synchronous API
3614 * @param[in] handle pointer to the application info handle.
3615 * @param[in] category_func callback function for list
3616 * @param[in] user_data user data to be passed to callback function
3617 * @return 0 if success, error code(<0) if fail
3618 * @retval PMINFO_R_OK success
3619 * @retval PMINFO_R_EINVAL invalid argument
3620 * @retval PMINFO_R_ERROR internal error
3621 * @pre pkgmgrinfo_appinfo_get_appinfo()
3622 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3624 int category_func(const char *name, void *user_data)
3626 if (strcmp(name, (char *)user_data) == 0)
3632 static int list_category(const char *appid, char *category)
3635 pkgmgrinfo_appinfo_h handle;
3636 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3637 if (ret != PMINFO_R_OK)
3639 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3640 if (ret != PMINFO_R_OK) {
3641 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3644 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3649 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3650 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3653 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3654 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3655 * @brief This API gets the list of metadata for a particular application
3657 * @par This API is for package-manager client application
3658 * @par Sync (or) Async : Synchronous API
3659 * @param[in] handle pointer to the application info handle.
3660 * @param[in] metadata_func callback function for list
3661 * @param[in] user_data user data to be passed to callback function
3662 * @return 0 if success, error code(<0) if fail
3663 * @retval PMINFO_R_OK success
3664 * @retval PMINFO_R_EINVAL invalid argument
3665 * @retval PMINFO_R_ERROR internal error
3666 * @pre pkgmgrinfo_appinfo_get_appinfo()
3667 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3669 int metadata_func(const char *key, const char *value, void *user_data)
3671 if (strcmp(key, (char *)user_data) == 0) {
3672 printf("Value is %s\n", value);
3679 static int list_metadata(const char *appid, char *key)
3682 pkgmgrinfo_appinfo_h handle;
3683 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3684 if (ret != PMINFO_R_OK)
3686 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3687 if (ret != PMINFO_R_OK) {
3688 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3691 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3696 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3697 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3701 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3702 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3703 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3704 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3705 * @brief This API gets the list of app-control for a particular application
3707 * @par This API is for package-manager client application
3708 * @par Sync (or) Async : Synchronous API
3709 * @param[in] handle pointer to the application info handle.
3710 * @param[in] appcontrol_func callback function for list
3711 * @param[in] user_data user data to be passed to callback function
3712 * @param[in] uid the addressee user id of the instruction
3713 * @return 0 if success, error code(<0) if fail
3714 * @retval PMINFO_R_OK success
3715 * @retval PMINFO_R_EINVAL invalid argument
3716 * @retval PMINFO_R_ERROR internal error
3717 * @pre pkgmgrinfo_appinfo_get_appinfo()
3718 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3720 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3725 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3726 for (i = 0; i < oc; i++) {
3727 if (strcmp(operation[i], (char *)user_data) == 0)
3734 static int check_operation(const char *appid, char *operation)
3737 pkgmgrinfo_appinfo_h handle;
3738 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3739 if (ret != PMINFO_R_OK)
3741 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3742 if (ret != PMINFO_R_OK) {
3743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3746 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3751 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3752 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3757 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3758 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3761 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3762 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3763 * @brief This API gets the list of splashscreen for a particular application
3765 * @par This API is for package-manager client application
3766 * @par Sync (or) Async : Synchronous API
3767 * @param[in] handle pointer to the application info handle.
3768 * @param[in] splash_screen_func callback function for list
3769 * @param[in] user_data user data to be passed to callback function
3770 * @return 0 if success, error code(<0) if fail
3771 * @retval PMINFO_R_OK success
3772 * @retval PMINFO_R_EINVAL invalid argument
3773 * @retval PMINFO_R_ERROR internal error
3774 * @pre pkgmgrinfo_appinfo_get_appinfo()
3775 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3778 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3779 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3782 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3783 * @brief This API gets the application 'nodisplay' value from the app ID
3785 * @par This API is for package-manager client application
3786 * @par Sync (or) Async : Synchronous API
3788 * @param[in] handle pointer to application info handle
3789 * @param[out] nodisplay pointer to hold package nodisplay value
3790 * @return 0 if success, error code(<0) if fail
3791 * @retval PMINFO_R_OK success
3792 * @retval PMINFO_R_EINVAL invalid argument
3793 * @retval PMINFO_R_ERROR internal error
3794 * @pre pkgmgrinfo_appinfo_get_appinfo()
3795 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3796 * @see pkgmgrinfo_appinfo_get_appid()
3797 * @see pkgmgrinfo_appinfo_is_multiple()
3799 static int get_app_nodisplay(const char *appid)
3803 pkgmgrinfo_appinfo_h handle;
3804 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3805 if (ret != PMINFO_R_OK)
3807 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3808 if (ret != PMINFO_R_OK) {
3809 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3812 printf("app nodisplay: %d\n", nodisplay);
3813 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3818 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3821 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3822 * @brief This API gets the application 'multiple' value from the app ID
3824 * @par This API is for package-manager client application
3825 * @par Sync (or) Async : Synchronous API
3827 * @param[in] handle pointer to application info handle
3828 * @param[out] multiple pointer to hold package multiple value
3829 * @return 0 if success, error code(<0) if fail
3830 * @retval PMINFO_R_OK success
3831 * @retval PMINFO_R_EINVAL invalid argument
3832 * @retval PMINFO_R_ERROR internal error
3833 * @pre pkgmgrinfo_appinfo_get_appinfo()
3834 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3835 * @see pkgmgrinfo_appinfo_get_appid()
3836 * @see pkgmgrinfo_appinfo_is_nodisplay()
3838 static int get_app_multiple(const char *appid)
3842 pkgmgrinfo_appinfo_h handle;
3843 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3844 if (ret != PMINFO_R_OK)
3846 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3847 if (ret != PMINFO_R_OK) {
3848 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3851 printf("app multiple: %d\n", multiple);
3852 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3857 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3860 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3861 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3862 * application launching effect. If fales, indicator will be hidden during application launching effect
3864 * @par This API is for package-manager client application
3865 * @par Sync (or) Async : Synchronous API
3867 * @param[in] handle pointer to application info handle
3868 * @param[out] indicator_disp contains indicator display status for application launching effect
3869 * @return 0 if success, error code(<0) if fail
3870 * @retval PMINFO_R_OK success
3871 * @retval PMINFO_R_EINVAL invalid argument
3872 * @retval PMINFO_R_ERROR internal error
3873 * @pre pkgmgrinfo_appinfo_get_appinfo()
3874 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3875 * @see pkgmgrinfo_appinfo_get_appid()
3876 * @see pkgmgrinfo_appinfo_is_nodisplay()
3878 static int get_app_indicator_display(const char *appid)
3881 bool indicator_disp;
3882 pkgmgrinfo_appinfo_h handle;
3883 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3884 if (ret != PMINFO_R_OK)
3886 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3887 if (ret != PMINFO_R_OK){
3888 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3891 printf("app indicator disp : %d\n", indicator_disp);
3892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3897 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3900 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3901 * @brief This API gets the application 'taskmanage' value from the app ID
3903 * @par This API is for package-manager client application
3904 * @par Sync (or) Async : Synchronous API
3906 * @param[in] handle pointer to application info handle
3907 * @param[out] taskmanage pointer to hold package taskmanage value
3908 * @return 0 if success, error code(<0) if fail
3909 * @retval PMINFO_R_OK success
3910 * @retval PMINFO_R_EINVAL invalid argument
3911 * @retval PMINFO_R_ERROR internal error
3912 * @pre pkgmgrinfo_appinfo_get_appinfo()
3913 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3914 * @see pkgmgrinfo_appinfo_get_appid()
3915 * @see pkgmgrinfo_appinfo_is_multiple()
3917 static int get_app_taskmanage(const char *appid)
3921 pkgmgrinfo_appinfo_h handle;
3922 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3923 if (ret != PMINFO_R_OK)
3925 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3926 if (ret != PMINFO_R_OK) {
3927 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3930 printf("app taskmanage: %d\n", taskmanage);
3931 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3936 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3939 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3940 * @brief This API gets the application 'taskmanage' value from the app ID
3942 * @par This API is for package-manager client application
3943 * @par Sync (or) Async : Synchronous API
3945 * @param[in] handle pointer to application info handle
3946 * @param[out] enabled pointer to hold package enabled value
3947 * @return 0 if success, error code(<0) if fail
3948 * @retval PMINFO_R_OK success
3949 * @retval PMINFO_R_EINVAL invalid argument
3950 * @retval PMINFO_R_ERROR internal error
3951 * @pre pkgmgrinfo_appinfo_get_appinfo()
3952 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3953 * @see pkgmgrinfo_appinfo_get_appid()
3954 * @see pkgmgrinfo_appinfo_is_multiple()
3956 static int get_app_enabled(const char *appid)
3960 pkgmgrinfo_appinfo_h handle;
3961 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3962 if (ret != PMINFO_R_OK)
3964 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3965 if (ret != PMINFO_R_OK) {
3966 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3969 printf("app enabled: %d\n", enabled);
3970 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3975 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3978 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3979 * @brief This API gets the application 'onboot' value from the app ID
3981 * @par This API is for package-manager client application
3982 * @par Sync (or) Async : Synchronous API
3984 * @param[in] handle pointer to application info handle
3985 * @param[out] onboot pointer to hold package onboot value
3986 * @return 0 if success, error code(<0) if fail
3987 * @retval PMINFO_R_OK success
3988 * @retval PMINFO_R_EINVAL invalid argument
3989 * @retval PMINFO_R_ERROR internal error
3990 * @pre pkgmgrinfo_appinfo_get_appinfo()
3991 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3992 * @see pkgmgrinfo_appinfo_get_appid()
3993 * @see pkgmgrinfo_appinfo_is_multiple()
3995 static int get_app_onboot(const char *appid)
3999 pkgmgrinfo_appinfo_h handle;
4000 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4001 if (ret != PMINFO_R_OK)
4003 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4004 if (ret != PMINFO_R_OK) {
4005 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4008 printf("app onboot: %d\n", onboot);
4009 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4014 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4017 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4018 * @brief This API gets the application 'autorestart' value from the app ID
4020 * @par This API is for package-manager client application
4021 * @par Sync (or) Async : Synchronous API
4023 * @param[in] handle pointer to application info handle
4024 * @param[out] autorestart pointer to hold package autorestart value
4025 * @return 0 if success, error code(<0) if fail
4026 * @retval PMINFO_R_OK success
4027 * @retval PMINFO_R_EINVAL invalid argument
4028 * @retval PMINFO_R_ERROR internal error
4029 * @pre pkgmgrinfo_appinfo_get_appinfo()
4030 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4031 * @see pkgmgrinfo_appinfo_get_appid()
4032 * @see pkgmgrinfo_appinfo_is_multiple()
4034 static int get_app_autorestart(const char *appid)
4038 pkgmgrinfo_appinfo_h handle;
4039 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4040 if (ret != PMINFO_R_OK)
4042 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4043 if (ret != PMINFO_R_OK) {
4044 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4047 printf("app autorestart: %d\n", autorestart);
4048 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4053 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4056 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4057 * @brief This API gets the value for given application is main app or not from handle
4059 * @par This API is for package-manager client application
4060 * @par Sync (or) Async : Synchronous API
4062 * @param[in] handle pointer to application info handle
4063 * @param[out] mainapp pointer to hold package mainapp is or not
4064 * @return 0 if success, error code(<0) if fail
4065 * @retval PMINFO_R_OK success
4066 * @retval PMINFO_R_EINVAL invalid argument
4067 * @retval PMINFO_R_ERROR internal error
4068 * @pre pkgmgrinfo_appinfo_get_appinfo()
4069 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4070 * @see pkgmgrinfo_appinfo_get_appid()
4071 * @see pkgmgrinfo_appinfo_is_multiple()
4073 static int get_app_mainapp(const char *appid)
4077 pkgmgrinfo_appinfo_h handle;
4078 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4079 if (ret != PMINFO_R_OK)
4081 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4082 if (ret != PMINFO_R_OK) {
4083 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4086 printf("mainapp: %d\n", mainapp);
4087 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4092 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4096 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4097 * @brief This API gets the value for given application is preload or not from handle
4099 * @par This API is for package-manager client application
4100 * @par Sync (or) Async : Synchronous API
4102 * @param[in] handle pointer to application info handle
4103 * @param[out] preload pointer to hold preload is or not
4104 * @return 0 if success, error code(<0) if fail
4105 * @retval PMINFO_R_OK success
4106 * @retval PMINFO_R_EINVAL invalid argument
4107 * @retval PMINFO_R_ERROR internal error
4108 * @pre pkgmgrinfo_appinfo_get_appinfo()
4109 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4110 * @see pkgmgrinfo_appinfo_get_appid()
4111 * @see pkgmgrinfo_appinfo_is_multiple()
4113 static int get_app_preload(const char *appid)
4117 pkgmgrinfo_appinfo_h handle = NULL;
4118 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4119 if (ret != PMINFO_R_OK)
4121 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4122 if (ret != PMINFO_R_OK) {
4123 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4126 printf("preload: %d\n", preload);
4127 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4132 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4135 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4136 * @brief This API gets the value for given application is submode or not from handle
4138 * @par This API is for package-manager client application
4139 * @par Sync (or) Async : Synchronous API
4141 * @param[in] handle pointer to application info handle
4142 * @param[out] submode pointer to hold submode is or not
4143 * @return 0 if success, error code(<0) if fail
4144 * @retval PMINFO_R_OK success
4145 * @retval PMINFO_R_EINVAL invalid argument
4146 * @retval PMINFO_R_ERROR internal error
4147 * @pre pkgmgrinfo_appinfo_get_appinfo()
4148 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4149 * @see pkgmgrinfo_appinfo_get_appid()
4150 * @see pkgmgrinfo_appinfo_is_multiple()
4152 static int get_app_submode(const char *appid)
4156 pkgmgrinfo_appinfo_h handle = NULL;
4157 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4158 if (ret != PMINFO_R_OK)
4160 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4161 if (ret != PMINFO_R_OK) {
4162 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4165 printf("submode: %d\n", submode);
4166 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4171 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4174 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4175 * @brief This API gets the value for given application is process_pool or not from handle
4177 * @par This API is for package-manager client application
4178 * @par Sync (or) Async : Synchronous API
4180 * @param[in] handle pointer to application info handle
4181 * @param[out] process_pool pointer to hold process_pool is or not
4182 * @return 0 if success, error code(<0) if fail
4183 * @retval PMINFO_R_OK success
4184 * @retval PMINFO_R_EINVAL invalid argument
4185 * @retval PMINFO_R_ERROR internal error
4186 * @pre pkgmgrinfo_appinfo_get_appinfo()
4187 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4188 * @see pkgmgrinfo_appinfo_get_appid()
4190 static int get_app_process_pool(const char *appid)
4193 bool process_pool = 0;
4194 pkgmgrinfo_appinfo_h handle = NULL;
4195 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4196 if (ret != PMINFO_R_OK)
4198 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4199 if (ret != PMINFO_R_OK) {
4200 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4203 printf("process_pool: %d\n", process_pool);
4204 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4209 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4212 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4213 * @brief This API gets the installed storage location of the application
4215 * @par This API is for package-manager client application
4216 * @par Sync (or) Async : Synchronous API
4218 * @param[in] handle pointer to the application info handle.
4219 * @param[out] app_type pointer to hold installed storage location
4220 * @return 0 if success, error code(<0) if fail
4221 * @retval PMINFO_R_OK success
4222 * @retval PMINFO_R_EINVAL invalid argument
4223 * @retval PMINFO_R_ERROR internal error
4224 * @pre pkgmgrinfo_appinfo_get_appinfo()
4225 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4226 * @see pkgmgrinfo_appinfo_get_appid()
4228 static int get_app_installed_location(const char *appid)
4231 pkgmgrinfo_installed_storage storage;
4232 pkgmgrinfo_appinfo_h handle = NULL;
4233 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4234 if (ret != PMINFO_R_OK)
4236 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4237 if (ret != PMINFO_R_OK) {
4238 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4241 printf("Installed storage location : %d\n", storage);
4242 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4247 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4251 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4252 * @brief This API checks if the application has the given category
4254 * @par This API is for package-manager client application
4255 * @par Sync (or) Async : Synchronous API
4257 * @param[in] handle pointer to the application info handle
4258 * @param[in] category category
4259 * @param[out] exist value Gets whether the application has the given category
4260 * @return 0 if success, error code(<0) if fail
4261 * @retval PMINFO_R_OK success
4262 * @retval PMINFO_R_EINVAL invalid argument
4263 * @retval PMINFO_R_ERROR internal error
4265 static int is_category_exist(const char *appid, const char *category)
4268 pkgmgrinfo_appinfo_h handle;
4271 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4272 if (ret != PMINFO_R_OK)
4275 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4276 if (ret != PMINFO_R_OK) {
4277 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4281 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4286 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4289 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4290 * @brief This API gets the application 'ui_gadget' value from the app ID
4292 * @par This API is for package-manager client application
4293 * @par Sync (or) Async : Synchronous API
4295 * @param[in] handle pointer to application info handle
4296 * @param[out] ui_gadget pointer to hold package ui_gadget value
4297 * @return 0 if success, error code(<0) if fail
4298 * @retval PMINFO_R_OK success
4299 * @retval PMINFO_R_EINVAL invalid argument
4300 * @pre pkgmgrinfo_appinfo_get_appinfo()
4301 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4303 static int get_app_ui_gadget(const char *appid)
4307 pkgmgrinfo_appinfo_h handle = NULL;
4308 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4309 if (ret != PMINFO_R_OK)
4311 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4312 if (ret != PMINFO_R_OK) {
4313 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4316 printf("app ui_gadget: %d\n", ui_gadget);
4317 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4322 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4325 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4326 * @brief This API gets the application 'support_disable' value from the app ID
4328 * @par This API is for package-manager client application
4329 * @par Sync (or) Async : Synchronous API
4331 * @param[in] handle pointer to application info handle
4332 * @param[out] support_disable pointer to hold package support_disable value
4333 * @return 0 if success, error code(<0) if fail
4334 * @retval PMINFO_R_OK success
4335 * @retval PMINFO_R_EINVAL invalid argument
4336 * @pre pkgmgrinfo_appinfo_get_appinfo()
4337 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4339 static int get_app_support_disable(const char *appid)
4342 bool support_disable;
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_support_disable(handle, &support_disable);
4348 if (ret != PMINFO_R_OK) {
4349 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4352 printf("app support_disable: %d\n", support_disable);
4353 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4358 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4361 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4362 * @brief This API gets the application 'is_disable' value from the app ID
4364 * @par This API is for package-manager client application
4365 * @par Sync (or) Async : Synchronous API
4367 * @param[in] handle pointer to application info handle
4368 * @param[out] disabled pointer to hold application is_disabled value
4369 * @return 0 if success, error code(<0) if fail
4370 * @retval PMINFO_R_OK success
4371 * @retval PMINFO_R_EINVAL invalid argument
4372 * @pre pkgmgrinfo_appinfo_get_appinfo()
4373 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4375 static int get_app_is_disable(const char *appid)
4379 pkgmgrinfo_appinfo_h handle = NULL;
4380 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4381 if (ret != PMINFO_R_OK)
4383 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4384 if (ret != PMINFO_R_OK) {
4385 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4388 printf("app is_disable: %d\n", is_disable);
4389 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4394 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4397 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4398 * @brief This API gets whethere the given application is global application or user application
4400 * @par This API is for package-manager client application
4401 * @par Sync (or) Async : Synchronous API
4403 * @param[in] handle pointer to application info handle
4404 * @param[in] global pointer to hold application global value
4405 * @return 0 if success, error code(<0) if fail
4406 * @retval PMINFO_R_OK success
4407 * @retval PMINFO_R_EINVAL invalid argument
4408 * @retval PMINFO_R_ERROR internal error
4409 * @pre pkgmgrinfo_appinfo_get_appinfo()
4410 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4411 * @see pkgmgrinfo_appinfo_get_appid()
4412 static int get_app_is_global(const char *appid)
4416 pkgmgrinfo_appinfo_h handle = NULL;
4417 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4418 if (ret != PMINFO_R_OK)
4420 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4421 if (ret != PMINFO_R_OK) {
4422 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4425 printf("app is_global: %d\n", global);
4426 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4431 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4434 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4435 * @brief This API gets the application 'splash_screen_display' value from the app ID
4437 * @par This API is for package-manager client application
4438 * @par Sync (or) Async : Synchronous API
4440 * @param[in] handle pointer to application info handle
4441 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4442 * @return 0 if success, error code(<0) if fail
4443 * @retval PMINFO_R_OK success
4444 * @retval PMINFO_R_EINVAL invalid argument
4445 * @retval PMINFO_R_ERROR internal error
4447 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4450 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4451 * @brief This API destroys the application information handle freeing up all the resources
4453 * @par This API is for package-manager client application
4454 * @par Sync (or) Async : Synchronous API
4456 * @param[in] handle pointer to the application info handle.
4457 * @return 0 if success, error code(<0) if fail
4458 * @retval PMINFO_R_OK success
4459 * @retval PMINFO_R_EINVAL invalid argument
4460 * @retval PMINFO_R_ERROR internal error
4461 * @pre pkgmgrinfo_appinfo_get_appinfo()
4463 * @see pkgmgrinfo_appinfo_get_pkgid()
4464 * @see pkgmgrinfo_appinfo_is_multiple()
4466 static int get_app_type(const char *appid)
4470 pkgmgrinfo_appinfo_h handle;
4471 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4472 if (ret != PMINFO_R_OK)
4474 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4475 if (ret != PMINFO_R_OK) {
4476 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4479 printf("apptype: %s\n", type);
4480 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4485 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4488 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4489 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4490 The query will search the entire application information collected from the manifest file of all the installed packages
4492 * @par This API is for package-manager client application
4493 * @par Sync (or) Async : Synchronous API
4495 * @param[out] handle pointer to the application info filter handle.
4496 * @return 0 if success, error code(<0) if fail
4497 * @retval PMINFO_R_OK success
4498 * @retval PMINFO_R_EINVAL invalid argument
4499 * @retval PMINFO_R_ERROR internal error
4501 * @post pkgmgrinfo_appinfo_filter_destroy()
4502 * @see pkgmgrinfo_appinfo_filter_count()
4503 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4505 static int get_capp_count()
4509 pkgmgrinfo_appinfo_filter_h handle;
4510 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4511 if (ret != PMINFO_R_OK)
4513 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4514 if (ret != PMINFO_R_OK) {
4515 pkgmgrinfo_appinfo_filter_destroy(handle);
4518 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4519 if (ret != PMINFO_R_OK) {
4520 pkgmgrinfo_appinfo_filter_destroy(handle);
4523 printf("No of capp: %d\n", count);
4524 pkgmgrinfo_appinfo_filter_destroy(handle);
4529 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4532 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4533 * @brief This API destroys the application information filter handle freeing up all the resources
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 * @return 0 if success, error code(<0) if fail
4540 * @retval PMINFO_R_OK success
4541 * @retval PMINFO_R_EINVAL invalid argument
4542 * @retval PMINFO_R_ERROR internal error
4543 * @pre pkgmgrinfo_appinfo_filter_create()
4545 * @see pkgmgrinfo_appinfo_filter_count()
4546 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4548 static int get_capp_count()
4552 pkgmgrinfo_appinfo_filter_h handle;
4553 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4554 if (ret != PMINFO_R_OK)
4556 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4557 if (ret != PMINFO_R_OK) {
4558 pkgmgrinfo_appinfo_filter_destroy(handle);
4561 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4562 if (ret != PMINFO_R_OK) {
4563 pkgmgrinfo_appinfo_filter_destroy(handle);
4566 printf("No of capp: %d\n", count);
4567 pkgmgrinfo_appinfo_filter_destroy(handle);
4572 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4575 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4576 * @brief This API adds a boolean filter property to the filter handle
4578 * @par This API is for package-manager client application
4579 * @par Sync (or) Async : Synchronous API
4581 * @param[in] handle pointer to the application info filter handle.
4582 * @param[in] property boolean property name.
4583 * @param[in] value value corresponding to the property.
4584 * @return 0 if success, error code(<0) if fail
4585 * @retval PMINFO_R_OK success
4586 * @retval PMINFO_R_EINVAL invalid argument
4587 * @retval PMINFO_R_ERROR internal error
4588 * @pre pkgmgrinfo_appinfo_filter_create()
4589 * @post pkgmgrinfo_appinfo_filter_destroy()
4590 * @see pkgmgrinfo_appinfo_filter_count()
4591 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4593 static int get_taskmanageable_app_count()
4597 pkgmgrinfo_appinfo_filter_h handle;
4598 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4599 if (ret != PMINFO_R_OK)
4601 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4602 if (ret != PMINFO_R_OK) {
4603 pkgmgrinfo_appinfo_filter_destroy(handle);
4606 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4607 if (ret != PMINFO_R_OK) {
4608 pkgmgrinfo_appinfo_filter_destroy(handle);
4611 printf("No of taskmanageable apps: %d\n", count);
4612 pkgmgrinfo_appinfo_filter_destroy(handle);
4617 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4618 const char *property, const bool value);
4621 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4622 * @brief This API adds an integer filter property to the filter handle
4624 * @par This API is for package-manager client application
4625 * @par Sync (or) Async : Synchronous API
4627 * @param[in] handle pointer to the application info filter handle.
4628 * @param[in] property integer property name.
4629 * @param[in] value value corresponding to the property.
4630 * @return 0 if success, error code(<0) if fail
4631 * @retval PMINFO_R_OK success
4632 * @retval PMINFO_R_EINVAL invalid argument
4633 * @retval PMINFO_R_ERROR internal error
4634 * @pre pkgmgrinfo_appinfo_filter_create()
4635 * @post pkgmgrinfo_appinfo_filter_destroy()
4636 * @see pkgmgrinfo_appinfo_filter_count()
4637 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4639 static int get_taskmanageable_app_count()
4643 pkgmgrinfo_appinfo_filter_h handle;
4644 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4645 if (ret != PMINFO_R_OK)
4647 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4648 if (ret != PMINFO_R_OK) {
4649 pkgmgrinfo_appinfo_filter_destroy(handle);
4652 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4653 if (ret != PMINFO_R_OK) {
4654 pkgmgrinfo_appinfo_filter_destroy(handle);
4657 printf("No of apps: %d\n", count);
4658 pkgmgrinfo_appinfo_filter_destroy(handle);
4663 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4664 const char *property, const int value);
4667 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4668 * @brief This API adds a string filter property to the filter handle
4670 * @par This API is for package-manager client application
4671 * @par Sync (or) Async : Synchronous API
4673 * @param[in] handle pointer to the application info filter handle.
4674 * @param[in] property string property name.
4675 * @param[in] value value corresponding to the property.
4676 * @return 0 if success, error code(<0) if fail
4677 * @retval PMINFO_R_OK success
4678 * @retval PMINFO_R_EINVAL invalid argument
4679 * @retval PMINFO_R_ERROR internal error
4680 * @pre pkgmgrinfo_appinfo_filter_create()
4681 * @post pkgmgrinfo_appinfo_filter_destroy()
4682 * @see pkgmgrinfo_appinfo_filter_count()
4683 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4685 static int get_capp_count()
4689 pkgmgrinfo_appinfo_filter_h handle;
4690 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4691 if (ret != PMINFO_R_OK)
4693 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4694 if (ret != PMINFO_R_OK) {
4695 pkgmgrinfo_appinfo_filter_destroy(handle);
4698 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4699 if (ret != PMINFO_R_OK) {
4700 pkgmgrinfo_appinfo_filter_destroy(handle);
4703 printf("No of capp: %d\n", count);
4704 pkgmgrinfo_appinfo_filter_destroy(handle);
4709 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4710 const char *property, const char *value);
4713 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4714 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4716 * @par This API is for package-manager client application
4717 * @par Sync (or) Async : Synchronous API
4719 * @param[in] handle pointer to the application info filter handle.
4720 * @param[in] app_cb callback function.
4721 * @param[in] user_data user data to be passed to the callback function
4722 * @return 0 if success, error code(<0) if fail
4723 * @retval PMINFO_R_OK success
4724 * @retval PMINFO_R_EINVAL invalid argument
4725 * @retval PMINFO_R_ERROR internal error
4726 * @pre pkgmgrinfo_appinfo_filter_create()
4727 * @post pkgmgrinfo_appinfo_filter_destroy()
4728 * @see pkgmgrinfo_appinfo_filter_count()
4730 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4733 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4734 printf("appid : %s\n", appid);
4738 static int get_capp_list()
4741 pkgmgrinfo_appinfo_filter_h handle;
4742 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4743 if (ret != PMINFO_R_OK)
4745 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4746 if (ret != PMINFO_R_OK) {
4747 pkgmgrinfo_appinfo_filter_destroy(handle);
4750 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4751 if (ret != PMINFO_R_OK) {
4752 pkgmgrinfo_appinfo_filter_destroy(handle);
4755 pkgmgrinfo_appinfo_filter_destroy(handle);
4760 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4761 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4762 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4763 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4766 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4767 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4768 * @brief This API counts the application that satisfy the filter conditions
4770 * @par This API is for package-manager client application
4771 * @par Sync (or) Async : Synchronous API
4773 * @param[in] handle pointer to the application info filter handle.
4774 * @param[in] count pointer to store count value
4775 * @param[in] uid the addressee user id of the instruction
4776 * @return 0 if success, error code(<0) if fail
4777 * @retval PMINFO_R_OK success
4778 * @retval PMINFO_R_EINVAL invalid argument
4779 * @retval PMINFO_R_ERROR internal error
4780 * @pre pkgmgrinfo_appinfo_filter_create()
4781 * @post pkgmgrinfo_appinfo_filter_destroy()
4782 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4784 static int get_capp_count()
4788 pkgmgrinfo_appinfo_filter_h handle;
4789 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4790 if (ret != PMINFO_R_OK)
4792 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4793 if (ret != PMINFO_R_OK) {
4794 pkgmgrinfo_appinfo_filter_destroy(handle);
4797 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4798 if (ret != PMINFO_R_OK) {
4799 pkgmgrinfo_appinfo_filter_destroy(handle);
4802 printf("No of capp: %d\n", count);
4803 pkgmgrinfo_appinfo_filter_destroy(handle);
4808 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4809 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4811 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4812 * @brief This API creates the application's metadata information filter handle from db.
4814 * @par This API is for package-manager client application
4815 * @par Sync (or) Async : Synchronous API
4817 * @param[out] handle pointer to the application metadata info filter handle.
4818 * @return 0 if success, error code(<0) if fail
4819 * @retval PMINFO_R_OK success
4820 * @retval PMINFO_R_EINVAL invalid argument
4821 * @retval PMINFO_R_ERROR internal error
4823 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4824 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4826 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4829 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4830 printf("appid : %s\n", appid);
4834 static int get_app_list(const char *mkey, const char *mvalue)
4837 pkgmgrinfo_appinfo_metadata_filter_h handle;
4838 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4839 if (ret != PMINFO_R_OK)
4841 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4842 if (ret != PMINFO_R_OK) {
4843 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4846 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4847 if (ret != PMINFO_R_OK) {
4848 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4851 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4856 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4859 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4860 * @brief This API destroys the application's metadata information filter handle.
4862 * @par This API is for package-manager client application
4863 * @par Sync (or) Async : Synchronous API
4865 * @param[in] handle pointer to the application metadata info filter handle.
4866 * @return 0 if success, error code(<0) if fail
4867 * @retval PMINFO_R_OK success
4868 * @retval PMINFO_R_EINVAL invalid argument
4869 * @retval PMINFO_R_ERROR internal error
4870 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4872 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4874 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4877 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4878 printf("appid : %s\n", appid);
4882 static int get_app_list(const char *mkey, const char *mvalue)
4885 pkgmgrinfo_appinfo_metadata_filter_h handle;
4886 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4887 if (ret != PMINFO_R_OK)
4889 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4890 if (ret != PMINFO_R_OK) {
4891 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4894 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4895 if (ret != PMINFO_R_OK) {
4896 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4899 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4904 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4907 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4908 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4909 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4911 * @par This API is for package-manager client application
4912 * @par Sync (or) Async : Synchronous API
4914 * @param[in] handle pointer to the application metadata info filter handle.
4915 * @param[in] key pointer to metadata key
4916 * @param[in] value pointer to metadata value
4917 * @return 0 if success, error code(<0) if fail
4918 * @retval PMINFO_R_OK success
4919 * @retval PMINFO_R_EINVAL invalid argument
4920 * @retval PMINFO_R_ERROR internal error
4921 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4922 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4923 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4925 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4928 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4929 printf("appid : %s\n", appid);
4933 static int get_app_list(const char *mkey, const char *mvalue)
4936 pkgmgrinfo_appinfo_metadata_filter_h handle;
4937 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4938 if (ret != PMINFO_R_OK)
4940 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4941 if (ret != PMINFO_R_OK) {
4942 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4945 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4946 if (ret != PMINFO_R_OK) {
4947 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4950 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4955 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4956 const char *key, const char *value);
4959 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4960 * @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)
4961 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4962 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4963 * negative value, no more callbacks will be called and API will return.
4965 * @par This API is for package-manager client application
4966 * @par Sync (or) Async : Synchronous API
4968 * @param[in] handle pointer to the application metadata info filter handle.
4969 * @param[in] app_cb function pointer to callback
4970 * @param[in] user_data pointer to user data
4971 * @param[in] uid the addressee user id of the instruction
4972 * @return 0 if success, error code(<0) if fail
4973 * @retval PMINFO_R_OK success
4974 * @retval PMINFO_R_EINVAL invalid argument
4975 * @retval PMINFO_R_ERROR internal error
4976 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4977 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4979 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4982 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4983 printf("appid : %s\n", appid);
4987 static int get_app_list(const char *mkey, const char *mvalue)
4990 pkgmgrinfo_appinfo_metadata_filter_h handle;
4991 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4992 if (ret != PMINFO_R_OK)
4994 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4995 if (ret != PMINFO_R_OK) {
4996 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4999 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5000 if (ret != PMINFO_R_OK) {
5001 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5004 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5009 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5010 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5011 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5012 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5014 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5015 * @brief This API creates the package cert information handle to get data from db.
5017 * @par This API is for package-manager client application
5018 * @par Sync (or) Async : Synchronous API
5020 * @param[out] handle pointer to the package cert handle.
5021 * @return 0 if success, error code(<0) if fail
5022 * @retval PMINFO_R_OK success
5023 * @retval PMINFO_R_EINVAL invalid argument
5024 * @retval PMINFO_R_ERROR internal error
5026 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5027 * @see pkgmgrinfo_pkginfo_get_cert_value()
5028 * @see pkgmgrinfo_pkginfo_load_certinfo()
5030 static int get_cert_info(const char *pkgid)
5033 pkgmgrinfo_certinfo_h handle;
5034 char *auth_cert = NULL;
5035 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5036 if (ret != PMINFO_R_OK)
5038 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5039 if (ret != PMINFO_R_OK) {
5040 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5043 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5044 if (ret != PMINFO_R_OK) {
5045 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5048 printf("Author root certificate: %s\n", auth_root);
5049 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5054 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5057 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5058 * @brief This API loads the package cert information handle with data from db.
5060 * @par This API is for package-manager client application
5061 * @par Sync (or) Async : Synchronous API
5063 * @param[in] pkgid pointer to the package ID.
5064 * @param[in] handle pointer to the package cert handle.
5065 * @return 0 if success, error code(<0) if fail
5066 * @retval PMINFO_R_OK success
5067 * @retval PMINFO_R_EINVAL invalid argument
5068 * @retval PMINFO_R_ERROR internal error
5069 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5070 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5071 * @see pkgmgrinfo_pkginfo_get_cert_value()
5073 static int get_cert_info(const char *pkgid)
5076 pkgmgrinfo_certinfo_h handle;
5077 char *auth_cert = NULL;
5078 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5079 if (ret != PMINFO_R_OK)
5081 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5082 if (ret != PMINFO_R_OK) {
5083 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5086 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5087 if (ret != PMINFO_R_OK) {
5088 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5091 printf("Author root certificate: %s\n", auth_root);
5092 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5097 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5100 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5101 * @brief This API gets the package cert information from the handle
5103 * @par This API is for package-manager client application
5104 * @par Sync (or) Async : Synchronous API
5106 * @param[in] handle pointer to the package cert handle.
5107 * @param[in] cert_type certificate type
5108 * @param[out] cert_value pointer to hold certificate value
5109 * @return 0 if success, error code(<0) if fail
5110 * @retval PMINFO_R_OK success
5111 * @retval PMINFO_R_EINVAL invalid argument
5112 * @retval PMINFO_R_ERROR internal error
5113 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5114 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5115 * @see pkgmgrinfo_pkginfo_load_certinfo()
5117 static int get_cert_info(const char *pkgid)
5120 pkgmgrinfo_certinfo_h handle;
5121 char *auth_cert = NULL;
5122 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5123 if (ret != PMINFO_R_OK)
5125 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5126 if (ret != PMINFO_R_OK) {
5127 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5130 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5131 if (ret != PMINFO_R_OK) {
5132 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5135 printf("Author root certificate: %s\n", auth_root);
5136 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5141 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5144 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5145 * @brief This API destroys the package cert information handle freeing up all the resources
5147 * @par This API is for package-manager client application
5148 * @par Sync (or) Async : Synchronous API
5150 * @param[in] handle pointer to the package cert handle.
5151 * @return 0 if success, error code(<0) if fail
5152 * @retval PMINFO_R_OK success
5153 * @retval PMINFO_R_EINVAL invalid argument
5154 * @retval PMINFO_R_ERROR internal error
5155 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5157 * @see pkgmgrinfo_pkginfo_load_certinfo()
5159 static int get_cert_info(const char *pkgid)
5162 pkgmgrinfo_certinfo_h handle;
5163 char *auth_cert = NULL;
5164 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5165 if (ret != PMINFO_R_OK)
5167 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5168 if (ret != PMINFO_R_OK) {
5169 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5172 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5173 if (ret != PMINFO_R_OK) {
5174 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5177 printf("Author root certificate: %s\n", auth_root);
5178 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5183 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5186 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5187 * @brief This API deletes the package cert information from DB
5189 * @par This API is for package-manager client application
5190 * @par Sync (or) Async : Synchronous API
5192 * @param[in] pkgid pointer to the package ID.
5193 * @return 0 if success, error code(<0) if fail
5194 * @retval PMINFO_R_OK success
5195 * @retval PMINFO_R_EINVAL invalid argument
5196 * @retval PMINFO_R_ERROR internal error
5200 static int delete_cert_info(const char *pkgid)
5203 ret = pkgmgrinfo_delete_certinfo(pkgid);
5204 if (ret != PMINFO_R_OK)
5210 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5211 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5214 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5215 * @brief This API creates the package cert information handle to set data in db.
5217 * @par This API is for package-manager client application
5218 * @par Sync (or) Async : Synchronous API
5220 * @param[out] handle pointer to the package cert handle.
5221 * @return 0 if success, error code(<0) if fail
5222 * @retval PMINFO_R_OK success
5223 * @retval PMINFO_R_EINVAL invalid argument
5224 * @retval PMINFO_R_ERROR internal error
5226 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5227 * @see pkgmgrinfo_set_cert_value()
5228 * @see pkgmgrinfo_save_certinfo()
5230 static int set_cert_in_db(const char *pkgid)
5233 pkgmgrinfo_instcertinfo_h handle;
5234 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5235 if (ret != PMINFO_R_OK)
5237 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5238 if (ret != PMINFO_R_OK) {
5239 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5242 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5243 if (ret != PMINFO_R_OK) {
5244 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5247 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5252 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5255 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5256 * @brief This API sets the package cert information in the handle.
5258 * @par This API is for package-manager client application
5259 * @par Sync (or) Async : Synchronous API
5261 * @param[in] handle pointer to the package cert handle.
5262 * @param[in] cert_type certificate type.
5263 * @param[in] cert_value certificate value.
5264 * @return 0 if success, error code(<0) if fail
5265 * @retval PMINFO_R_OK success
5266 * @retval PMINFO_R_EINVAL invalid argument
5267 * @retval PMINFO_R_ERROR internal error
5268 * @pre pkgmgrinfo_create_certinfo_set_handle()
5269 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5270 * @see pkgmgrinfo_save_certinfo()
5272 static int set_cert_in_db(const char *pkgid)
5275 pkgmgrinfo_instcertinfo_h handle;
5276 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5277 if (ret != PMINFO_R_OK)
5279 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5280 if (ret != PMINFO_R_OK) {
5281 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5284 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5285 if (ret != PMINFO_R_OK) {
5286 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5289 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5294 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5297 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5298 * @brief This API saves the package cert information in the DB.
5300 * @par This API is for package-manager client application
5301 * @par Sync (or) Async : Synchronous API
5303 * @param[in] pkgid pointer to the package ID.
5304 * @param[in] handle pointer to the package cert handle.
5305 * @return 0 if success, error code(<0) if fail
5306 * @retval PMINFO_R_OK success
5307 * @retval PMINFO_R_EINVAL invalid argument
5308 * @retval PMINFO_R_ERROR internal error
5309 * @pre pkgmgrinfo_create_certinfo_set_handle()
5310 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5311 * @see pkgmgrinfo_save_certinfo()
5313 static int set_cert_in_db(const char *pkgid)
5316 pkgmgrinfo_instcertinfo_h handle;
5317 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5318 if (ret != PMINFO_R_OK)
5320 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5321 if (ret != PMINFO_R_OK) {
5322 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5325 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5326 if (ret != PMINFO_R_OK) {
5327 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5330 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5335 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5338 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5339 * @brief This API destroys the package cert information handle freeing up all the resources.
5341 * @par This API is for package-manager client application
5342 * @par Sync (or) Async : Synchronous API
5344 * @param[in] handle pointer to the package cert handle.
5345 * @return 0 if success, error code(<0) if fail
5346 * @retval PMINFO_R_OK success
5347 * @retval PMINFO_R_EINVAL invalid argument
5348 * @retval PMINFO_R_ERROR internal error
5349 * @pre pkgmgrinfo_create_certinfo_set_handle()
5351 * @see pkgmgrinfo_save_certinfo()
5353 static int set_cert_in_db(const char *pkgid)
5356 pkgmgrinfo_instcertinfo_h handle;
5357 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5358 if (ret != PMINFO_R_OK)
5360 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5361 if (ret != PMINFO_R_OK) {
5362 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5365 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5366 if (ret != PMINFO_R_OK) {
5367 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5370 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5375 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5378 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5379 * @brief This API gets the datacontrol info
5381 * @par This API is for package-manager client application
5382 * @par Sync (or) Async : Synchronous API
5384 * @param[in] providerid pointer to the providerid of dataconltrol.
5385 * @param[in] type pointer to the type of dataconltrol.
5386 * @param[out] appid pointer to hold appid, need to free after using
5387 * @param[out] access pointer to hold access, need to free after using
5388 * @return 0 if success, error code(<0) if fail
5389 * @retval PMINFO_R_OK success
5390 * @retval PMINFO_R_EINVAL invalid argument
5391 * @retval PMINFO_R_ERROR internal error
5394 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5397 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5398 * @brief This API gets the application 'guest mode visibility' value from the DB
5400 * @par This API is for package-manager client application
5401 * @par Sync (or) Async : Synchronous API
5403 * @param[in] handle pointer to application info handle
5404 * @param[out] status pointer to hold app guest mode visibility value
5405 * @return 0 if success, error code(<0) if fail
5406 * @retval PMINFO_R_OK success
5407 * @retval PMINFO_R_EINVAL invalid argument
5408 * @retval PMINFO_R_ERROR internal error
5409 * @pre pkgmgrinfo_appinfo_get_appinfo()
5410 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5411 * @see pkgmgrinfo_appinfo_get_appid()
5412 * @see pkgmgrinfo_appinfo_is_multiple()
5414 static int get_app_guestmode_visibility(const char *appid)
5418 pkgmgrinfo_appinfo_h handle;
5419 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5420 if (ret != PMINFO_R_OK)
5422 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5423 if (ret != PMINFO_R_OK) {
5424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5427 printf("app guest mode visibility: %d\n", status);
5428 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5433 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5436 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5437 * @brief This API sets the application 'guest mode visibility' value in the DB
5439 * @par This API is for package-manager client application
5440 * @par Sync (or) Async : Synchronous API
5442 * @param[in] handle pointer to application info handle
5443 * @param[out] status app guest mode visibility value
5444 * @return 0 if success, error code(<0) if fail
5445 * @retval PMINFO_R_OK success
5446 * @retval PMINFO_R_EINVAL invalid argument
5447 * @retval PMINFO_R_ERROR internal error
5448 * @pre pkgmgrinfo_appinfo_get_appinfo()
5449 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5450 * @see pkgmgrinfo_appinfo_get_appid()
5451 * @see pkgmgrinfo_appinfo_is_multiple()
5453 static int set_app_guestmode_visibility(const char *appid, bool value)
5456 pkgmgrinfo_appinfo_h handle;
5457 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5458 if (ret != PMINFO_R_OK)
5460 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5461 if (ret != PMINFO_R_OK) {
5462 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5465 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5470 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5471 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5474 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5475 * @brief This API sets the package 'installed_storage' value in db
5477 * @par This API is for package-manager client application
5478 * @par Sync (or) Async : Synchronous API
5480 * @param[in] pkgid pointer to the package ID.
5481 * @param[in] location package install location
5482 * @return 0 if success, error code(<0) if fail
5483 * @retval PMINFO_R_OK success
5484 * @retval PMINFO_R_EINVAL invalid argument
5485 * @retval PMINFO_R_ERROR internal error
5487 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5491 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5492 if (ret != PMINFO_R_OK) {
5499 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5500 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5503 * @pkgmgrinfo client API
5507 * @brief listening status type in pkgmgrinfo.
5509 #define PMINFO_CLIENT_STATUS_ALL 0x00
5510 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5511 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5512 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5513 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5514 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5515 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5518 * @brief This APIs provides pkgmgrinfo client listener
5520 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5521 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5522 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5523 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5524 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5528 * @pkgmgrinfo client API end
5536 #endif /* __PKG_INFO_H__ */