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);
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 *getUserDesktopPath(uid_t uid);
174 const char *getUserManifestPath(uid_t uid);
177 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
178 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
179 * @brief This API gets list of installed packages
181 * @par This API is for package-manager client application
182 * @par Sync (or) Async : Synchronous API
183 * @param[in] pkg_list_cb iteration function for list
184 * @param[in] user_data user data to be passed to callback function
185 * @param[in] uid the addressee user id of the instruction
186 * @return 0 if success, error code(<0) if fail
187 * @retval PMINFO_R_OK success
188 * @retval PMINFO_R_EINVAL invalid argument
189 * @retval PMINFO_R_ERROR internal error
193 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
197 pkgid1 = (char *)user_data;
198 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
199 if (strcmp(pkgid1, pkgid2) == 0) {
206 static int list_pkgs()
209 char *name = "helloworld";
210 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
211 if (ret != PMINFO_R_OK) {
218 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
219 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
221 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
222 * @brief This API creates the package information handle from db
224 * @par This API is for package-manager client application
225 * @par Sync (or) Async : Synchronous API
227 * @param[in] pkgid pointer to package ID
228 * @param[in] uid the addressee user id of the instruction
229 * @param[out] handle pointer to the package info handle.
230 * @return 0 if success, error code(<0) if fail
231 * @retval PMINFO_R_OK success
232 * @retval PMINFO_R_EINVAL invalid argument
233 * @retval PMINFO_R_ERROR internal error
235 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
236 * @see pkgmgrinfo_pkginfo_get_pkgid()
237 * @see pkgmgrinfo_pkginfo_is_removable()
239 static int get_pkg_type(const char *pkgid)
243 pkgmgrinfo_pkginfo_h handle;
244 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
245 if (ret != PMINFO_R_OK)
247 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
248 if (ret != PMINFO_R_OK) {
249 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
252 printf("pkgtype: %s\n", type);
253 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
258 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
259 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
262 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
263 * @brief This API gets the package name from the package ID
265 * @par This API is for package-manager client application
266 * @par Sync (or) Async : Synchronous API
268 * @param[in] handle pointer to package info handle
269 * @param[out] pkg_name pointer to hold package name
270 * @return 0 if success, error code(<0) if fail
271 * @retval PMINFO_R_OK success
272 * @retval PMINFO_R_EINVAL invalid argument
273 * @retval PMINFO_R_ERROR internal error
274 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
275 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
276 * @see pkgmgrinfo_pkginfo_get_type()
277 * @see pkgmgrinfo_pkginfo_is_removable()
279 static int get_pkg_name(const char *pkgid)
282 char *pkgname = NULL;
283 pkgmgrinfo_pkginfo_h handle;
284 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
285 if (ret != PMINFO_R_OK)
287 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
288 if (ret != PMINFO_R_OK) {
289 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
292 printf("pkgname: %s\n", pkgname);
293 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
298 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
301 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
302 * @brief This API gets the package id from the package ID
304 * @par This API is for package-manager client application
305 * @par Sync (or) Async : Synchronous API
307 * @param[in] handle pointer to package info handle
308 * @param[out] pkgid pointer to hold package id
309 * @return 0 if success, error code(<0) if fail
310 * @retval PMINFO_R_OK success
311 * @retval PMINFO_R_EINVAL invalid argument
312 * @retval PMINFO_R_ERROR internal error
313 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
314 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
315 * @see pkgmgrinfo_pkginfo_get_type()
316 * @see pkgmgrinfo_pkginfo_is_removable()
318 static int get_pkgid(const char *pkgid)
322 pkgmgrinfo_pkginfo_h handle;
323 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
324 if (ret != PMINFO_R_OK)
326 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
327 if (ret != PMINFO_R_OK) {
328 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
331 printf("pkg id: %s\n", pkg_id);
332 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
337 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
340 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
341 * @brief This API gets the package type from the package ID
343 * @par This API is for package-manager client application
344 * @par Sync (or) Async : Synchronous API
346 * @param[in] handle pointer to package info handle
347 * @param[out] type pointer to hold package type
348 * @return 0 if success, error code(<0) if fail
349 * @retval PMINFO_R_OK success
350 * @retval PMINFO_R_EINVAL invalid argument
351 * @retval PMINFO_R_ERROR internal error
352 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
353 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
354 * @see pkgmgrinfo_pkginfo_get_pkgid()
355 * @see pkgmgrinfo_pkginfo_is_removable()
357 static int get_pkg_type(const char *pkgid)
361 pkgmgrinfo_pkginfo_h handle;
362 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
363 if (ret != PMINFO_R_OK)
365 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
366 if (ret != PMINFO_R_OK) {
367 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
370 printf("pkgtype: %s\n", type);
371 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
376 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
379 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
380 * @brief This API gets the package version from the package ID
382 * @par This API is for package-manager client application
383 * @par Sync (or) Async : Synchronous API
385 * @param[in] handle pointer to package info handle
386 * @param[out] version pointer to hold package version
387 * @return 0 if success, error code(<0) if fail
388 * @retval PMINFO_R_OK success
389 * @retval PMINFO_R_EINVAL invalid argument
390 * @retval PMINFO_R_ERROR internal error
391 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
392 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
393 * @see pkgmgrinfo_pkginfo_get_pkgid()
394 * @see pkgmgrinfo_pkginfo_is_removable()
396 static int get_pkg_version(const char *pkgid)
399 char *version = NULL;
400 pkgmgrinfo_pkginfo_h handle;
401 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
402 if (ret != PMINFO_R_OK)
404 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
405 if (ret != PMINFO_R_OK) {
406 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
409 printf("pkg version: %s\n", version);
410 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
415 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
418 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
419 * @brief This API gets the package api_version from the package ID
421 * @par This API is for package-manager client application
422 * @par Sync (or) Async : Synchronous API
424 * @param[in] handle pointer to package info handle
425 * @param[out] api_version pointer to hold package api_version
426 * @return 0 if success, error code(<0) if fail
427 * @retval PMINFO_R_OK success
428 * @retval PMINFO_R_EINVAL invalid argument
429 * @retval PMINFO_R_ERROR internal error
430 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
431 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
432 * @see pkgmgrinfo_pkginfo_get_pkgid()
433 * @see pkgmgrinfo_pkginfo_is_removable()
435 static int get_pkg_api_version(const char *pkgid)
438 char *api_version = NULL;
439 pkgmgrinfo_pkginfo_h handle = NULL;
440 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
441 if (ret != PMINFO_R_OK)
443 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
444 if (ret != PMINFO_R_OK) {
445 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
448 printf("pkg api_version: %s\n", api_version);
449 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
454 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
457 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
458 * @brief This API gets tep(tizen expansion package) file name associated with the package
460 * @par This API is for package-manager client application
461 * @par Sync (or) Async : Synchronous API
463 * @param[in] handle pointer to the pkginfo handle.
464 * @param[out] tep_name pointer to hold tep name
465 * @return 0 if success, error code(<0) if fail
466 * @retval PMINFO_R_OK success
467 * @retval PMINFO_R_EINVAL invalid argument
468 * @retval PMINFO_R_ERROR internal error
469 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
470 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
471 * @see pkgmgrinfo_pkginfo_get_pkgid()
473 static int get_tep_name(const char *pkgid)
476 char *tep_name = NULL;
477 pkgmgrinfo_pkginfo_h handle = NULL;
478 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
479 if (ret != PMINFO_R_OK)
481 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
482 if (ret != PMINFO_R_OK) {
483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
486 printf("TEP name is: %s\n", tep_name);
487 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
492 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
495 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
496 * @brief This API gets the package install location from the package ID
498 * @par This API is for package-manager client application
499 * @par Sync (or) Async : Synchronous API
501 * @param[in] handle pointer to package info handle
502 * @param[out] location pointer to hold package install location
503 * @return 0 if success, error code(<0) if fail
504 * @retval PMINFO_R_OK success
505 * @retval PMINFO_R_EINVAL invalid argument
506 * @retval PMINFO_R_ERROR internal error
507 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
508 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
509 * @see pkgmgrinfo_pkginfo_get_pkgid()
510 * @see pkgmgrinfo_pkginfo_is_removable()
512 static int get_pkg_install_location(const char *pkgid)
515 pkgmgrinfo_install_location location;
516 pkgmgrinfo_pkginfo_h handle;
517 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
518 if (ret != PMINFO_R_OK)
520 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
521 if (ret != PMINFO_R_OK) {
522 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
525 printf("pkg install location: %d\n", location);
526 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
531 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
534 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
535 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
536 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
537 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
539 * @par This API is for package-manager client application
540 * @par Sync (or) Async : Synchronous API
542 * @param[in] handle pointer to package info handle
543 * @param[out] size pointer to hold package size
544 * @return 0 if success, error code(<0) if fail
545 * @retval PMINFO_R_OK success
546 * @retval PMINFO_R_EINVAL invalid argument
547 * @retval PMINFO_R_ERROR internal error
548 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
549 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
550 * @see pkgmgrinfo_pkginfo_get_pkgid()
551 * @see pkgmgrinfo_pkginfo_is_removable()
553 static int get_pkg_size(const char *pkgid)
557 pkgmgrinfo_pkginfo_h handle;
558 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
559 if (ret != PMINFO_R_OK)
561 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
562 if (ret != PMINFO_R_OK) {
563 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
566 printf("pkgsize: %d\n", size);
567 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
572 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
575 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
576 * @brief This API gets the installed package total size on the target.
578 * @par This API is for package-manager client application
579 * @par Sync (or) Async : Synchronous API
581 * @param[in] handle pointer to package info handle
582 * @param[out] size pointer to hold package total size
583 * @return 0 if success, error code(<0) if fail
584 * @retval PMINFO_R_OK success
585 * @retval PMINFO_R_EINVAL invalid argument
586 * @retval PMINFO_R_ERROR internal error
588 static int get_pkg_total_size(const char *pkgid)
592 pkgmgrinfo_pkginfo_h handle;
593 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
594 if (ret != PMINFO_R_OK)
596 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
597 if (ret != PMINFO_R_OK) {
598 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
601 printf("pkg total size: %d\n", size);
602 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
607 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
610 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
611 * @brief This API gets the installed package data size on the target.
613 * @par This API is for package-manager client application
614 * @par Sync (or) Async : Synchronous API
616 * @param[in] handle pointer to package info handle
617 * @param[out] size pointer to hold package data size
618 * @return 0 if success, error code(<0) if fail
619 * @retval PMINFO_R_OK success
620 * @retval PMINFO_R_EINVAL invalid argument
621 * @retval PMINFO_R_ERROR internal error
623 static int get_pkg_data_size(const char *pkgid)
627 pkgmgrinfo_pkginfo_h handle;
628 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
629 if (ret != PMINFO_R_OK)
631 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
632 if (ret != PMINFO_R_OK) {
633 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
636 printf("pkg data size: %d\n", size);
637 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
642 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
645 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
646 * @brief This API gets the package icon from the package ID
648 * @par This API is for package-manager client application
649 * @par Sync (or) Async : Synchronous API
651 * @param[in] handle pointer to package info handle
652 * @param[out] icon pointer to hold package icon
653 * @return 0 if success, error code(<0) if fail
654 * @retval PMINFO_R_OK success
655 * @retval PMINFO_R_EINVAL invalid argument
656 * @retval PMINFO_R_ERROR internal error
657 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
658 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
659 * @see pkgmgrinfo_pkginfo_get_pkgid()
660 * @see pkgmgrinfo_pkginfo_is_removable()
662 static int get_pkg_icon(const char *pkgid)
666 pkgmgrinfo_pkginfo_h handle;
667 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
668 if (ret != PMINFO_R_OK)
670 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
671 if (ret != PMINFO_R_OK) {
672 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
675 printf("pkg icon: %s\n", icon);
676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
681 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
684 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
685 * @brief This API gets the package label from the package ID
687 * @par This API is for package-manager client application
688 * @par Sync (or) Async : Synchronous API
690 * @param[in] handle pointer to package info handle
691 * @param[out] label pointer to hold package label
692 * @return 0 if success, error code(<0) if fail
693 * @retval PMINFO_R_OK success
694 * @retval PMINFO_R_EINVAL invalid argument
695 * @retval PMINFO_R_ERROR internal error
696 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
697 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
698 * @see pkgmgrinfo_pkginfo_get_pkgid()
699 * @see pkgmgrinfo_pkginfo_is_removable()
701 static int get_pkg_label(const char *pkgid)
705 pkgmgrinfo_pkginfo_h handle;
706 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
707 if (ret != PMINFO_R_OK)
709 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
710 if (ret != PMINFO_R_OK) {
711 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
714 printf("pkg label: %s\n", label);
715 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
720 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
723 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
724 * @brief This API gets the package description from the package ID
726 * @par This API is for package-manager client application
727 * @par Sync (or) Async : Synchronous API
729 * @param[in] handle pointer to package info handle
730 * @param[out] description pointer to hold package description
731 * @return 0 if success, error code(<0) if fail
732 * @retval PMINFO_R_OK success
733 * @retval PMINFO_R_EINVAL invalid argument
734 * @retval PMINFO_R_ERROR internal error
735 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
736 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
737 * @see pkgmgrinfo_pkginfo_get_pkgid()
738 * @see pkgmgrinfo_pkginfo_is_removable()
740 static int get_pkg_description(const char *pkgid)
743 char *description = NULL;
744 pkgmgrinfo_pkginfo_h handle;
745 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
746 if (ret != PMINFO_R_OK)
748 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
749 if (ret != PMINFO_R_OK) {
750 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
753 printf("pkg description: %s\n", description);
754 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
759 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
762 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
763 * @brief This API gets the package's author name from the package ID
765 * @par This API is for package-manager client application
766 * @par Sync (or) Async : Synchronous API
768 * @param[in] handle pointer to package info handle
769 * @param[out] author_name pointer to hold package author name
770 * @return 0 if success, error code(<0) if fail
771 * @retval PMINFO_R_OK success
772 * @retval PMINFO_R_EINVAL invalid argument
773 * @retval PMINFO_R_ERROR internal error
774 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
775 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
776 * @see pkgmgrinfo_pkginfo_get_pkgid()
777 * @see pkgmgrinfo_pkginfo_is_removable()
779 static int get_pkg_author_name(const char *pkgid)
782 char *author_name = NULL;
783 pkgmgrinfo_pkginfo_h handle;
784 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
785 if (ret != PMINFO_R_OK)
787 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
788 if (ret != PMINFO_R_OK) {
789 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
792 printf("pkg author name: %s\n", author_name);
793 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
798 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
801 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
802 * @brief This API gets the package's author email from the package ID
804 * @par This API is for package-manager client application
805 * @par Sync (or) Async : Synchronous API
807 * @param[in] handle pointer to package info handle
808 * @param[out] author_email pointer to hold package author email
809 * @return 0 if success, error code(<0) if fail
810 * @retval PMINFO_R_OK success
811 * @retval PMINFO_R_EINVAL invalid argument
812 * @retval PMINFO_R_ERROR internal error
813 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
814 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
815 * @see pkgmgrinfo_pkginfo_get_pkgid()
816 * @see pkgmgrinfo_pkginfo_is_removable()
818 static int get_pkg_author_email(const char *pkgid)
821 char *author_email = NULL;
822 pkgmgrinfo_pkginfo_h handle;
823 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
824 if (ret != PMINFO_R_OK)
826 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
827 if (ret != PMINFO_R_OK) {
828 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
831 printf("pkg author email: %s\n", author_email);
832 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
837 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
840 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
841 * @brief This API gets the package's author href from the package ID
843 * @par This API is for package-manager client application
844 * @par Sync (or) Async : Synchronous API
846 * @param[in] handle pointer to package info handle
847 * @param[out] author_href pointer to hold package author href
848 * @return 0 if success, error code(<0) if fail
849 * @retval PMINFO_R_OK success
850 * @retval PMINFO_R_EINVAL invalid argument
851 * @retval PMINFO_R_ERROR internal error
852 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
853 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
854 * @see pkgmgrinfo_pkginfo_get_pkgid()
855 * @see pkgmgrinfo_pkginfo_is_removable()
857 static int get_pkg_author_href(const char *pkgid)
860 char *author_href = NULL;
861 pkgmgrinfo_pkginfo_h handle;
862 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
863 if (ret != PMINFO_R_OK)
865 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
866 if (ret != PMINFO_R_OK) {
867 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
870 printf("pkg author href: %s\n", author_href);
871 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
876 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
879 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
880 * @brief This API gets the package installed storagae value from the package ID
882 * @par This API is for package-manager client application
883 * @par Sync (or) Async : Synchronous API
885 * @param[in] handle pointer to package info handle
886 * @param[out] storage pointer to hold package installed storage
887 * @return 0 if success, error code(<0) if fail
888 * @retval PMINFO_R_OK success
889 * @retval PMINFO_R_EINVAL invalid argument
890 * @retval PMINFO_R_ERROR internal error
891 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
892 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
893 * @see pkgmgrinfo_pkginfo_get_pkgid()
894 * @see pkgmgrinfo_pkginfo_is_removable()
896 static int get_pkg_installed_storage(const char *pkgid)
899 pkgmgrinfo_installed_storage storage;
900 pkgmgrinfo_pkginfo_h handle;
901 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
902 if (ret != PMINFO_R_OK)
904 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
905 if (ret != PMINFO_R_OK) {
906 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
909 printf("pkg installed storage: %d\n", storage);
910 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
915 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
918 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
919 * @brief This API gets the installed time of package from the package ID
921 * @par This API is for package-manager client application
922 * @par Sync (or) Async : Synchronous API
924 * @param[in] handle pointer to package info handle
925 * @param[out] installed_time pointer to hold installed time of package
926 * @return 0 if success, error code(<0) if fail
927 * @retval PMINFO_R_OK success
928 * @retval PMINFO_R_EINVAL invalid argument
929 * @retval PMINFO_R_ERROR internal error
930 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
931 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
932 * @see pkgmgrinfo_pkginfo_get_pkgid()
933 * @see pkgmgrinfo_pkginfo_is_removable()
935 static int get_pkg_installed_time(const char *pkgid)
938 int installed_time = 0;
939 pkgmgrinfo_pkginfo_h handle;
940 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
941 if (ret != PMINFO_R_OK)
943 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
944 if (ret != PMINFO_R_OK) {
945 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
948 printf("installed_time: %d\n", installed_time);
949 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
954 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
957 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
958 * @brief This API gets the launch mode of package from the package ID
960 * @par This API is for package-manager client application
961 * @par Sync (or) Async : Synchronous API
963 * @param[in] handle pointer to package info handle
964 * @param[out] mode pointer to hold launch mode of package
965 * @return 0 if success, error code(<0) if fail
966 * @retval PMINFO_R_OK success
967 * @retval PMINFO_R_EINVAL invalid argument
968 * @retval PMINFO_R_ERROR internal error
969 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
970 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
971 * @see pkgmgrinfo_pkginfo_get_pkgid()
972 * @see pkgmgrinfo_pkginfo_is_removable()
974 static int get_pkg_launch_mode(const char *pkgid)
977 char *launch_mode = NULL;
978 pkgmgrinfo_pkginfo_h handle;
979 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
980 if (ret != PMINFO_R_OK)
982 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
983 if (ret != PMINFO_R_OK) {
984 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
987 printf("launch mode: %s\n", mode);
988 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
993 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
996 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
997 * @brief This API gets the store client id of package from the package ID
999 * @par This API is for package-manager client application
1000 * @par Sync (or) Async : Synchronous API
1002 * @param[in] handle pointer to package info handle
1003 * @param[out] storeclientid pointer to hold store client id of package
1004 * @return 0 if success, error code(<0) if fail
1005 * @retval PMINFO_R_OK success
1006 * @retval PMINFO_R_EINVAL invalid argument
1007 * @retval PMINFO_R_ERROR internal error
1008 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1009 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1010 * @see pkgmgrinfo_pkginfo_get_pkgid()
1011 * @see pkgmgrinfo_pkginfo_is_removable()
1013 static int get_pkg_storeclientid(const char *pkgid)
1016 char *storeclientid = 0;
1017 pkgmgrinfo_pkginfo_h handle;
1018 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1019 if (ret != PMINFO_R_OK)
1021 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1022 if (ret != PMINFO_R_OK) {
1023 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1026 printf(store client id: %s\n", storeclientid);
1027 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1032 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1035 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1036 * @brief This API gets the main app id of package from the package ID
1038 * @par This API is for package-manager client application
1039 * @par Sync (or) Async : Synchronous API
1041 * @param[in] handle pointer to package info handle
1042 * @param[out] mainappid pointer to hold main app id of package
1043 * @return 0 if success, error code(<0) if fail
1044 * @retval PMINFO_R_OK success
1045 * @retval PMINFO_R_EINVAL invalid argument
1046 * @retval PMINFO_R_ERROR internal error
1047 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1048 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1049 * @see pkgmgrinfo_pkginfo_get_pkgid()
1050 * @see pkgmgrinfo_pkginfo_is_removable()
1052 static int get_pkg_mainappid(const char *pkgid)
1055 char *mainappid = 0;
1056 pkgmgrinfo_pkginfo_h handle;
1057 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1058 if (ret != PMINFO_R_OK)
1060 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1061 if (ret != PMINFO_R_OK) {
1062 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1065 printf(main app id: %s\n", mainappid);
1066 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1071 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1074 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1075 * @brief This API gets the url of package from the package ID
1077 * @par This API is for package-manager client application
1078 * @par Sync (or) Async : Synchronous API
1080 * @param[in] handle pointer to package info handle
1081 * @param[out] url pointer to hold url of package
1082 * @return 0 if success, error code(<0) if fail
1083 * @retval PMINFO_R_OK success
1084 * @retval PMINFO_R_EINVAL invalid argument
1085 * @retval PMINFO_R_ERROR internal error
1086 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1087 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1088 * @see pkgmgrinfo_pkginfo_get_pkgid()
1089 * @see pkgmgrinfo_pkginfo_is_removable()
1091 static int get_pkg_url(const char *pkgid)
1095 pkgmgrinfo_pkginfo_h handle;
1096 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1097 if (ret != PMINFO_R_OK)
1099 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1100 if (ret != PMINFO_R_OK) {
1101 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1104 printf("url : %s\n", url);
1105 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1110 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1114 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1115 * @brief This API gets the root path of package
1117 * @par Sync (or) Async : Synchronous API
1119 * @param[in] handle pointer to package info handle
1120 * @param[out] path pointer to hold root path of package
1121 * @return 0 if success, error code(<0) if fail
1122 * @retval PMINFO_R_OK success
1123 * @retval PMINFO_R_EINVAL invalid argument
1124 * @retval PMINFO_R_ERROR internal error
1126 static int get_root_path(const char *pkgid)
1130 pkgmgrinfo_pkginfo_h handle;
1131 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1132 if (ret != PMINFO_R_OK)
1135 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1136 if (ret != PMINFO_R_OK) {
1137 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1140 printf("path : %s\n", path);
1141 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1147 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1151 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1152 * @brief This API gets the csc path of package
1154 * @par Sync (or) Async : Synchronous API
1156 * @param[in] handle pointer to package info handle
1157 * @param[out] path pointer to hold csc path of package
1158 * @return 0 if success, error code(<0) if fail
1159 * @retval PMINFO_R_OK success
1160 * @retval PMINFO_R_EINVAL invalid argument
1161 * @retval PMINFO_R_ERROR internal error
1163 static int get_csc_path(const char *pkgid)
1167 pkgmgrinfo_pkginfo_h handle;
1168 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1169 if (ret != PMINFO_R_OK)
1172 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1173 if (ret != PMINFO_R_OK) {
1174 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1177 printf("path : %s\n", path);
1178 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1184 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1187 * @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)
1188 * @brief This API compare the cert information from given package id
1190 * @par This API is for package-manager client application
1191 * @par Sync (or) Async : Synchronous API
1193 * @param[in] lhs_package_id pointer to first package ID
1194 * @param[in] rhs_package_id pointer to second package ID
1195 * @param[out] compare_result pointer to the compare result.
1196 * @return 0 if success, error code(<0) if fail
1197 * @retval PMINFO_R_OK success
1198 * @retval PMINFO_R_EINVAL invalid argument
1199 * @retval PMINFO_R_ERROR internal error
1201 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1202 * @see pkgmgrinfo_pkginfo_get_pkgid()
1203 * @see pkgmgrinfo_pkginfo_is_removable()
1205 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1208 pkgmgrinfo_cert_compare_result_type_e result;
1210 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1211 if (ret != PMINFO_R_OK) {
1214 printf("result: %d\n", result);
1219 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);
1220 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);
1222 * @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)
1223 * @brief This API compare the cert information from given app id
1225 * @par This API is for package-manager client application
1226 * @par Sync (or) Async : Synchronous API
1228 * @param[in] lhs_app_id pointer to first app ID
1229 * @param[in] rhs_app_id pointer to second app ID
1230 * @param[out] compare_result pointer to the compare result.
1231 * @return 0 if success, error code(<0) if fail
1232 * @retval PMINFO_R_OK success
1233 * @retval PMINFO_R_EINVAL invalid argument
1234 * @retval PMINFO_R_ERROR internal error
1236 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1237 * @see pkgmgrinfo_pkginfo_get_pkgid()
1238 * @see pkgmgrinfo_pkginfo_is_removable()
1240 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1243 pkgmgrinfo_cert_compare_result_type_e result;
1245 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1246 if (ret != PMINFO_R_OK) {
1249 printf("result: %d\n", result);
1254 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);
1255 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);
1257 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1258 * @brief This API gets the package 'removable' value from the package ID
1260 * @par This API is for package-manager client application
1261 * @par Sync (or) Async : Synchronous API
1263 * @param[in] handle pointer to package info handle
1264 * @param[out] removable pointer to hold package removable value
1265 * @return 0 if success, error code(<0) if fail
1266 * @retval PMINFO_R_OK success
1267 * @retval PMINFO_R_EINVAL invalid argument
1268 * @retval PMINFO_R_ERROR internal error
1269 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1270 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1271 * @see pkgmgrinfo_pkginfo_get_pkgid()
1272 * @see pkgmgrinfo_pkginfo_is_readonly()
1274 static int get_pkg_removable(const char *pkgid)
1278 pkgmgrinfo_pkginfo_h handle;
1279 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1280 if (ret != PMINFO_R_OK)
1282 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1283 if (ret != PMINFO_R_OK) {
1284 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1287 printf("pkg removable: %d\n", removable);
1288 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1293 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1296 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1297 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1299 * @par This API is for package-manager client application
1300 * @par Sync (or) Async : Synchronous API
1302 * @param[in] handle pointer to package info handle
1303 * @param[out] movable pointer to hold package movable state
1304 * @return 0 if success, error code(<0) if fail
1305 * @retval PMINFO_R_OK success
1306 * @retval PMINFO_R_EINVAL invalid argument
1307 * @retval PMINFO_R_ERROR internal error
1308 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1309 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1310 * @see pkgmgrinfo_pkginfo_get_pkgid()
1312 static int get_pkg_movable(const char *pkgid)
1316 pkgmgrinfo_pkginfo_h handle;
1317 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1318 if (ret != PMINFO_R_OK)
1320 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1321 if (ret != PMINFO_R_OK) {
1322 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1325 printf("pkg movable: %d\n", movable);
1326 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1331 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1334 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1335 * @brief This API gets the package 'preload' value from the package ID
1337 * @par This API is for package-manager client application
1338 * @par Sync (or) Async : Synchronous API
1340 * @param[in] handle pointer to package info handle
1341 * @param[out] preload pointer to hold package preload value
1342 * @return 0 if success, error code(<0) if fail
1343 * @retval PMINFO_R_OK success
1344 * @retval PMINFO_R_EINVAL invalid argument
1345 * @retval PMINFO_R_ERROR internal error
1346 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1347 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1348 * @see pkgmgrinfo_pkginfo_get_pkgid()
1349 * @see pkgmgrinfo_pkginfo_is_readonly()
1351 static int get_pkg_preload(const char *pkgid)
1355 pkgmgrinfo_pkginfo_h handle;
1356 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1357 if (ret != PMINFO_R_OK)
1359 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1360 if (ret != PMINFO_R_OK) {
1361 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1364 printf("pkg preload: %d\n", preload);
1365 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1370 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1373 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1374 * @brief This API gets the value for given handle is system or not
1376 * @par This API is for package-manager client application
1377 * @par Sync (or) Async : Synchronous API
1379 * @param[in] handle pointer to package info handle
1380 * @param[out] system pointer to hold system is or not
1381 * @return 0 if success, error code(<0) if fail
1382 * @retval PMINFO_R_OK success
1383 * @retval PMINFO_R_EINVAL invalid argument
1384 * @retval PMINFO_R_ERROR internal error
1385 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1386 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1387 * @see pkgmgrinfo_pkginfo_get_pkgid()
1388 * @see pkgmgrinfo_pkginfo_is_readonly()
1390 static int get_pkg_system(const char *pkgid)
1393 bool system = false;
1394 pkgmgrinfo_pkginfo_h handle = NULL;
1395 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1396 if (ret != PMINFO_R_OK)
1398 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1399 if (ret != PMINFO_R_OK) {
1400 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1403 printf("pkg system: %d\n", system);
1404 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1409 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1412 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1413 * @brief This API gets the package 'readonly' value from the package ID
1415 * @par This API is for package-manager client application
1416 * @par Sync (or) Async : Synchronous API
1418 * @param[in] handle pointer to package info handle
1419 * @param[out] readonly pointer to hold package readonly value
1420 * @return 0 if success, error code(<0) if fail
1421 * @retval PMINFO_R_OK success
1422 * @retval PMINFO_R_EINVAL invalid argument
1423 * @retval PMINFO_R_ERROR internal error
1424 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1425 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1426 * @see pkgmgrinfo_pkginfo_get_pkgid()
1427 * @see pkgmgrinfo_pkginfo_is_removable()
1429 static int get_pkg_readonly(const char *pkgid)
1433 pkgmgrinfo_pkginfo_h handle;
1434 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1435 if (ret != PMINFO_R_OK)
1437 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1438 if (ret != PMINFO_R_OK) {
1439 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1442 printf("pkg readonly: %d\n", readonly);
1443 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1448 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1452 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1453 * @brief This API gets the package 'upate' value from the package ID
1455 * @par This API is for package-manager client application
1456 * @par Sync (or) Async : Synchronous API
1458 * @param[in] handle pointer to package info handle
1459 * @param[out] update pointer to hold package update value
1460 * @return 0 if success, error code(<0) if fail
1461 * @retval PMINFO_R_OK success
1462 * @retval PMINFO_R_EINVAL invalid argument
1463 * @retval PMINFO_R_ERROR internal error
1464 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1465 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1466 * @see pkgmgrinfo_pkginfo_get_pkgid()
1468 static int get_pkg_update(const char *pkgid)
1472 pkgmgrinfo_pkginfo_h handle;
1473 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1474 if (ret != PMINFO_R_OK)
1476 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1477 if (ret != PMINFO_R_OK) {
1478 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1481 printf("pkg update: %d\n", update);
1482 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1487 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1490 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1491 * @brief This API gets the package 'support_disable' value from the package ID
1493 * @par This API is for package-manager client application
1494 * @par Sync (or) Async : Synchronous API
1496 * @param[in] handle pointer to package info handle
1497 * @param[out] support_disable pointer to hold package support_disable value
1498 * @return 0 if success, error code(<0) if fail
1499 * @retval PMINFO_R_OK success
1500 * @retval PMINFO_R_EINVAL invalid argument
1501 * @retval PMINFO_R_ERROR internal error
1502 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1503 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1504 * @see pkgmgrinfo_pkginfo_get_pkgid()
1506 static int get_pkg_support_disable(const char *pkgid)
1509 bool support_disable;
1510 pkgmgrinfo_pkginfo_h handle = NULL;
1511 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1512 if (ret != PMINFO_R_OK)
1514 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1515 if (ret != PMINFO_R_OK) {
1516 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1519 printf("pkg support_disable: %d\n", support_disable);
1520 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1525 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1528 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1529 * @brief This API gets whethere the given package is global package or user package
1531 * @par This API is for package-manager client application
1532 * @par Sync (or) Async : Synchronous API
1534 * @param[in] uid uid of the user to determine the database
1535 * @param[in] pkgid id of the current package
1536 * @return 1 if it a global package, 0 else
1539 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1543 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1544 * @brief This API gets the package 'accessible' value from the package ID
1546 * @par This API is for package-manager client application
1547 * @par Sync (or) Async : Synchronous API
1549 * @param[in] handle pointer to package info handle
1550 * @param[out] accessible pointer to hold package accessible value
1551 * @return 0 if success, error code(<0) if fail
1552 * @retval PMINFO_R_OK success
1553 * @retval PMINFO_R_EINVAL invalid argument
1554 * @retval PMINFO_R_ERROR internal error
1555 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1556 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1557 * @see pkgmgrinfo_pkginfo_get_pkgid()
1558 * @see pkgmgrinfo_pkginfo_is_readonly()
1560 static int get_pkg_accessible(const char *pkgid)
1564 pkgmgrinfo_pkginfo_h handle;
1565 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1566 if (ret != PMINFO_R_OK)
1568 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1569 if (ret != PMINFO_R_OK) {
1570 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1573 printf("pkg accessible: %d\n", accessible);
1574 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1579 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1582 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1583 * @brief This API destroys the package information handle freeing up all the resources
1585 * @par This API is for package-manager client application
1586 * @par Sync (or) Async : Synchronous API
1588 * @param[in] handle pointer to the package info handle
1589 * @return 0 if success, error code(<0) if fail
1590 * @retval PMINFO_R_OK success
1591 * @retval PMINFO_R_EINVAL invalid argument
1592 * @retval PMINFO_R_ERROR internal error
1593 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1595 * @see pkgmgrinfo_pkginfo_get_pkgid()
1596 * @see pkgmgrinfo_pkginfo_is_removable()
1598 static int get_pkg_type(const char *pkgid)
1602 pkgmgrinfo_pkginfo_h handle;
1603 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1604 if (ret != PMINFO_R_OK)
1606 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1607 if (ret != PMINFO_R_OK) {
1608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611 printf("pkgtype: %s\n", type);
1612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1617 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1620 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1621 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1622 The query will search the entire package information collected from the manifest file of all the installed packages
1624 * @par This API is for package-manager client application
1625 * @par Sync (or) Async : Synchronous API
1627 * @param[out] handle pointer to the package info filter handle.
1628 * @return 0 if success, error code(<0) if fail
1629 * @retval PMINFO_R_OK success
1630 * @retval PMINFO_R_EINVAL invalid argument
1631 * @retval PMINFO_R_ERROR internal error
1633 * @post pkgmgrinfo_pkginfo_filter_destroy()
1634 * @see pkgmgrinfo_pkginfo_filter_count()
1635 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1637 static int get_tpk_pkg_count()
1641 pkgmgrinfo_pkginfo_filter_h handle;
1642 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1643 if (ret != PMINFO_R_OK)
1645 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1646 if (ret != PMINFO_R_OK) {
1647 pkgmgrinfo_pkginfo_filter_destroy(handle);
1650 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1651 if (ret != PMINFO_R_OK) {
1652 pkgmgrinfo_pkginfo_filter_destroy(handle);
1655 printf("No of tpk pkgs: %d\n", count);
1656 pkgmgrinfo_pkginfo_filter_destroy(handle);
1661 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1664 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1665 * @brief This API destroys the package information filter handle freeing up all the resources
1667 * @par This API is for package-manager client application
1668 * @par Sync (or) Async : Synchronous API
1670 * @param[in] handle pointer to the package info filter handle.
1671 * @return 0 if success, error code(<0) if fail
1672 * @retval PMINFO_R_OK success
1673 * @retval PMINFO_R_EINVAL invalid argument
1674 * @retval PMINFO_R_ERROR internal error
1675 * @pre pkgmgrinfo_pkginfo_filter_create()
1677 * @see pkgmgrinfo_pkginfo_filter_count()
1678 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1680 static int get_tpk_pkg_count()
1684 pkgmgrinfo_pkginfo_filter_h handle;
1685 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1686 if (ret != PMINFO_R_OK)
1688 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1689 if (ret != PMINFO_R_OK) {
1690 pkgmgrinfo_pkginfo_filter_destroy(handle);
1693 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1694 if (ret != PMINFO_R_OK) {
1695 pkgmgrinfo_pkginfo_filter_destroy(handle);
1698 printf("No of tpk pkgs: %d\n", count);
1699 pkgmgrinfo_pkginfo_filter_destroy(handle);
1704 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1707 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1708 * @brief This API adds a boolean filter property to the filter handle
1710 * @par This API is for package-manager client application
1711 * @par Sync (or) Async : Synchronous API
1713 * @param[in] handle pointer to the package info filter handle.
1714 * @param[in] property boolean property name.
1715 * @param[in] value value corresponding to the property.
1716 * @return 0 if success, error code(<0) if fail
1717 * @retval PMINFO_R_OK success
1718 * @retval PMINFO_R_EINVAL invalid argument
1719 * @retval PMINFO_R_ERROR internal error
1720 * @pre pkgmgrinfo_pkginfo_filter_create()
1721 * @post pkgmgrinfo_pkginfo_filter_destroy()
1722 * @see pkgmgrinfo_pkginfo_filter_count()
1723 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1725 static int get_preload_pkg_count()
1729 pkgmgrinfo_pkginfo_filter_h handle;
1730 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1731 if (ret != PMINFO_R_OK)
1733 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1734 if (ret != PMINFO_R_OK) {
1735 pkgmgrinfo_pkginfo_filter_destroy(handle);
1738 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1739 if (ret != PMINFO_R_OK) {
1740 pkgmgrinfo_pkginfo_filter_destroy(handle);
1743 printf("No of preload pkgs: %d\n", count);
1744 pkgmgrinfo_pkginfo_filter_destroy(handle);
1749 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1750 const char *property, const bool value);
1753 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1754 * @brief This API adds an integer filter property to the filter handle
1756 * @par This API is for package-manager client application
1757 * @par Sync (or) Async : Synchronous API
1759 * @param[in] handle pointer to the package info filter handle.
1760 * @param[in] property integer property name.
1761 * @param[in] value value corresponding to the property.
1762 * @return 0 if success, error code(<0) if fail
1763 * @retval PMINFO_R_OK success
1764 * @retval PMINFO_R_EINVAL invalid argument
1765 * @retval PMINFO_R_ERROR internal error
1766 * @pre pkgmgrinfo_pkginfo_filter_create()
1767 * @post pkgmgrinfo_pkginfo_filter_destroy()
1768 * @see pkgmgrinfo_pkginfo_filter_count()
1769 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1771 static int get_pkg_count()
1775 pkgmgrinfo_pkginfo_filter_h handle;
1776 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1777 if (ret != PMINFO_R_OK)
1779 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1780 if (ret != PMINFO_R_OK) {
1781 pkgmgrinfo_pkginfo_filter_destroy(handle);
1784 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1785 if (ret != PMINFO_R_OK) {
1786 pkgmgrinfo_pkginfo_filter_destroy(handle);
1789 printf("No of preload pkgs: %d\n", count);
1790 pkgmgrinfo_pkginfo_filter_destroy(handle);
1795 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1796 const char *property, const int value);
1799 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1800 * @brief This API adds a string filter property to the filter handle
1802 * @par This API is for package-manager client application
1803 * @par Sync (or) Async : Synchronous API
1805 * @param[in] handle pointer to the package info filter handle.
1806 * @param[in] property string property name.
1807 * @param[in] value value corresponding to the property.
1808 * @return 0 if success, error code(<0) if fail
1809 * @retval PMINFO_R_OK success
1810 * @retval PMINFO_R_EINVAL invalid argument
1811 * @retval PMINFO_R_ERROR internal error
1812 * @pre pkgmgrinfo_pkginfo_filter_create()
1813 * @post pkgmgrinfo_pkginfo_filter_destroy()
1814 * @see pkgmgrinfo_pkginfo_filter_count()
1815 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1817 static int get_tpk_pkg_count()
1821 pkgmgrinfo_pkginfo_filter_h handle;
1822 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1823 if (ret != PMINFO_R_OK)
1825 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1826 if (ret != PMINFO_R_OK) {
1827 pkgmgrinfo_pkginfo_filter_destroy(handle);
1830 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1831 if (ret != PMINFO_R_OK) {
1832 pkgmgrinfo_pkginfo_filter_destroy(handle);
1835 printf("No of tpk pkgs: %d\n", count);
1836 pkgmgrinfo_pkginfo_filter_destroy(handle);
1841 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1842 const char *property, const char *value);
1845 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1846 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1848 * @par This API is for package-manager client application
1849 * @par Sync (or) Async : Synchronous API
1851 * @param[in] handle pointer to the package info filter handle.
1852 * @param[in] pkg_cb callback function.
1853 * @param[in] user_data user data to be passed to the callback function
1854 * @return 0 if success, error code(<0) if fail
1855 * @retval PMINFO_R_OK success
1856 * @retval PMINFO_R_EINVAL invalid argument
1857 * @retval PMINFO_R_ERROR internal error
1858 * @pre pkgmgrinfo_pkginfo_filter_create()
1859 * @post pkgmgrinfo_pkginfo_filter_destroy()
1860 * @see pkgmgrinfo_pkginfo_filter_count()
1862 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1865 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1866 printf("pkg id : %s\n", pkgid);
1870 static int get_tpk_pkg_list()
1873 pkgmgrinfo_pkginfo_filter_h handle;
1874 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1875 if (ret != PMINFO_R_OK)
1877 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1878 if (ret != PMINFO_R_OK) {
1879 pkgmgrinfo_pkginfo_filter_destroy(handle);
1882 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1883 if (ret != PMINFO_R_OK) {
1884 pkgmgrinfo_pkginfo_filter_destroy(handle);
1887 pkgmgrinfo_pkginfo_filter_destroy(handle);
1892 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1893 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1894 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1895 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1898 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1899 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1900 * @brief This API counts the package that satisfy the filter conditions
1902 * @par This API is for package-manager client application
1903 * @par Sync (or) Async : Synchronous API
1905 * @param[in] handle pointer to the package info filter handle.
1906 * @param[in] count pointer to store the count value.
1907 * @param[in] uid the addressee user id of the instruction
1908 * @return 0 if success, error code(<0) if fail
1909 * @retval PMINFO_R_OK success
1910 * @retval PMINFO_R_EINVAL invalid argument
1911 * @retval PMINFO_R_ERROR internal error
1912 * @pre pkgmgrinfo_pkginfo_filter_create()
1913 * @post pkgmgrinfo_pkginfo_filter_destroy()
1914 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1916 static int get_tpk_pkg_count()
1920 pkgmgrinfo_pkginfo_filter_h handle;
1921 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1922 if (ret != PMINFO_R_OK)
1924 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1925 if (ret != PMINFO_R_OK) {
1926 pkgmgrinfo_pkginfo_filter_destroy(handle);
1929 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1930 if (ret != PMINFO_R_OK) {
1931 pkgmgrinfo_pkginfo_filter_destroy(handle);
1934 printf("No of tpk pkgs: %d\n", count);
1935 pkgmgrinfo_pkginfo_filter_destroy(handle);
1940 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1941 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1943 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1944 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1945 * @brief This API gets the list of privilege for a particular package
1947 * @par This API is for package-manager client application
1948 * @par Sync (or) Async : Synchronous API
1949 * @param[in] handle pointer to the package info handle.
1950 * @param[in] privilege_func callback function for list
1951 * @param[in] user_data user data to be passed to callback function
1952 * @return 0 if success, error code(<0) if fail
1953 * @retval PMINFO_R_OK success
1954 * @retval PMINFO_R_EINVAL invalid argument
1955 * @retval PMINFO_R_ERROR internal error
1956 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1957 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1959 int privilege_func(const char *name, void *user_data)
1961 if (strcmp(name, (char *)user_data) == 0)
1967 static int list_privilege(const char *package, char *privilege)
1970 pkgmgrinfo_pkginfo_h handle;
1971 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1972 if (ret != PMINFO_R_OK)
1974 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1975 if (ret != PMINFO_R_OK) {
1976 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1979 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1984 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1985 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1987 /* TODO: add doxygen comment here */
1988 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
1989 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
1990 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1991 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1992 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1993 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1994 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1997 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
1998 * @brief This API copy the application information handle
2000 * @par This API is for package-manager client application
2001 * @par Sync (or) Async : Synchronous API
2003 * @param[in] handle pointer to the package info handle.
2004 * @param[out] handle pointer to the package info handle.
2005 * @return 0 if success, error code(<0) if fail
2006 * @retval PMINFO_R_OK success
2007 * @retval PMINFO_R_EINVAL invalid argument
2008 * @retval PMINFO_R_ERROR internal error
2010 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2012 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2016 pkgmgrinfo_pkginfo_h clone;
2018 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2019 if (ret != PMINFO_R_OK)
2023 printf("package: %s\n", clone->package);
2024 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2029 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2033 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2034 pkgmgrinfo_app_list_cb app_func, void *user_data)
2035 * @brief This API gets list of installed applications for a particular package
2037 * @par This API is for package-manager client application
2038 * @par Sync (or) Async : Synchronous API
2039 * @param[in] handle package info handle
2040 * @param[in] component application component
2041 * @param[in] app_func iteration function for list
2042 * @param[in] user_data user data to be passed to callback function
2043 * @return 0 if success, error code(<0) if fail
2044 * @retval PMINFO_R_OK success
2045 * @retval PMINFO_R_EINVAL invalid argument
2046 * @retval PMINFO_R_ERROR internal error
2047 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2048 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2050 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2053 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2054 printf("appid : %s\n", appid);
2058 static int list_apps(const char *pkgid)
2061 pkgmgrinfo_pkginfo_h handle;
2062 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2063 if (ret != PMINFO_R_OK)
2065 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2066 if (ret != PMINFO_R_OK) {
2067 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2070 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2075 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2076 pkgmgrinfo_app_list_cb app_func, void *user_data);
2077 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2078 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2080 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2081 * @brief This API gets list of installed applications from all packages with minimum informaion.
2083 * @par This API is for package-manager client application
2084 * @par Sync (or) Async : Synchronous API
2085 * @param[in] app_func iteration function for list
2086 * @param[in] user_data user data to be passed to callback function
2087 * @return 0 if success, error code(<0) if fail
2088 * @retval PMINFO_R_OK success
2089 * @retval PMINFO_R_EINVAL invalid argument
2090 * @retval PMINFO_R_ERROR internal error
2094 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2096 char *pkgid1 = NULL;
2097 char *pkgid2 = NULL;
2098 pkgid1 = (char *)user_data;
2099 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2100 if (strcmp(pkgid1, pkgid2) == 0) {
2107 static int list_apps()
2110 char *name = "helloworld";
2111 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2112 if (ret != PMINFO_R_OK) {
2119 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2120 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2122 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2123 * @brief This API gets list of installed applications from all packages.
2125 * @par This API is for package-manager client application
2126 * @par Sync (or) Async : Synchronous API
2127 * @param[in] app_func iteration function for list
2128 * @param[in] user_data user data to be passed to callback function
2129 * @return 0 if success, error code(<0) if fail
2130 * @retval PMINFO_R_OK success
2131 * @retval PMINFO_R_EINVAL invalid argument
2132 * @retval PMINFO_R_ERROR internal error
2136 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2138 char *pkgid1 = NULL;
2139 char *pkgid2 = NULL;
2140 pkgid1 = (char *)user_data;
2141 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2142 if (strcmp(pkgid1, pkgid2) == 0) {
2149 static int list_apps()
2152 char *name = "helloworld";
2153 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2154 if (ret != PMINFO_R_OK) {
2161 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2162 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2165 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2166 * @brief This API creates the application information handle from db
2168 * @par This API is for package-manager client application
2169 * @par Sync (or) Async : Synchronous API
2171 * @param[in] appid pointer to appid
2172 * @param[out] handle pointer to the application info handle.
2173 * @return 0 if success, error code(<0) if fail
2174 * @retval PMINFO_R_OK success
2175 * @retval PMINFO_R_EINVAL invalid argument
2176 * @retval PMINFO_R_ERROR internal error
2178 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2179 * @see pkgmgrinfo_appinfo_get_pkgid()
2180 * @see pkgmgrinfo_appinfo_is_multiple()
2182 static int get_app_type(const char *appid)
2186 pkgmgrinfo_appinfo_h handle;
2187 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2188 if (ret != PMINFO_R_OK)
2190 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2191 if (ret != PMINFO_R_OK) {
2192 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2195 printf("apptype: %s\n", type);
2196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2201 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2202 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2204 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2205 * @brief This API gets the application ID
2207 * @par This API is for package-manager client application
2208 * @par Sync (or) Async : Synchronous API
2210 * @param[in] handle pointer to the application info handle.
2211 * @param[out] appid pointer to hold appid
2212 * @return 0 if success, error code(<0) if fail
2213 * @retval PMINFO_R_OK success
2214 * @retval PMINFO_R_EINVAL invalid argument
2215 * @retval PMINFO_R_ERROR internal error
2216 * @pre pkgmgrinfo_appinfo_get_appinfo()
2217 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2218 * @see pkgmgrinfo_appinfo_get_pkgid()
2219 * @see pkgmgrinfo_appinfo_is_multiple()
2221 static int get_app_id(const char *appid)
2224 char *app_id = NULL;
2225 pkgmgrinfo_appinfo_h handle;
2226 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2227 if (ret != PMINFO_R_OK)
2229 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2230 if (ret != PMINFO_R_OK) {
2231 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2234 printf("app id: %s\n", app_id);
2235 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2240 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2243 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2244 * @brief This API gets the package name of the application
2246 * @par This API is for package-manager client application
2247 * @par Sync (or) Async : Synchronous API
2249 * @param[in] handle pointer to the application info handle.
2250 * @param[out] pkg_name pointer to hold package name
2251 * @return 0 if success, error code(<0) if fail
2252 * @retval PMINFO_R_OK success
2253 * @retval PMINFO_R_EINVAL invalid argument
2254 * @retval PMINFO_R_ERROR internal error
2255 * @pre pkgmgrinfo_appinfo_get_appinfo()
2256 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2257 * @see pkgmgrinfo_appinfo_get_appid()
2258 * @see pkgmgrinfo_appinfo_is_multiple()
2260 static int get_app_pkgname(const char *appid)
2263 char *pkgname = NULL;
2264 pkgmgrinfo_appinfo_h handle;
2265 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2266 if (ret != PMINFO_R_OK)
2268 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2269 if (ret != PMINFO_R_OK) {
2270 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2273 printf("pkg name: %s\n", pkgname);
2274 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2279 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2282 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2283 * @brief This API gets the package id of the application
2285 * @par This API is for package-manager client application
2286 * @par Sync (or) Async : Synchronous API
2288 * @param[in] handle pointer to the application info handle.
2289 * @param[out] pkgid pointer to hold package id
2290 * @return 0 if success, error code(<0) if fail
2291 * @retval PMINFO_R_OK success
2292 * @retval PMINFO_R_EINVAL invalid argument
2293 * @retval PMINFO_R_ERROR internal error
2294 * @pre pkgmgrinfo_appinfo_get_appinfo()
2295 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2296 * @see pkgmgrinfo_appinfo_get_appid()
2297 * @see pkgmgrinfo_appinfo_is_multiple()
2299 static int get_app_pkgid(const char *appid)
2303 pkgmgrinfo_appinfo_h handle;
2304 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2305 if (ret != PMINFO_R_OK)
2307 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2308 if (ret != PMINFO_R_OK) {
2309 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2312 printf("pkg id: %s\n", pkgid);
2313 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2318 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2321 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2322 * @brief This API gets the package type of the application
2324 * @par This API is for package-manager client application
2325 * @par Sync (or) Async : Synchronous API
2327 * @param[in] handle pointer to the application info handle.
2328 * @param[out] pkgtype pointer to hold package type
2329 * @return 0 if success, error code(<0) if fail
2330 * @retval PMINFO_R_OK success
2331 * @retval PMINFO_R_EINVAL invalid argument
2332 * @retval PMINFO_R_ERROR internal error
2333 * @pre pkgmgrinfo_appinfo_get_appinfo()
2334 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2335 * @see pkgmgrinfo_appinfo_get_appid()
2336 * @see pkgmgrinfo_appinfo_is_multiple()
2338 static int get_app_pkgtype(const char *appid)
2341 char *pkgtype = NULL;
2342 pkgmgrinfo_appinfo_h handle = NULL;
2343 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2344 if (ret != PMINFO_R_OK)
2346 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2347 if (ret != PMINFO_R_OK) {
2348 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2351 printf("pkgtype: %s\n", pkgtype);
2352 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2357 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2360 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2361 * @brief This API gets the executable name of the application
2363 * @par This API is for package-manager client application
2364 * @par Sync (or) Async : Synchronous API
2366 * @param[in] handle pointer to the application info handle.
2367 * @param[out] exec pointer to hold app exec name
2368 * @return 0 if success, error code(<0) if fail
2369 * @retval PMINFO_R_OK success
2370 * @retval PMINFO_R_EINVAL invalid argument
2371 * @retval PMINFO_R_ERROR internal error
2372 * @pre pkgmgrinfo_appinfo_get_appinfo()
2373 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2374 * @see pkgmgrinfo_appinfo_get_appid()
2375 * @see pkgmgrinfo_appinfo_is_multiple()
2377 static int get_app_exec(const char *appid)
2381 pkgmgrinfo_appinfo_h handle;
2382 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2383 if (ret != PMINFO_R_OK)
2385 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2386 if (ret != PMINFO_R_OK) {
2387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2390 printf("exec name: %s\n", exec);
2391 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2396 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2399 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2400 * @brief This API gets the icon name of the application
2402 * @par This API is for package-manager client application
2403 * @par Sync (or) Async : Synchronous API
2405 * @param[in] handle pointer to the application info handle.
2406 * @param[out] icon pointer to hold app icon name
2407 * @return 0 if success, error code(<0) if fail
2408 * @retval PMINFO_R_OK success
2409 * @retval PMINFO_R_EINVAL invalid argument
2410 * @retval PMINFO_R_ERROR internal error
2411 * @pre pkgmgrinfo_appinfo_get_appinfo()
2412 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2413 * @see pkgmgrinfo_appinfo_get_appid()
2414 * @see pkgmgrinfo_appinfo_is_multiple()
2416 static int get_app_icon(const char *appid)
2420 pkgmgrinfo_appinfo_h handle;
2421 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2422 if (ret != PMINFO_R_OK)
2424 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2425 if (ret != PMINFO_R_OK) {
2426 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2429 printf("icon name: %s\n", icon);
2430 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2435 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2438 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2439 * @brief This API gets the label of the application
2441 * @par This API is for package-manager client application
2442 * @par Sync (or) Async : Synchronous API
2444 * @param[in] handle pointer to the application info handle.
2445 * @param[out] label pointer to hold app label
2446 * @return 0 if success, error code(<0) if fail
2447 * @retval PMINFO_R_OK success
2448 * @retval PMINFO_R_EINVAL invalid argument
2449 * @retval PMINFO_R_ERROR internal error
2450 * @pre pkgmgrinfo_appinfo_get_appinfo()
2451 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2452 * @see pkgmgrinfo_appinfo_get_appid()
2453 * @see pkgmgrinfo_appinfo_is_multiple()
2455 static int get_app_label(const char *appid)
2459 pkgmgrinfo_appinfo_h handle;
2460 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2461 if (ret != PMINFO_R_OK)
2463 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2464 if (ret != PMINFO_R_OK) {
2465 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2468 printf("label : %s\n", label);
2469 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2474 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2477 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2478 * @brief This API gets exactly matched label by given appid and locale
2480 * @par This API is for package-manager client application
2481 * @par Sync (or) Async : Synchronous API
2483 * @param[in] appid pointer to appid
2484 * @param[in] locale pointer to locale
2485 * @param[out] label pointer to hold app label
2486 * @return 0 if success, error code(<0) if fail
2487 * @retval PMINFO_R_OK success
2488 * @retval PMINFO_R_EINVAL invalid argument
2489 * @retval PMINFO_R_ERROR internal error
2491 static int get_localed_label(const char *appid, const char *locale)
2496 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2497 if (ret != PMINFO_R_OK)
2500 printf("localed label: %s\n", label);
2508 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2509 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2512 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2513 * @brief This API gets the component of the application
2515 * @par This API is for package-manager client application
2516 * @par Sync (or) Async : Synchronous API
2518 * @param[in] handle pointer to the application info handle.
2519 * @param[out] component pointer to hold app component
2520 * @return 0 if success, error code(<0) if fail
2521 * @retval PMINFO_R_OK success
2522 * @retval PMINFO_R_EINVAL invalid argument
2523 * @retval PMINFO_R_ERROR internal error
2524 * @pre pkgmgrinfo_appinfo_get_appinfo()
2525 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2526 * @see pkgmgrinfo_appinfo_get_appid()
2527 * @see pkgmgrinfo_appinfo_is_multiple()
2529 static int get_app_component(const char *appid)
2532 pkgmgrinfo_app_component component;
2533 pkgmgrinfo_appinfo_h handle;
2534 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2535 if (ret != PMINFO_R_OK)
2537 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2538 if (ret != PMINFO_R_OK) {
2539 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2542 printf("component : %s\n", component);
2543 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2548 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2551 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2552 * @brief This API gets the apptype of the application
2554 * @par This API is for package-manager client application
2555 * @par Sync (or) Async : Synchronous API
2557 * @param[in] handle pointer to the application info handle.
2558 * @param[out] app_type pointer to hold apptype
2559 * @return 0 if success, error code(<0) if fail
2560 * @retval PMINFO_R_OK success
2561 * @retval PMINFO_R_EINVAL invalid argument
2562 * @retval PMINFO_R_ERROR internal error
2563 * @pre pkgmgrinfo_appinfo_get_appinfo()
2564 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2565 * @see pkgmgrinfo_appinfo_get_appid()
2566 * @see pkgmgrinfo_appinfo_is_multiple()
2568 static int get_app_type(const char *appid)
2571 char *apptype = NULL;
2572 pkgmgrinfo_appinfo_h handle;
2573 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2574 if (ret != PMINFO_R_OK)
2576 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2577 if (ret != PMINFO_R_OK) {
2578 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2581 printf("apptype : %s\n", apptype);
2582 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2587 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2590 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2591 int *operation_count, char ***operation)
2592 * @brief This API gets the list of operation of the application
2594 * @par This API is for package-manager client application
2595 * @par Sync (or) Async : Synchronous API
2597 * @param[in] handle pointer to the appcontrol handle.
2598 * @param[out] operation_count pointer to hold number of operations
2599 * @param[out] operation pointer to hold list of operations
2600 * @return 0 if success, error code(<0) if fail
2601 * @retval PMINFO_R_OK success
2602 * @retval PMINFO_R_EINVAL invalid argument
2603 * @retval PMINFO_R_ERROR internal error
2604 * @pre pkgmgrinfo_appinfo_get_appinfo()
2605 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2606 * @see pkgmgrinfo_appinfo_get_uri()
2607 * @see pkgmgrinfo_appinfo_get_mime()
2609 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2614 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2615 for (i = 0; i < oc; i++) {
2616 if (strcmp(operation[i], (char *)user_data) == 0)
2623 static int check_operation(const char *appid, char *operation)
2626 pkgmgrinfo_appinfo_h handle;
2627 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2628 if (ret != PMINFO_R_OK)
2630 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2631 if (ret != PMINFO_R_OK) {
2632 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2640 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2641 int *operation_count, char ***operation);
2644 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2645 int *uri_count, char ***uri)
2646 * @brief This API gets the list of uri of the application
2648 * @par This API is for package-manager client application
2649 * @par Sync (or) Async : Synchronous API
2651 * @param[in] handle pointer to the appcontrol handle.
2652 * @param[out] uri_count pointer to hold number of uris
2653 * @param[out] uri pointer to hold list of uris
2654 * @return 0 if success, error code(<0) if fail
2655 * @retval PMINFO_R_OK success
2656 * @retval PMINFO_R_EINVAL invalid argument
2657 * @retval PMINFO_R_ERROR internal error
2658 * @pre pkgmgrinfo_appinfo_get_appinfo()
2659 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2660 * @see pkgmgrinfo_appinfo_get_operation()
2661 * @see pkgmgrinfo_appinfo_get_mime()
2663 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2668 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2669 for (i = 0; i < uc; i++) {
2670 if (strcmp(uri[i], (char *)user_data) == 0)
2677 static int check_uri(const char *appid, char *uri)
2680 pkgmgrinfo_appinfo_h handle;
2681 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2682 if (ret != PMINFO_R_OK)
2684 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2685 if (ret != PMINFO_R_OK) {
2686 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2689 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2694 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2695 int *uri_count, char ***uri);
2698 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2699 int *mime_count, char ***mime)
2700 * @brief This API gets the list of mime of the application
2702 * @par This API is for package-manager client application
2703 * @par Sync (or) Async : Synchronous API
2705 * @param[in] handle pointer to the appcontrol handle.
2706 * @param[out] mime_count pointer to hold number of mimes
2707 * @param[out] mime pointer to hold list of mimes
2708 * @return 0 if success, error code(<0) if fail
2709 * @retval PMINFO_R_OK success
2710 * @retval PMINFO_R_EINVAL invalid argument
2711 * @retval PMINFO_R_ERROR internal error
2712 * @pre pkgmgrinfo_appinfo_get_appinfo()
2713 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2714 * @see pkgmgrinfo_appinfo_get_uri()
2715 * @see pkgmgrinfo_appinfo_get_operation()
2717 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2722 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2723 for (i = 0; i < mc; i++) {
2724 if (strcmp(mime[i], (char *)user_data) == 0)
2731 static int check_mime(const char *appid, char *mime)
2734 pkgmgrinfo_appinfo_h handle;
2735 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2736 if (ret != PMINFO_R_OK)
2738 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2739 if (ret != PMINFO_R_OK) {
2740 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2748 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2749 int *mime_count, char ***mime);
2752 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2753 int *subapp_count, char ***subapp)
2754 * @brief This API gets the list of subapp of the application
2756 * @par This API is for package-manager client application
2757 * @par Sync (or) Async : Synchronous API
2759 * @param[in] handle pointer to the appcontrol handle.
2760 * @param[out] subapp_count pointer to hold number of subapp
2761 * @param[out] subapp pointer to hold list of subapp
2762 * @return 0 if success, error code(<0) if fail
2763 * @retval PMINFO_R_OK success
2764 * @retval PMINFO_R_EINVAL invalid argument
2765 * @retval PMINFO_R_ERROR internal error
2766 * @pre pkgmgrinfo_appinfo_get_appinfo()
2767 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2768 * @see pkgmgrinfo_appinfo_get_uri()
2769 * @see pkgmgrinfo_appinfo_get_operation()
2771 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2775 char **subapp = NULL;
2776 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2777 for (i = 0; i < sc; i++) {
2778 if (strcmp(subapp[i], (char *)user_data) == 0)
2785 static int check_subapp(const char *appid, char *subapp)
2788 pkgmgrinfo_appinfo_h handle = NULL;
2789 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2790 if (ret != PMINFO_R_OK)
2792 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2793 if (ret != PMINFO_R_OK) {
2794 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2797 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2802 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2803 int *subapp_count, char ***subapp);
2806 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2807 * @brief This API gets the notification icon of the application
2809 * @par This API is for package-manager client application
2810 * @par Sync (or) Async : Synchronous API
2812 * @param[in] handle pointer to the application info handle.
2813 * @param[out] path pointer to hold notification icon
2814 * @return 0 if success, error code(<0) if fail
2815 * @retval PMINFO_R_OK success
2816 * @retval PMINFO_R_EINVAL invalid argument
2817 * @retval PMINFO_R_ERROR internal error
2818 * @pre pkgmgrinfo_appinfo_get_appinfo()
2819 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2820 * @see pkgmgrinfo_appinfo_get_appid()
2821 * @see pkgmgrinfo_appinfo_is_multiple()
2823 static int get_app_notification_icon(const char *appid)
2826 char *notification_icon = NULL;
2827 pkgmgrinfo_appinfo_h handle;
2828 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2829 if (ret != PMINFO_R_OK)
2831 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2832 if (ret != PMINFO_R_OK) {
2833 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2836 printf("notification icon : %s\n", notification_icon);
2837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2842 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2845 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2846 * @brief This API gets the setting icon of the application
2848 * @par This API is for package-manager client application
2849 * @par Sync (or) Async : Synchronous API
2851 * @param[in] handle pointer to the application info handle.
2852 * @param[out] path pointer to hold setting icon
2853 * @return 0 if success, error code(<0) if fail
2854 * @retval PMINFO_R_OK success
2855 * @retval PMINFO_R_EINVAL invalid argument
2856 * @retval PMINFO_R_ERROR internal error
2857 * @pre pkgmgrinfo_appinfo_get_appinfo()
2858 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2859 * @see pkgmgrinfo_appinfo_get_appid()
2860 * @see pkgmgrinfo_appinfo_is_multiple()
2862 static int get_app_setting_icon(const char *appid)
2865 char *setting_icon = NULL;
2866 pkgmgrinfo_appinfo_h handle;
2867 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2868 if (ret != PMINFO_R_OK)
2870 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2871 if (ret != PMINFO_R_OK) {
2872 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2875 printf("setting icon : %s\n", setting_icon);
2876 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2881 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2884 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2885 * @brief This API gets the type of recent image on app-tray
2887 * @par This API is for package-manager client application
2888 * @par Sync (or) Async : Synchronous API
2890 * @param[in] handle pointer to the application info handle.
2891 * @param[out] type pointer to hold image type
2892 * @return 0 if success, error code(<0) if fail
2893 * @retval PMINFO_R_OK success
2894 * @retval PMINFO_R_EINVAL invalid argument
2895 * @retval PMINFO_R_ERROR internal error
2896 * @pre pkgmgrinfo_appinfo_get_appinfo()
2897 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2898 * @see pkgmgrinfo_appinfo_get_appid()
2899 * @see pkgmgrinfo_appinfo_is_multiple()
2901 static int get_app_recent_image_type(const char *appid)
2904 pkgmgrinfo_app_recentimage type;
2905 pkgmgrinfo_appinfo_h handle;
2906 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2907 if (ret != PMINFO_R_OK)
2909 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2910 if (ret != PMINFO_R_OK) {
2911 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2914 printf("recent image type: %d\n", type);
2915 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2920 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2924 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2925 * @brief This API gets the preview image of application
2927 * @par Sync (or) Async : Synchronous API
2929 * @param[in] handle pointer to the application info handle.
2930 * @param[out] preview_img pointer to hold preview image path
2931 * @return 0 if success, error code(<0) if fail
2932 * @retval PMINFO_R_OK success
2933 * @retval PMINFO_R_EINVAL invalid argument
2934 * @retval PMINFO_R_ERROR internal error
2935 * @pre pkgmgrinfo_appinfo_get_appinfo()
2936 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2937 * @see pkgmgrinfo_appinfo_get_appid()
2939 static int get_app_previewimage(const char *appid)
2942 char *preview = NULL;
2943 pkgmgrinfo_appinfo_h handle = NULL;
2944 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2945 if (ret != PMINFO_R_OK)
2947 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2948 if (ret != PMINFO_R_OK) {
2949 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2952 printf("preview image path : %s\n", preview);
2953 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2958 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2962 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2963 * @brief This API gets the package permission type of the application
2965 * @par This API is for package-manager client application
2966 * @par Sync (or) Async : Synchronous API
2968 * @param[in] handle pointer to the application info handle.
2969 * @param[out] permission pointer to hold package permission
2970 * @return 0 if success, error code(<0) if fail
2971 * @retval PMINFO_R_OK success
2972 * @retval PMINFO_R_EINVAL invalid argument
2973 * @retval PMINFO_R_ERROR internal error
2974 * @pre pkgmgrinfo_appinfo_get_appinfo()
2975 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2976 * @see pkgmgrinfo_appinfo_get_appid()
2978 static int get_app_permission(const char *appid)
2981 pkgmgrinfo_permission_type permission = 0;
2982 pkgmgrinfo_appinfo_h handle;
2984 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2985 if (ret != PMINFO_R_OK)
2987 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2988 if (ret != PMINFO_R_OK) {
2989 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2992 printf("permission type: %d\n", permission);
2993 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2998 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3001 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3002 * @brief This API gets the component_type
3004 * @par This API is for package-manager client application
3005 * @par Sync (or) Async : Synchronous API
3007 * @param[in] handle pointer to the application info handle.
3008 * @param[out] component_type pointer to hold component_type
3009 * @return 0 if success, error code(<0) if fail
3010 * @retval PMINFO_R_OK success
3011 * @retval PMINFO_R_EINVAL invalid argument
3012 * @retval PMINFO_R_ERROR internal error
3013 * @pre pkgmgrinfo_appinfo_get_appinfo()
3014 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3015 * @see pkgmgrinfo_appinfo_get_pkgid()
3016 * @see pkgmgrinfo_appinfo_is_multiple()
3018 static int get_component_type(const char *appid)
3021 char *component_type = NULL;
3022 pkgmgrinfo_appinfo_h handle;
3023 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3024 if (ret != PMINFO_R_OK)
3026 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3027 if (ret != PMINFO_R_OK) {
3028 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3031 printf("component_type: %s\n", component_type);
3032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3037 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3040 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3041 * @brief This API gets the application 'hwacceleration' value from the app ID
3043 * @par This API is for package-manager client application
3044 * @par Sync (or) Async : Synchronous API
3046 * @param[in] handle pointer to application info handle
3047 * @param[out] hwacceleration pointer to hold package hwacceleration value
3048 * @return 0 if success, error code(<0) if fail
3049 * @retval PMINFO_R_OK success
3050 * @retval PMINFO_R_EINVAL invalid argument
3051 * @retval PMINFO_R_ERROR internal error
3052 * @pre pkgmgrinfo_appinfo_get_appinfo()
3053 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3054 * @see pkgmgrinfo_appinfo_get_appid()
3055 * @see pkgmgrinfo_appinfo_is_multiple()
3057 static int get_app_hwacceleration(const char *appid)
3060 pkgmgrinfo_app_hwacceleration hwacceleration;
3061 pkgmgrinfo_appinfo_h handle;
3062 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3063 if (ret != PMINFO_R_OK)
3065 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3066 if (ret != PMINFO_R_OK) {
3067 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3070 printf("app hwacceleration: %d\n", hwacceleration);
3071 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3076 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3079 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3080 * @brief This API gets the application 'screenreader' value from the app ID
3082 * @par This API is for package-manager client application
3083 * @par Sync (or) Async : Synchronous API
3085 * @param[in] handle pointer to application info handle
3086 * @param[out] screenreader pointer to hold package accessibility value
3087 * @return 0 if success, error code(<0) if fail
3088 * @retval PMINFO_R_OK success
3089 * @retval PMINFO_R_EINVAL invalid argument
3090 * @retval PMINFO_R_ERROR internal error
3091 * @pre pkgmgrinfo_appinfo_get_appinfo()
3092 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3093 * @see pkgmgrinfo_appinfo_get_appid()
3094 * @see pkgmgrinfo_appinfo_is_multiple()
3096 static int get_app_screenreader(const char *appid)
3099 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3100 pkgmgrinfo_appinfo_h handle = NULL;
3101 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3102 if (ret != PMINFO_R_OK)
3104 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3105 if (ret != PMINFO_R_OK) {
3106 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3109 printf("app screenreader: %d\n", screenreader);
3110 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3115 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3118 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3119 * @brief This API gets the application's landscape & portrait effect images
3121 * @par This API is for package-manager client application
3122 * @par Sync (or) Async : Synchronous API
3124 * @param[in] handle pointer to application info handle
3125 * @param[out] portrait_img contains portrait mode effect image
3126 * @param[out] landscape_img contains landscape mode effect image
3127 * @return 0 if success, error code(<0) if fail
3128 * @retval PMINFO_R_OK success
3129 * @retval PMINFO_R_EINVAL invalid argument
3130 * @retval PMINFO_R_ERROR internal error
3131 * @pre pkgmgrinfo_appinfo_get_appinfo()
3132 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3133 * @see pkgmgrinfo_appinfo_get_appid()
3134 * @see pkgmgrinfo_appinfo_is_nodisplay()
3136 static int get_app_effectimages(const char *appid)
3139 char *portraitimg = NULL;
3140 char *landscapeimg = NULL;
3141 pkgmgrinfo_appinfo_h handle;
3142 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3143 if (ret != PMINFO_R_OK)
3145 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3146 if (ret != PMINFO_R_OK) {
3147 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3150 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3151 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3156 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3159 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3160 * @brief This API gets the application's effect image type
3162 * @par This API is for package-manager client application
3163 * @par Sync (or) Async : Synchronous API
3165 * @param[in] handle pointer to application info handle
3166 * @param[out] effectimg_type contains effect image type
3167 * @return 0 if success, error code(<0) if fail
3168 * @retval PMINFO_R_OK success
3169 * @retval PMINFO_R_EINVAL invalid argument
3170 * @retval PMINFO_R_ERROR internal error
3171 * @pre pkgmgrinfo_appinfo_get_appinfo()
3172 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3173 * @see pkgmgrinfo_appinfo_get_appid()
3174 * @see pkgmgrinfo_appinfo_is_nodisplay()
3176 static int get_app_effectimage_type(const char *appid)
3179 char *effectimg_type = NULL;
3180 pkgmgrinfo_appinfo_h handle = NULL;
3181 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3182 if (ret != PMINFO_R_OK)
3184 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3185 if (ret != PMINFO_R_OK) {
3186 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3189 printf("app effect image type: %s\n", effectimg_type);
3190 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3195 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3198 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3199 * @brief This API gets the submode_mainid of the application
3201 * @par This API is for package-manager client application
3202 * @par Sync (or) Async : Synchronous API
3204 * @param[in] handle pointer to the application info handle.
3205 * @param[out] submode_mainid pointer to hold package name
3206 * @return 0 if success, error code(<0) if fail
3207 * @retval PMINFO_R_OK success
3208 * @retval PMINFO_R_EINVAL invalid argument
3209 * @retval PMINFO_R_ERROR internal error
3210 * @pre pkgmgrinfo_appinfo_get_appinfo()
3211 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3212 * @see pkgmgrinfo_appinfo_get_appid()
3213 * @see pkgmgrinfo_appinfo_is_multiple()
3215 static int get_app_submode_mainid(const char *appid)
3218 char *submode_mainid = NULL;
3219 pkgmgrinfo_appinfo_h handle = NULL;
3220 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3221 if (ret != PMINFO_R_OK)
3223 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3224 if (ret != PMINFO_R_OK) {
3225 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3228 printf("submode_mainid: %s\n", submode_mainid);
3229 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3234 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3237 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3238 * @brief This API gets the datacontrol info
3240 * @par This API is for package-manager client application
3241 * @par Sync (or) Async : Synchronous API
3243 * @param[in] providerid pointer to the providerid of dataconltrol.
3244 * @param[in] type pointer to the type of dataconltrol.
3245 * @param[out] appid pointer to hold appid, need to free after using
3246 * @param[out] access pointer to hold access, need to free after using
3247 * @return 0 if success, error code(<0) if fail
3248 * @retval PMINFO_R_OK success
3249 * @retval PMINFO_R_EINVAL invalid argument
3250 * @retval PMINFO_R_ERROR internal error
3253 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3254 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3257 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3258 * @brief This API gets the appid of datacontrol
3260 * @par This API is for package-manager client application
3261 * @par Sync (or) Async : Synchronous API
3263 * @param[in] providerid pointer to the providerid of dataconltrol.
3264 * @param[out] appid pointer to hold appid, need to free after using
3265 * @return 0 if success, error code(<0) if fail
3266 * @retval PMINFO_R_OK success
3267 * @retval PMINFO_R_EINVAL invalid argument
3268 * @retval PMINFO_R_ERROR internal error
3271 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3272 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3275 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3276 * @brief This API gets the alias_appid of the application
3278 * @par This API is for package-manager client application
3279 * @par Sync (or) Async : Synchronous API
3281 * @param[in] handle pointer to the application info handle.
3282 * @param[out] alias_appid pointer to hold app alias_appid
3283 * @return 0 if success, error code(<0) if fail
3284 * @retval PMINFO_R_OK success
3285 * @retval PMINFO_R_EINVAL invalid argument
3286 * @retval PMINFO_R_ERROR internal error
3287 * @pre pkgmgrinfo_appinfo_get_appinfo()
3288 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3289 * @see pkgmgrinfo_appinfo_get_appid()
3291 static int get_alias_appid(const char *appid)
3294 char *alias_appid= 0;
3295 pkgmgrinfo_appinfo_h handle = NULL;
3296 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3297 if (ret != PMINFO_R_OK)
3299 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3300 if (ret != PMINFO_R_OK) {
3301 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3304 printf("alias_appid: %s\n", alias_appid);
3305 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3310 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3313 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3314 * @brief This API gets the effective_appid of the application
3316 * @par This API is for package-manager client application
3317 * @par Sync (or) Async : Synchronous API
3319 * @param[in] handle pointer to the application info handle.
3320 * @param[out] effective_appid pointer to hold app effective_appid
3321 * @return 0 if success, error code(<0) if fail
3322 * @retval PMINFO_R_OK success
3323 * @retval PMINFO_R_EINVAL invalid argument
3324 * @retval PMINFO_R_ERROR internal error
3325 * @pre pkgmgrinfo_appinfo_get_appinfo()
3326 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3327 * @see pkgmgrinfo_appinfo_get_appid()
3329 static int get_effective_appid(const char *appid)
3332 char *effective_appid= 0;
3333 pkgmgrinfo_appinfo_h handle = NULL;
3334 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3335 if (ret != PMINFO_R_OK)
3337 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3338 if (ret != PMINFO_R_OK) {
3339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3342 printf("effective_appid: %s\n", effective_appid);
3343 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3348 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3351 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3352 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3353 * @brief This API gets the list of permission for a particular application
3355 * @par This API is for package-manager client application
3356 * @par Sync (or) Async : Synchronous API
3357 * @param[in] handle pointer to the application info handle.
3358 * @param[in] permission_func callback function for list
3359 * @param[in] user_data user data to be passed to callback function
3360 * @return 0 if success, error code(<0) if fail
3361 * @retval PMINFO_R_OK success
3362 * @retval PMINFO_R_EINVAL invalid argument
3363 * @retval PMINFO_R_ERROR internal error
3364 * @pre pkgmgrinfo_appinfo_get_appinfo()
3365 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3367 int permission_func(const char *name, void *user_data)
3369 if (strcmp(name, (char *)user_data) == 0)
3375 static int list_permission(const char *appid, char *permission)
3378 pkgmgrinfo_appinfo_h handle;
3379 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3380 if (ret != PMINFO_R_OK)
3382 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3383 if (ret != PMINFO_R_OK) {
3384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3392 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3393 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3396 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3397 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3398 * @brief This API gets the list of category for a particular application
3400 * @par This API is for package-manager client application
3401 * @par Sync (or) Async : Synchronous API
3402 * @param[in] handle pointer to the application info handle.
3403 * @param[in] category_func callback function for list
3404 * @param[in] user_data user data to be passed to callback function
3405 * @return 0 if success, error code(<0) if fail
3406 * @retval PMINFO_R_OK success
3407 * @retval PMINFO_R_EINVAL invalid argument
3408 * @retval PMINFO_R_ERROR internal error
3409 * @pre pkgmgrinfo_appinfo_get_appinfo()
3410 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3412 int category_func(const char *name, void *user_data)
3414 if (strcmp(name, (char *)user_data) == 0)
3420 static int list_category(const char *appid, char *category)
3423 pkgmgrinfo_appinfo_h handle;
3424 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3425 if (ret != PMINFO_R_OK)
3427 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3428 if (ret != PMINFO_R_OK) {
3429 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3432 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3437 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3438 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3441 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3442 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3443 * @brief This API gets the list of metadata for a particular application
3445 * @par This API is for package-manager client application
3446 * @par Sync (or) Async : Synchronous API
3447 * @param[in] handle pointer to the application info handle.
3448 * @param[in] metadata_func callback function for list
3449 * @param[in] user_data user data to be passed to callback function
3450 * @return 0 if success, error code(<0) if fail
3451 * @retval PMINFO_R_OK success
3452 * @retval PMINFO_R_EINVAL invalid argument
3453 * @retval PMINFO_R_ERROR internal error
3454 * @pre pkgmgrinfo_appinfo_get_appinfo()
3455 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3457 int metadata_func(const char *key, const char *value, void *user_data)
3459 if (strcmp(key, (char *)user_data) == 0) {
3460 printf("Value is %s\n", value);
3467 static int list_metadata(const char *appid, char *key)
3470 pkgmgrinfo_appinfo_h handle;
3471 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3472 if (ret != PMINFO_R_OK)
3474 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3475 if (ret != PMINFO_R_OK) {
3476 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3479 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3484 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3485 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3489 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3490 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3491 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3492 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3493 * @brief This API gets the list of app-control for a particular application
3495 * @par This API is for package-manager client application
3496 * @par Sync (or) Async : Synchronous API
3497 * @param[in] handle pointer to the application info handle.
3498 * @param[in] appcontrol_func callback function for list
3499 * @param[in] user_data user data to be passed to callback function
3500 * @param[in] uid the addressee user id of the instruction
3501 * @return 0 if success, error code(<0) if fail
3502 * @retval PMINFO_R_OK success
3503 * @retval PMINFO_R_EINVAL invalid argument
3504 * @retval PMINFO_R_ERROR internal error
3505 * @pre pkgmgrinfo_appinfo_get_appinfo()
3506 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3508 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3513 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3514 for (i = 0; i < oc; i++) {
3515 if (strcmp(operation[i], (char *)user_data) == 0)
3522 static int check_operation(const char *appid, char *operation)
3525 pkgmgrinfo_appinfo_h handle;
3526 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3527 if (ret != PMINFO_R_OK)
3529 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3530 if (ret != PMINFO_R_OK) {
3531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3534 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3539 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3540 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3545 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3546 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3549 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3550 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3551 * @brief This API gets the list of splashscreen for a particular application
3553 * @par This API is for package-manager client application
3554 * @par Sync (or) Async : Synchronous API
3555 * @param[in] handle pointer to the application info handle.
3556 * @param[in] splash_screen_func callback function for list
3557 * @param[in] user_data user data to be passed to callback function
3558 * @return 0 if success, error code(<0) if fail
3559 * @retval PMINFO_R_OK success
3560 * @retval PMINFO_R_EINVAL invalid argument
3561 * @retval PMINFO_R_ERROR internal error
3562 * @pre pkgmgrinfo_appinfo_get_appinfo()
3563 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3566 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3567 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3570 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3571 * @brief This API gets the application 'nodisplay' value from the app ID
3573 * @par This API is for package-manager client application
3574 * @par Sync (or) Async : Synchronous API
3576 * @param[in] handle pointer to application info handle
3577 * @param[out] nodisplay pointer to hold package nodisplay value
3578 * @return 0 if success, error code(<0) if fail
3579 * @retval PMINFO_R_OK success
3580 * @retval PMINFO_R_EINVAL invalid argument
3581 * @retval PMINFO_R_ERROR internal error
3582 * @pre pkgmgrinfo_appinfo_get_appinfo()
3583 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3584 * @see pkgmgrinfo_appinfo_get_appid()
3585 * @see pkgmgrinfo_appinfo_is_multiple()
3587 static int get_app_nodisplay(const char *appid)
3591 pkgmgrinfo_appinfo_h handle;
3592 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3593 if (ret != PMINFO_R_OK)
3595 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3596 if (ret != PMINFO_R_OK) {
3597 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3600 printf("app nodisplay: %d\n", nodisplay);
3601 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3606 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3609 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3610 * @brief This API gets the application 'multiple' value from the app ID
3612 * @par This API is for package-manager client application
3613 * @par Sync (or) Async : Synchronous API
3615 * @param[in] handle pointer to application info handle
3616 * @param[out] multiple pointer to hold package multiple value
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()
3623 * @see pkgmgrinfo_appinfo_get_appid()
3624 * @see pkgmgrinfo_appinfo_is_nodisplay()
3626 static int get_app_multiple(const char *appid)
3630 pkgmgrinfo_appinfo_h handle;
3631 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3632 if (ret != PMINFO_R_OK)
3634 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3635 if (ret != PMINFO_R_OK) {
3636 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3639 printf("app multiple: %d\n", multiple);
3640 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3645 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3648 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3649 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3650 * application launching effect. If fales, indicator will be hidden during application launching effect
3652 * @par This API is for package-manager client application
3653 * @par Sync (or) Async : Synchronous API
3655 * @param[in] handle pointer to application info handle
3656 * @param[out] indicator_disp contains indicator display status for application launching effect
3657 * @return 0 if success, error code(<0) if fail
3658 * @retval PMINFO_R_OK success
3659 * @retval PMINFO_R_EINVAL invalid argument
3660 * @retval PMINFO_R_ERROR internal error
3661 * @pre pkgmgrinfo_appinfo_get_appinfo()
3662 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3663 * @see pkgmgrinfo_appinfo_get_appid()
3664 * @see pkgmgrinfo_appinfo_is_nodisplay()
3666 static int get_app_indicator_display(const char *appid)
3669 bool indicator_disp;
3670 pkgmgrinfo_appinfo_h handle;
3671 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3672 if (ret != PMINFO_R_OK)
3674 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3675 if (ret != PMINFO_R_OK){
3676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3679 printf("app indicator disp : %d\n", indicator_disp);
3680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3685 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3688 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3689 * @brief This API gets the application 'taskmanage' value from the app ID
3691 * @par This API is for package-manager client application
3692 * @par Sync (or) Async : Synchronous API
3694 * @param[in] handle pointer to application info handle
3695 * @param[out] taskmanage pointer to hold package taskmanage value
3696 * @return 0 if success, error code(<0) if fail
3697 * @retval PMINFO_R_OK success
3698 * @retval PMINFO_R_EINVAL invalid argument
3699 * @retval PMINFO_R_ERROR internal error
3700 * @pre pkgmgrinfo_appinfo_get_appinfo()
3701 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3702 * @see pkgmgrinfo_appinfo_get_appid()
3703 * @see pkgmgrinfo_appinfo_is_multiple()
3705 static int get_app_taskmanage(const char *appid)
3709 pkgmgrinfo_appinfo_h handle;
3710 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3711 if (ret != PMINFO_R_OK)
3713 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3714 if (ret != PMINFO_R_OK) {
3715 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3718 printf("app taskmanage: %d\n", taskmanage);
3719 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3724 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3727 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3728 * @brief This API gets the application 'taskmanage' value from the app ID
3730 * @par This API is for package-manager client application
3731 * @par Sync (or) Async : Synchronous API
3733 * @param[in] handle pointer to application info handle
3734 * @param[out] enabled pointer to hold package enabled value
3735 * @return 0 if success, error code(<0) if fail
3736 * @retval PMINFO_R_OK success
3737 * @retval PMINFO_R_EINVAL invalid argument
3738 * @retval PMINFO_R_ERROR internal error
3739 * @pre pkgmgrinfo_appinfo_get_appinfo()
3740 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3741 * @see pkgmgrinfo_appinfo_get_appid()
3742 * @see pkgmgrinfo_appinfo_is_multiple()
3744 static int get_app_enabled(const char *appid)
3748 pkgmgrinfo_appinfo_h handle;
3749 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3750 if (ret != PMINFO_R_OK)
3752 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3753 if (ret != PMINFO_R_OK) {
3754 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3757 printf("app enabled: %d\n", enabled);
3758 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3763 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3766 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3767 * @brief This API gets the application 'onboot' value from the app ID
3769 * @par This API is for package-manager client application
3770 * @par Sync (or) Async : Synchronous API
3772 * @param[in] handle pointer to application info handle
3773 * @param[out] onboot pointer to hold package onboot value
3774 * @return 0 if success, error code(<0) if fail
3775 * @retval PMINFO_R_OK success
3776 * @retval PMINFO_R_EINVAL invalid argument
3777 * @retval PMINFO_R_ERROR internal error
3778 * @pre pkgmgrinfo_appinfo_get_appinfo()
3779 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3780 * @see pkgmgrinfo_appinfo_get_appid()
3781 * @see pkgmgrinfo_appinfo_is_multiple()
3783 static int get_app_onboot(const char *appid)
3787 pkgmgrinfo_appinfo_h handle;
3788 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3789 if (ret != PMINFO_R_OK)
3791 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3792 if (ret != PMINFO_R_OK) {
3793 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3796 printf("app onboot: %d\n", onboot);
3797 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3802 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3805 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3806 * @brief This API gets the application 'autorestart' value from the app ID
3808 * @par This API is for package-manager client application
3809 * @par Sync (or) Async : Synchronous API
3811 * @param[in] handle pointer to application info handle
3812 * @param[out] autorestart pointer to hold package autorestart value
3813 * @return 0 if success, error code(<0) if fail
3814 * @retval PMINFO_R_OK success
3815 * @retval PMINFO_R_EINVAL invalid argument
3816 * @retval PMINFO_R_ERROR internal error
3817 * @pre pkgmgrinfo_appinfo_get_appinfo()
3818 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3819 * @see pkgmgrinfo_appinfo_get_appid()
3820 * @see pkgmgrinfo_appinfo_is_multiple()
3822 static int get_app_autorestart(const char *appid)
3826 pkgmgrinfo_appinfo_h handle;
3827 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3828 if (ret != PMINFO_R_OK)
3830 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3831 if (ret != PMINFO_R_OK) {
3832 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3835 printf("app autorestart: %d\n", autorestart);
3836 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3841 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3844 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3845 * @brief This API gets the value for given application is main app or not from handle
3847 * @par This API is for package-manager client application
3848 * @par Sync (or) Async : Synchronous API
3850 * @param[in] handle pointer to application info handle
3851 * @param[out] mainapp pointer to hold package mainapp is or not
3852 * @return 0 if success, error code(<0) if fail
3853 * @retval PMINFO_R_OK success
3854 * @retval PMINFO_R_EINVAL invalid argument
3855 * @retval PMINFO_R_ERROR internal error
3856 * @pre pkgmgrinfo_appinfo_get_appinfo()
3857 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3858 * @see pkgmgrinfo_appinfo_get_appid()
3859 * @see pkgmgrinfo_appinfo_is_multiple()
3861 static int get_app_mainapp(const char *appid)
3865 pkgmgrinfo_appinfo_h handle;
3866 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3867 if (ret != PMINFO_R_OK)
3869 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3870 if (ret != PMINFO_R_OK) {
3871 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3874 printf("mainapp: %d\n", mainapp);
3875 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3880 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3884 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3885 * @brief This API gets the value for given application is preload or not from handle
3887 * @par This API is for package-manager client application
3888 * @par Sync (or) Async : Synchronous API
3890 * @param[in] handle pointer to application info handle
3891 * @param[out] preload pointer to hold preload is or not
3892 * @return 0 if success, error code(<0) if fail
3893 * @retval PMINFO_R_OK success
3894 * @retval PMINFO_R_EINVAL invalid argument
3895 * @retval PMINFO_R_ERROR internal error
3896 * @pre pkgmgrinfo_appinfo_get_appinfo()
3897 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3898 * @see pkgmgrinfo_appinfo_get_appid()
3899 * @see pkgmgrinfo_appinfo_is_multiple()
3901 static int get_app_preload(const char *appid)
3905 pkgmgrinfo_appinfo_h handle = NULL;
3906 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3907 if (ret != PMINFO_R_OK)
3909 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3910 if (ret != PMINFO_R_OK) {
3911 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3914 printf("preload: %d\n", preload);
3915 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3920 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3923 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3924 * @brief This API gets the value for given application is submode or not from handle
3926 * @par This API is for package-manager client application
3927 * @par Sync (or) Async : Synchronous API
3929 * @param[in] handle pointer to application info handle
3930 * @param[out] submode pointer to hold submode is or not
3931 * @return 0 if success, error code(<0) if fail
3932 * @retval PMINFO_R_OK success
3933 * @retval PMINFO_R_EINVAL invalid argument
3934 * @retval PMINFO_R_ERROR internal error
3935 * @pre pkgmgrinfo_appinfo_get_appinfo()
3936 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3937 * @see pkgmgrinfo_appinfo_get_appid()
3938 * @see pkgmgrinfo_appinfo_is_multiple()
3940 static int get_app_submode(const char *appid)
3944 pkgmgrinfo_appinfo_h handle = NULL;
3945 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3946 if (ret != PMINFO_R_OK)
3948 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3949 if (ret != PMINFO_R_OK) {
3950 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3953 printf("submode: %d\n", submode);
3954 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3959 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3962 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
3963 * @brief This API gets the value for given application is process_pool or not from handle
3965 * @par This API is for package-manager client application
3966 * @par Sync (or) Async : Synchronous API
3968 * @param[in] handle pointer to application info handle
3969 * @param[out] process_pool pointer to hold process_pool is or not
3970 * @return 0 if success, error code(<0) if fail
3971 * @retval PMINFO_R_OK success
3972 * @retval PMINFO_R_EINVAL invalid argument
3973 * @retval PMINFO_R_ERROR internal error
3974 * @pre pkgmgrinfo_appinfo_get_appinfo()
3975 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3976 * @see pkgmgrinfo_appinfo_get_appid()
3978 static int get_app_process_pool(const char *appid)
3981 bool process_pool = 0;
3982 pkgmgrinfo_appinfo_h handle = NULL;
3983 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3984 if (ret != PMINFO_R_OK)
3986 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
3987 if (ret != PMINFO_R_OK) {
3988 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3991 printf("process_pool: %d\n", process_pool);
3992 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3997 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4000 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4001 * @brief This API gets the installed storage location of the application
4003 * @par This API is for package-manager client application
4004 * @par Sync (or) Async : Synchronous API
4006 * @param[in] handle pointer to the application info handle.
4007 * @param[out] app_type pointer to hold installed storage location
4008 * @return 0 if success, error code(<0) if fail
4009 * @retval PMINFO_R_OK success
4010 * @retval PMINFO_R_EINVAL invalid argument
4011 * @retval PMINFO_R_ERROR internal error
4012 * @pre pkgmgrinfo_appinfo_get_appinfo()
4013 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4014 * @see pkgmgrinfo_appinfo_get_appid()
4016 static int get_app_installed_location(const char *appid)
4019 pkgmgrinfo_installed_storage storage;
4020 pkgmgrinfo_appinfo_h handle = NULL;
4021 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4022 if (ret != PMINFO_R_OK)
4024 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4025 if (ret != PMINFO_R_OK) {
4026 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4029 printf("Installed storage location : %d\n", storage);
4030 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4035 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4039 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4040 * @brief This API checks if the application has the given category
4042 * @par This API is for package-manager client application
4043 * @par Sync (or) Async : Synchronous API
4045 * @param[in] handle pointer to the application info handle
4046 * @param[in] category category
4047 * @param[out] exist value Gets whether the application has the given category
4048 * @return 0 if success, error code(<0) if fail
4049 * @retval PMINFO_R_OK success
4050 * @retval PMINFO_R_EINVAL invalid argument
4051 * @retval PMINFO_R_ERROR internal error
4053 static int is_category_exist(const char *appid, const char *category)
4056 pkgmgrinfo_appinfo_h handle;
4059 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4060 if (ret != PMINFO_R_OK)
4063 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4064 if (ret != PMINFO_R_OK) {
4065 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4069 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4074 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4077 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4078 * @brief This API gets the application 'ui_gadget' value from the app ID
4080 * @par This API is for package-manager client application
4081 * @par Sync (or) Async : Synchronous API
4083 * @param[in] handle pointer to application info handle
4084 * @param[out] ui_gadget pointer to hold package ui_gadget value
4085 * @return 0 if success, error code(<0) if fail
4086 * @retval PMINFO_R_OK success
4087 * @retval PMINFO_R_EINVAL invalid argument
4088 * @pre pkgmgrinfo_appinfo_get_appinfo()
4089 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4091 static int get_app_ui_gadget(const char *appid)
4095 pkgmgrinfo_appinfo_h handle = NULL;
4096 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4097 if (ret != PMINFO_R_OK)
4099 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4100 if (ret != PMINFO_R_OK) {
4101 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4104 printf("app ui_gadget: %d\n", ui_gadget);
4105 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4110 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4113 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4114 * @brief This API gets the application 'support_disable' value from the app ID
4116 * @par This API is for package-manager client application
4117 * @par Sync (or) Async : Synchronous API
4119 * @param[in] handle pointer to application info handle
4120 * @param[out] support_disable pointer to hold package support_disable value
4121 * @return 0 if success, error code(<0) if fail
4122 * @retval PMINFO_R_OK success
4123 * @retval PMINFO_R_EINVAL invalid argument
4124 * @pre pkgmgrinfo_appinfo_get_appinfo()
4125 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4127 static int get_app_support_disable(const char *appid)
4130 bool support_disable;
4131 pkgmgrinfo_appinfo_h handle = NULL;
4132 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4133 if (ret != PMINFO_R_OK)
4135 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4136 if (ret != PMINFO_R_OK) {
4137 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4140 printf("app support_disable: %d\n", support_disable);
4141 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4146 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4149 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4150 * @brief This API destroys the application information handle freeing up all the resources
4152 * @par This API is for package-manager client application
4153 * @par Sync (or) Async : Synchronous API
4155 * @param[in] handle pointer to the application info handle.
4156 * @return 0 if success, error code(<0) if fail
4157 * @retval PMINFO_R_OK success
4158 * @retval PMINFO_R_EINVAL invalid argument
4159 * @retval PMINFO_R_ERROR internal error
4160 * @pre pkgmgrinfo_appinfo_get_appinfo()
4162 * @see pkgmgrinfo_appinfo_get_pkgid()
4163 * @see pkgmgrinfo_appinfo_is_multiple()
4165 static int get_app_type(const char *appid)
4169 pkgmgrinfo_appinfo_h handle;
4170 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4171 if (ret != PMINFO_R_OK)
4173 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4174 if (ret != PMINFO_R_OK) {
4175 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4178 printf("apptype: %s\n", type);
4179 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4184 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4187 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4188 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4189 The query will search the entire application information collected from the manifest file of all the installed packages
4191 * @par This API is for package-manager client application
4192 * @par Sync (or) Async : Synchronous API
4194 * @param[out] handle pointer to the application info filter handle.
4195 * @return 0 if success, error code(<0) if fail
4196 * @retval PMINFO_R_OK success
4197 * @retval PMINFO_R_EINVAL invalid argument
4198 * @retval PMINFO_R_ERROR internal error
4200 * @post pkgmgrinfo_appinfo_filter_destroy()
4201 * @see pkgmgrinfo_appinfo_filter_count()
4202 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4204 static int get_capp_count()
4208 pkgmgrinfo_appinfo_filter_h handle;
4209 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4210 if (ret != PMINFO_R_OK)
4212 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4213 if (ret != PMINFO_R_OK) {
4214 pkgmgrinfo_appinfo_filter_destroy(handle);
4217 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4218 if (ret != PMINFO_R_OK) {
4219 pkgmgrinfo_appinfo_filter_destroy(handle);
4222 printf("No of capp: %d\n", count);
4223 pkgmgrinfo_appinfo_filter_destroy(handle);
4228 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4231 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4232 * @brief This API destroys the application information filter handle freeing up all the resources
4234 * @par This API is for package-manager client application
4235 * @par Sync (or) Async : Synchronous API
4237 * @param[in] handle pointer to the application info filter handle.
4238 * @return 0 if success, error code(<0) if fail
4239 * @retval PMINFO_R_OK success
4240 * @retval PMINFO_R_EINVAL invalid argument
4241 * @retval PMINFO_R_ERROR internal error
4242 * @pre pkgmgrinfo_appinfo_filter_create()
4244 * @see pkgmgrinfo_appinfo_filter_count()
4245 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4247 static int get_capp_count()
4251 pkgmgrinfo_appinfo_filter_h handle;
4252 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4253 if (ret != PMINFO_R_OK)
4255 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4256 if (ret != PMINFO_R_OK) {
4257 pkgmgrinfo_appinfo_filter_destroy(handle);
4260 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4261 if (ret != PMINFO_R_OK) {
4262 pkgmgrinfo_appinfo_filter_destroy(handle);
4265 printf("No of capp: %d\n", count);
4266 pkgmgrinfo_appinfo_filter_destroy(handle);
4271 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4274 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4275 * @brief This API adds a boolean filter property to the filter handle
4277 * @par This API is for package-manager client application
4278 * @par Sync (or) Async : Synchronous API
4280 * @param[in] handle pointer to the application info filter handle.
4281 * @param[in] property boolean property name.
4282 * @param[in] value value corresponding to the property.
4283 * @return 0 if success, error code(<0) if fail
4284 * @retval PMINFO_R_OK success
4285 * @retval PMINFO_R_EINVAL invalid argument
4286 * @retval PMINFO_R_ERROR internal error
4287 * @pre pkgmgrinfo_appinfo_filter_create()
4288 * @post pkgmgrinfo_appinfo_filter_destroy()
4289 * @see pkgmgrinfo_appinfo_filter_count()
4290 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4292 static int get_taskmanageable_app_count()
4296 pkgmgrinfo_appinfo_filter_h handle;
4297 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4298 if (ret != PMINFO_R_OK)
4300 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4301 if (ret != PMINFO_R_OK) {
4302 pkgmgrinfo_appinfo_filter_destroy(handle);
4305 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4306 if (ret != PMINFO_R_OK) {
4307 pkgmgrinfo_appinfo_filter_destroy(handle);
4310 printf("No of taskmanageable apps: %d\n", count);
4311 pkgmgrinfo_appinfo_filter_destroy(handle);
4316 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4317 const char *property, const bool value);
4320 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4321 * @brief This API adds an integer filter property to the filter handle
4323 * @par This API is for package-manager client application
4324 * @par Sync (or) Async : Synchronous API
4326 * @param[in] handle pointer to the application info filter handle.
4327 * @param[in] property integer property name.
4328 * @param[in] value value corresponding to the property.
4329 * @return 0 if success, error code(<0) if fail
4330 * @retval PMINFO_R_OK success
4331 * @retval PMINFO_R_EINVAL invalid argument
4332 * @retval PMINFO_R_ERROR internal error
4333 * @pre pkgmgrinfo_appinfo_filter_create()
4334 * @post pkgmgrinfo_appinfo_filter_destroy()
4335 * @see pkgmgrinfo_appinfo_filter_count()
4336 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4338 static int get_taskmanageable_app_count()
4342 pkgmgrinfo_appinfo_filter_h handle;
4343 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4344 if (ret != PMINFO_R_OK)
4346 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4347 if (ret != PMINFO_R_OK) {
4348 pkgmgrinfo_appinfo_filter_destroy(handle);
4351 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4352 if (ret != PMINFO_R_OK) {
4353 pkgmgrinfo_appinfo_filter_destroy(handle);
4356 printf("No of apps: %d\n", count);
4357 pkgmgrinfo_appinfo_filter_destroy(handle);
4362 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4363 const char *property, const int value);
4366 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4367 * @brief This API adds a string filter property to the filter handle
4369 * @par This API is for package-manager client application
4370 * @par Sync (or) Async : Synchronous API
4372 * @param[in] handle pointer to the application info filter handle.
4373 * @param[in] property string property name.
4374 * @param[in] value value corresponding to the property.
4375 * @return 0 if success, error code(<0) if fail
4376 * @retval PMINFO_R_OK success
4377 * @retval PMINFO_R_EINVAL invalid argument
4378 * @retval PMINFO_R_ERROR internal error
4379 * @pre pkgmgrinfo_appinfo_filter_create()
4380 * @post pkgmgrinfo_appinfo_filter_destroy()
4381 * @see pkgmgrinfo_appinfo_filter_count()
4382 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4384 static int get_capp_count()
4388 pkgmgrinfo_appinfo_filter_h handle;
4389 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4390 if (ret != PMINFO_R_OK)
4392 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4393 if (ret != PMINFO_R_OK) {
4394 pkgmgrinfo_appinfo_filter_destroy(handle);
4397 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4398 if (ret != PMINFO_R_OK) {
4399 pkgmgrinfo_appinfo_filter_destroy(handle);
4402 printf("No of capp: %d\n", count);
4403 pkgmgrinfo_appinfo_filter_destroy(handle);
4408 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4409 const char *property, const char *value);
4412 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4413 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4415 * @par This API is for package-manager client application
4416 * @par Sync (or) Async : Synchronous API
4418 * @param[in] handle pointer to the application info filter handle.
4419 * @param[in] app_cb callback function.
4420 * @param[in] user_data user data to be passed to the callback function
4421 * @return 0 if success, error code(<0) if fail
4422 * @retval PMINFO_R_OK success
4423 * @retval PMINFO_R_EINVAL invalid argument
4424 * @retval PMINFO_R_ERROR internal error
4425 * @pre pkgmgrinfo_appinfo_filter_create()
4426 * @post pkgmgrinfo_appinfo_filter_destroy()
4427 * @see pkgmgrinfo_appinfo_filter_count()
4429 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4432 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4433 printf("appid : %s\n", appid);
4437 static int get_capp_list()
4440 pkgmgrinfo_appinfo_filter_h handle;
4441 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4442 if (ret != PMINFO_R_OK)
4444 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4445 if (ret != PMINFO_R_OK) {
4446 pkgmgrinfo_appinfo_filter_destroy(handle);
4449 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4450 if (ret != PMINFO_R_OK) {
4451 pkgmgrinfo_appinfo_filter_destroy(handle);
4454 pkgmgrinfo_appinfo_filter_destroy(handle);
4459 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4460 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4461 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4462 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4465 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4466 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4467 * @brief This API counts the application that satisfy the filter conditions
4469 * @par This API is for package-manager client application
4470 * @par Sync (or) Async : Synchronous API
4472 * @param[in] handle pointer to the application info filter handle.
4473 * @param[in] count pointer to store count value
4474 * @param[in] uid the addressee user id of the instruction
4475 * @return 0 if success, error code(<0) if fail
4476 * @retval PMINFO_R_OK success
4477 * @retval PMINFO_R_EINVAL invalid argument
4478 * @retval PMINFO_R_ERROR internal error
4479 * @pre pkgmgrinfo_appinfo_filter_create()
4480 * @post pkgmgrinfo_appinfo_filter_destroy()
4481 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4483 static int get_capp_count()
4487 pkgmgrinfo_appinfo_filter_h handle;
4488 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4489 if (ret != PMINFO_R_OK)
4491 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4492 if (ret != PMINFO_R_OK) {
4493 pkgmgrinfo_appinfo_filter_destroy(handle);
4496 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4497 if (ret != PMINFO_R_OK) {
4498 pkgmgrinfo_appinfo_filter_destroy(handle);
4501 printf("No of capp: %d\n", count);
4502 pkgmgrinfo_appinfo_filter_destroy(handle);
4507 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4508 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4510 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4511 * @brief This API creates the application's metadata information filter handle from db.
4513 * @par This API is for package-manager client application
4514 * @par Sync (or) Async : Synchronous API
4516 * @param[out] handle pointer to the application metadata info filter handle.
4517 * @return 0 if success, error code(<0) if fail
4518 * @retval PMINFO_R_OK success
4519 * @retval PMINFO_R_EINVAL invalid argument
4520 * @retval PMINFO_R_ERROR internal error
4522 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4523 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4525 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4528 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4529 printf("appid : %s\n", appid);
4533 static int get_app_list(const char *mkey, const char *mvalue)
4536 pkgmgrinfo_appinfo_metadata_filter_h handle;
4537 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4538 if (ret != PMINFO_R_OK)
4540 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4541 if (ret != PMINFO_R_OK) {
4542 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4545 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4546 if (ret != PMINFO_R_OK) {
4547 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4550 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4555 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4558 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4559 * @brief This API destroys the application's metadata information filter handle.
4561 * @par This API is for package-manager client application
4562 * @par Sync (or) Async : Synchronous API
4564 * @param[in] handle pointer to the application metadata info filter handle.
4565 * @return 0 if success, error code(<0) if fail
4566 * @retval PMINFO_R_OK success
4567 * @retval PMINFO_R_EINVAL invalid argument
4568 * @retval PMINFO_R_ERROR internal error
4569 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4571 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4573 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4576 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4577 printf("appid : %s\n", appid);
4581 static int get_app_list(const char *mkey, const char *mvalue)
4584 pkgmgrinfo_appinfo_metadata_filter_h handle;
4585 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4586 if (ret != PMINFO_R_OK)
4588 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4589 if (ret != PMINFO_R_OK) {
4590 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4593 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4594 if (ret != PMINFO_R_OK) {
4595 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4598 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4603 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4606 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4607 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4608 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4610 * @par This API is for package-manager client application
4611 * @par Sync (or) Async : Synchronous API
4613 * @param[in] handle pointer to the application metadata info filter handle.
4614 * @param[in] key pointer to metadata key
4615 * @param[in] value pointer to metadata value
4616 * @return 0 if success, error code(<0) if fail
4617 * @retval PMINFO_R_OK success
4618 * @retval PMINFO_R_EINVAL invalid argument
4619 * @retval PMINFO_R_ERROR internal error
4620 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4621 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4622 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4624 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4627 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4628 printf("appid : %s\n", appid);
4632 static int get_app_list(const char *mkey, const char *mvalue)
4635 pkgmgrinfo_appinfo_metadata_filter_h handle;
4636 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4637 if (ret != PMINFO_R_OK)
4639 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4640 if (ret != PMINFO_R_OK) {
4641 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4644 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4645 if (ret != PMINFO_R_OK) {
4646 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4649 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4654 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4655 const char *key, const char *value);
4658 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4659 * @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)
4660 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4661 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4662 * negative value, no more callbacks will be called and API will return.
4664 * @par This API is for package-manager client application
4665 * @par Sync (or) Async : Synchronous API
4667 * @param[in] handle pointer to the application metadata info filter handle.
4668 * @param[in] app_cb function pointer to callback
4669 * @param[in] user_data pointer to user data
4670 * @param[in] uid the addressee user id of the instruction
4671 * @return 0 if success, error code(<0) if fail
4672 * @retval PMINFO_R_OK success
4673 * @retval PMINFO_R_EINVAL invalid argument
4674 * @retval PMINFO_R_ERROR internal error
4675 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4676 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4678 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4681 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4682 printf("appid : %s\n", appid);
4686 static int get_app_list(const char *mkey, const char *mvalue)
4689 pkgmgrinfo_appinfo_metadata_filter_h handle;
4690 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4691 if (ret != PMINFO_R_OK)
4693 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4694 if (ret != PMINFO_R_OK) {
4695 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4698 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4699 if (ret != PMINFO_R_OK) {
4700 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4703 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4708 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4709 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4710 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4711 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4713 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4714 * @brief This API creates the package cert information handle to get data from db.
4716 * @par This API is for package-manager client application
4717 * @par Sync (or) Async : Synchronous API
4719 * @param[out] handle pointer to the package cert handle.
4720 * @return 0 if success, error code(<0) if fail
4721 * @retval PMINFO_R_OK success
4722 * @retval PMINFO_R_EINVAL invalid argument
4723 * @retval PMINFO_R_ERROR internal error
4725 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4726 * @see pkgmgrinfo_pkginfo_get_cert_value()
4727 * @see pkgmgrinfo_pkginfo_load_certinfo()
4729 static int get_cert_info(const char *pkgid)
4732 pkgmgrinfo_certinfo_h handle;
4733 char *auth_cert = NULL;
4734 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4735 if (ret != PMINFO_R_OK)
4737 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4738 if (ret != PMINFO_R_OK) {
4739 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4742 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4743 if (ret != PMINFO_R_OK) {
4744 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4747 printf("Author root certificate: %s\n", auth_root);
4748 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4753 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4756 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4757 * @brief This API loads the package cert information handle with data from db.
4759 * @par This API is for package-manager client application
4760 * @par Sync (or) Async : Synchronous API
4762 * @param[in] pkgid pointer to the package ID.
4763 * @param[in] handle pointer to the package cert handle.
4764 * @return 0 if success, error code(<0) if fail
4765 * @retval PMINFO_R_OK success
4766 * @retval PMINFO_R_EINVAL invalid argument
4767 * @retval PMINFO_R_ERROR internal error
4768 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4769 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4770 * @see pkgmgrinfo_pkginfo_get_cert_value()
4772 static int get_cert_info(const char *pkgid)
4775 pkgmgrinfo_certinfo_h handle;
4776 char *auth_cert = NULL;
4777 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4778 if (ret != PMINFO_R_OK)
4780 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4781 if (ret != PMINFO_R_OK) {
4782 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4785 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4786 if (ret != PMINFO_R_OK) {
4787 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4790 printf("Author root certificate: %s\n", auth_root);
4791 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4796 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4799 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4800 * @brief This API gets the package cert information from the handle
4802 * @par This API is for package-manager client application
4803 * @par Sync (or) Async : Synchronous API
4805 * @param[in] handle pointer to the package cert handle.
4806 * @param[in] cert_type certificate type
4807 * @param[out] cert_value pointer to hold certificate value
4808 * @return 0 if success, error code(<0) if fail
4809 * @retval PMINFO_R_OK success
4810 * @retval PMINFO_R_EINVAL invalid argument
4811 * @retval PMINFO_R_ERROR internal error
4812 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4813 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4814 * @see pkgmgrinfo_pkginfo_load_certinfo()
4816 static int get_cert_info(const char *pkgid)
4819 pkgmgrinfo_certinfo_h handle;
4820 char *auth_cert = NULL;
4821 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4822 if (ret != PMINFO_R_OK)
4824 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4825 if (ret != PMINFO_R_OK) {
4826 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4829 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4830 if (ret != PMINFO_R_OK) {
4831 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4834 printf("Author root certificate: %s\n", auth_root);
4835 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4840 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4843 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4844 * @brief This API destroys the package cert information handle freeing up all the resources
4846 * @par This API is for package-manager client application
4847 * @par Sync (or) Async : Synchronous API
4849 * @param[in] handle pointer to the package cert handle.
4850 * @return 0 if success, error code(<0) if fail
4851 * @retval PMINFO_R_OK success
4852 * @retval PMINFO_R_EINVAL invalid argument
4853 * @retval PMINFO_R_ERROR internal error
4854 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4856 * @see pkgmgrinfo_pkginfo_load_certinfo()
4858 static int get_cert_info(const char *pkgid)
4861 pkgmgrinfo_certinfo_h handle;
4862 char *auth_cert = NULL;
4863 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4864 if (ret != PMINFO_R_OK)
4866 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4867 if (ret != PMINFO_R_OK) {
4868 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4871 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4872 if (ret != PMINFO_R_OK) {
4873 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4876 printf("Author root certificate: %s\n", auth_root);
4877 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4882 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4885 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4886 * @brief This API deletes the package cert information from DB
4888 * @par This API is for package-manager client application
4889 * @par Sync (or) Async : Synchronous API
4891 * @param[in] pkgid pointer to the package ID.
4892 * @return 0 if success, error code(<0) if fail
4893 * @retval PMINFO_R_OK success
4894 * @retval PMINFO_R_EINVAL invalid argument
4895 * @retval PMINFO_R_ERROR internal error
4899 static int delete_cert_info(const char *pkgid)
4902 ret = pkgmgrinfo_delete_certinfo(pkgid);
4903 if (ret != PMINFO_R_OK)
4909 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4910 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4912 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4913 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4914 * @brief This API creates the package db information handle to set data in db.
4916 * @par This API is for package-manager client application
4917 * @par Sync (or) Async : Synchronous API
4919 * @param[in] pkgid pointer to the package ID.
4920 * @param[in] uid the addressee user id of the instruction
4921 * @param[out] handle pointer to the package db info handle.
4922 * @return 0 if success, error code(<0) if fail
4923 * @retval PMINFO_R_OK success
4924 * @retval PMINFO_R_EINVAL invalid argument
4925 * @retval PMINFO_R_ERROR internal error
4927 * @post pkgmgrinfo_destroy_pkgdbinfo()
4928 * @see pkgmgrinfo_save_pkgdbinfo()
4929 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4931 static int set_pkg_in_db(const char *pkgid)
4934 pkgmgrinfo_pkgdbinfo_h handle;
4935 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4936 if (ret != PMINFO_R_OK)
4938 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4939 if (ret != PMINFO_R_OK) {
4940 pkgmgrinfo_destroy_pkgdbinfo(handle);
4943 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4944 if (ret != PMINFO_R_OK) {
4945 pkgmgrinfo_destroy_pkgdbinfo(handle);
4948 pkgmgrinfo_destroy_pkgdbinfo(handle);
4953 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4954 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4957 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4958 * @brief This API sets the package type in db handle
4960 * @par This API is for package-manager client application
4961 * @par Sync (or) Async : Synchronous API
4963 * @param[in] handle pointer to the pkgdbinfo handle.
4964 * @param[in] type pointer to the package type.
4965 * @return 0 if success, error code(<0) if fail
4966 * @retval PMINFO_R_OK success
4967 * @retval PMINFO_R_EINVAL invalid argument
4968 * @retval PMINFO_R_ERROR internal error
4969 * @pre pkgmgrinfo_create_pkgdbinfo()
4970 * @post pkgmgrinfo_destroy_pkgdbinfo()
4971 * @see pkgmgrinfo_save_pkgdbinfo()
4972 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4974 static int set_pkg_type_in_db(const char *pkgid)
4977 pkgmgrinfo_pkgdbinfo_h handle;
4978 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4979 if (ret != PMINFO_R_OK)
4981 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4982 if (ret != PMINFO_R_OK) {
4983 pkgmgrinfo_destroy_pkgdbinfo(handle);
4986 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4987 if (ret != PMINFO_R_OK) {
4988 pkgmgrinfo_destroy_pkgdbinfo(handle);
4991 pkgmgrinfo_destroy_pkgdbinfo(handle);
4996 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4999 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
5000 * @brief This API sets the package version in db handle
5002 * @par This API is for package-manager client application
5003 * @par Sync (or) Async : Synchronous API
5005 * @param[in] handle pointer to the pkgdbinfo handle.
5006 * @param[in] version pointer to the package version
5007 * @return 0 if success, error code(<0) if fail
5008 * @retval PMINFO_R_OK success
5009 * @retval PMINFO_R_EINVAL invalid argument
5010 * @retval PMINFO_R_ERROR internal error
5011 * @pre pkgmgrinfo_create_pkgdbinfo()
5012 * @post pkgmgrinfo_destroy_pkgdbinfo()
5013 * @see pkgmgrinfo_save_pkgdbinfo()
5014 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5016 static int set_pkg_version_in_db(const char *pkgid)
5019 pkgmgrinfo_pkgdbinfo_h handle;
5020 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5021 if (ret != PMINFO_R_OK)
5023 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5024 if (ret != PMINFO_R_OK) {
5025 pkgmgrinfo_destroy_pkgdbinfo(handle);
5028 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5029 if (ret != PMINFO_R_OK) {
5030 pkgmgrinfo_destroy_pkgdbinfo(handle);
5033 pkgmgrinfo_destroy_pkgdbinfo(handle);
5038 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
5041 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5042 * @brief This API sets the package install location in db handle
5044 * @par This API is for package-manager client application
5045 * @par Sync (or) Async : Synchronous API
5047 * @param[in] handle pointer to the pkgdbinfo handle.
5048 * @param[in] location package install location
5049 * @return 0 if success, error code(<0) if fail
5050 * @retval PMINFO_R_OK success
5051 * @retval PMINFO_R_EINVAL invalid argument
5052 * @retval PMINFO_R_ERROR internal error
5053 * @pre pkgmgrinfo_create_pkgdbinfo()
5054 * @post pkgmgrinfo_destroy_pkgdbinfo()
5055 * @see pkgmgrinfo_save_pkgdbinfo()
5056 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5058 static int set_pkg_install_location_in_db(const char *pkgid)
5061 pkgmgrinfo_pkgdbinfo_h handle;
5062 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5063 if (ret != PMINFO_R_OK)
5065 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5066 if (ret != PMINFO_R_OK) {
5067 pkgmgrinfo_destroy_pkgdbinfo(handle);
5070 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5071 if (ret != PMINFO_R_OK) {
5072 pkgmgrinfo_destroy_pkgdbinfo(handle);
5075 pkgmgrinfo_destroy_pkgdbinfo(handle);
5080 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5083 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
5084 * @brief This API sets the package size in db handle
5086 * @par This API is for package-manager client application
5087 * @par Sync (or) Async : Synchronous API
5089 * @param[in] handle pointer to the pkgdbinfo handle.
5090 * @param[in] size pointer to the package size
5091 * @return 0 if success, error code(<0) if fail
5092 * @retval PMINFO_R_OK success
5093 * @retval PMINFO_R_EINVAL invalid argument
5094 * @retval PMINFO_R_ERROR internal error
5095 * @pre pkgmgrinfo_create_pkgdbinfo()
5096 * @post pkgmgrinfo_destroy_pkgdbinfo()
5097 * @see pkgmgrinfo_save_pkgdbinfo()
5098 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5100 static int set_pkg_size_in_db(const char *pkgid)
5103 pkgmgrinfo_pkgdbinfo_h handle;
5104 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5105 if (ret != PMINFO_R_OK)
5107 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
5108 if (ret != PMINFO_R_OK) {
5109 pkgmgrinfo_destroy_pkgdbinfo(handle);
5112 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5113 if (ret != PMINFO_R_OK) {
5114 pkgmgrinfo_destroy_pkgdbinfo(handle);
5117 pkgmgrinfo_destroy_pkgdbinfo(handle);
5122 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
5125 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
5126 * @brief This API sets the package label in db handle
5128 * @par This API is for package-manager client application
5129 * @par Sync (or) Async : Synchronous API
5131 * @param[in] handle pointer to the pkgdbinfo handle.
5132 * @param[in] label pointer to the package label
5133 * @param[in] locale pointer to the locale
5134 * @return 0 if success, error code(<0) if fail
5135 * @retval PMINFO_R_OK success
5136 * @retval PMINFO_R_EINVAL invalid argument
5137 * @retval PMINFO_R_ERROR internal error
5138 * @pre pkgmgrinfo_create_pkgdbinfo()
5139 * @post pkgmgrinfo_destroy_pkgdbinfo()
5140 * @see pkgmgrinfo_save_pkgdbinfo()
5141 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5143 static int set_pkg_label_in_db(const char *pkgid)
5146 pkgmgrinfo_pkgdbinfo_h handle;
5147 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5148 if (ret != PMINFO_R_OK)
5150 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
5151 if (ret != PMINFO_R_OK) {
5152 pkgmgrinfo_destroy_pkgdbinfo(handle);
5155 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5156 if (ret != PMINFO_R_OK) {
5157 pkgmgrinfo_destroy_pkgdbinfo(handle);
5160 pkgmgrinfo_destroy_pkgdbinfo(handle);
5165 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
5168 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
5169 * @brief This API sets the package icon in db handle
5171 * @par This API is for package-manager client application
5172 * @par Sync (or) Async : Synchronous API
5174 * @param[in] handle pointer to the pkgdbinfo handle.
5175 * @param[in] icon pointer to the package icon
5176 * @param[in] locale pointer to the locale
5177 * @return 0 if success, error code(<0) if fail
5178 * @retval PMINFO_R_OK success
5179 * @retval PMINFO_R_EINVAL invalid argument
5180 * @retval PMINFO_R_ERROR internal error
5181 * @pre pkgmgrinfo_create_pkgdbinfo()
5182 * @post pkgmgrinfo_destroy_pkgdbinfo()
5183 * @see pkgmgrinfo_save_pkgdbinfo()
5184 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5186 static int set_pkg_icon_in_db(const char *pkgid)
5189 pkgmgrinfo_pkgdbinfo_h handle;
5190 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5191 if (ret != PMINFO_R_OK)
5193 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
5194 if (ret != PMINFO_R_OK) {
5195 pkgmgrinfo_destroy_pkgdbinfo(handle);
5198 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5199 if (ret != PMINFO_R_OK) {
5200 pkgmgrinfo_destroy_pkgdbinfo(handle);
5203 pkgmgrinfo_destroy_pkgdbinfo(handle);
5208 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5211 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5212 * @brief This API sets the package description in db handle
5214 * @par This API is for package-manager client application
5215 * @par Sync (or) Async : Synchronous API
5217 * @param[in] handle pointer to the pkgdbinfo handle.
5218 * @param[in] description pointer to the package description
5219 * @param[in] locale pointer to the locale
5220 * @return 0 if success, error code(<0) if fail
5221 * @retval PMINFO_R_OK success
5222 * @retval PMINFO_R_EINVAL invalid argument
5223 * @retval PMINFO_R_ERROR internal error
5224 * @pre pkgmgrinfo_create_pkgdbinfo()
5225 * @post pkgmgrinfo_destroy_pkgdbinfo()
5226 * @see pkgmgrinfo_save_pkgdbinfo()
5227 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5229 static int set_pkg_description_in_db(const char *pkgid)
5232 pkgmgrinfo_pkgdbinfo_h handle;
5233 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5234 if (ret != PMINFO_R_OK)
5236 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5237 if (ret != PMINFO_R_OK) {
5238 pkgmgrinfo_destroy_pkgdbinfo(handle);
5241 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5242 if (ret != PMINFO_R_OK) {
5243 pkgmgrinfo_destroy_pkgdbinfo(handle);
5246 pkgmgrinfo_destroy_pkgdbinfo(handle);
5251 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5254 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5255 const char *author_email, const char *author_href, const char *locale)
5256 * @brief This API sets the package author info in db 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 pkgdbinfo handle.
5262 * @param[in] author_name pointer to the package author name
5263 * @param[in] author_email pointer to the package author email
5264 * @param[in] author_href pointer to the package author href
5265 * @param[in] locale pointer to the locale
5266 * @return 0 if success, error code(<0) if fail
5267 * @retval PMINFO_R_OK success
5268 * @retval PMINFO_R_EINVAL invalid argument
5269 * @retval PMINFO_R_ERROR internal error
5270 * @pre pkgmgrinfo_create_pkgdbinfo()
5271 * @post pkgmgrinfo_destroy_pkgdbinfo()
5272 * @see pkgmgrinfo_save_pkgdbinfo()
5273 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5275 static int set_pkg_author_in_db(const char *pkgid)
5278 pkgmgrinfo_pkgdbinfo_h handle;
5279 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5280 if (ret != PMINFO_R_OK)
5282 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5283 if (ret != PMINFO_R_OK) {
5284 pkgmgrinfo_destroy_pkgdbinfo(handle);
5287 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5288 if (ret != PMINFO_R_OK) {
5289 pkgmgrinfo_destroy_pkgdbinfo(handle);
5292 pkgmgrinfo_destroy_pkgdbinfo(handle);
5297 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5298 const char *author_email, const char *author_href, const char *locale);
5301 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5302 * @brief This API sets the package 'removable' value in db handle
5304 * @par This API is for package-manager client application
5305 * @par Sync (or) Async : Synchronous API
5307 * @param[in] handle pointer to the pkgdbinfo handle.
5308 * @param[in] removable package removable value
5309 * @return 0 if success, error code(<0) if fail
5310 * @retval PMINFO_R_OK success
5311 * @retval PMINFO_R_EINVAL invalid argument
5312 * @retval PMINFO_R_ERROR internal error
5313 * @pre pkgmgrinfo_create_pkgdbinfo()
5314 * @post pkgmgrinfo_destroy_pkgdbinfo()
5315 * @see pkgmgrinfo_save_pkgdbinfo()
5316 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5318 static int set_pkg_removable_in_db(const char *pkgid)
5321 pkgmgrinfo_pkgdbinfo_h handle;
5322 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5323 if (ret != PMINFO_R_OK)
5325 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5326 if (ret != PMINFO_R_OK) {
5327 pkgmgrinfo_destroy_pkgdbinfo(handle);
5330 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5331 if (ret != PMINFO_R_OK) {
5332 pkgmgrinfo_destroy_pkgdbinfo(handle);
5335 pkgmgrinfo_destroy_pkgdbinfo(handle);
5340 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5343 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5344 * @brief This API sets the package 'preload' value in db handle
5346 * @par This API is for package-manager client application
5347 * @par Sync (or) Async : Synchronous API
5349 * @param[in] handle pointer to the pkgdbinfo handle.
5350 * @param[in] preload package preload value
5351 * @return 0 if success, error code(<0) if fail
5352 * @retval PMINFO_R_OK success
5353 * @retval PMINFO_R_EINVAL invalid argument
5354 * @retval PMINFO_R_ERROR internal error
5355 * @pre pkgmgrinfo_create_pkgdbinfo()
5356 * @post pkgmgrinfo_destroy_pkgdbinfo()
5357 * @see pkgmgrinfo_save_pkgdbinfo()
5358 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5360 static int set_pkg_preload_in_db(const char *pkgid)
5363 pkgmgrinfo_pkgdbinfo_h handle;
5364 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5365 if (ret != PMINFO_R_OK)
5367 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5368 if (ret != PMINFO_R_OK) {
5369 pkgmgrinfo_destroy_pkgdbinfo(handle);
5372 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5373 if (ret != PMINFO_R_OK) {
5374 pkgmgrinfo_destroy_pkgdbinfo(handle);
5377 pkgmgrinfo_destroy_pkgdbinfo(handle);
5382 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5385 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5386 * @brief This API sets the package 'installed_storage' value in db handle
5388 * @par This API is for package-manager client application
5389 * @par Sync (or) Async : Synchronous API
5391 * @param[in] handle pointer to the pkgdbinfo handle.
5392 * @param[in] location installed_storage value
5393 * @return 0 if success, error code(<0) if fail
5394 * @retval PMINFO_R_OK success
5395 * @retval PMINFO_R_EINVAL invalid argument
5396 * @retval PMINFO_R_ERROR internal error
5397 * @pre pkgmgrinfo_create_pkgdbinfo()
5398 * @post pkgmgrinfo_destroy_pkgdbinfo()
5399 * @see pkgmgrinfo_save_pkgdbinfo()
5401 static int set_pkg_installed_storage_in_db(const char *pkgid)
5404 pkgmgrinfo_pkgdbinfo_h handle;
5405 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5406 if (ret != PMINFO_R_OK)
5408 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5409 if (ret != PMINFO_R_OK) {
5410 pkgmgrinfo_destroy_pkgdbinfo(handle);
5413 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5414 if (ret != PMINFO_R_OK) {
5415 pkgmgrinfo_destroy_pkgdbinfo(handle);
5418 pkgmgrinfo_destroy_pkgdbinfo(handle);
5423 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5426 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5427 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5428 * @brief This API saves all the information from the handle to the DB.
5430 * @par This API is for package-manager client application
5431 * @par Sync (or) Async : Synchronous API
5433 * @param[in] handle pointer to the package db info handle.
5434 * @param[in] uid the addressee user id of the instruction
5435 * @return 0 if success, error code(<0) if fail
5436 * @retval PMINFO_R_OK success
5437 * @retval PMINFO_R_EINVAL invalid argument
5438 * @retval PMINFO_R_ERROR internal error
5439 * @pre pkgmgrinfo_create_pkgdbinfo()
5440 * @post pkgmgrinfo_destroy_pkgdbinfo()
5441 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5443 static int set_pkg_in_db(const char *pkgid)
5446 pkgmgrinfo_pkgdbinfo_h handle;
5447 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5448 if (ret != PMINFO_R_OK)
5450 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5451 if (ret != PMINFO_R_OK) {
5452 pkgmgrinfo_destroy_pkgdbinfo(handle);
5455 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5456 if (ret != PMINFO_R_OK) {
5457 pkgmgrinfo_destroy_pkgdbinfo(handle);
5460 pkgmgrinfo_destroy_pkgdbinfo(handle);
5465 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5466 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5468 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5469 * @brief This API destroys the package db information handle freeing up all the resources
5471 * @par This API is for package-manager client application
5472 * @par Sync (or) Async : Synchronous API
5474 * @param[in] handle pointer to the package db info handle.
5475 * @return 0 if success, error code(<0) if fail
5476 * @retval PMINFO_R_OK success
5477 * @retval PMINFO_R_EINVAL invalid argument
5478 * @retval PMINFO_R_ERROR internal error
5479 * @pre pkgmgrinfo_create_pkgdbinfo()
5481 * @see pkgmgrinfo_save_pkgdbinfo()
5482 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5484 static int set_pkg_in_db(const char *pkgid)
5487 pkgmgrinfo_pkgdbinfo_h handle;
5488 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5489 if (ret != PMINFO_R_OK)
5491 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5492 if (ret != PMINFO_R_OK) {
5493 pkgmgrinfo_destroy_pkgdbinfo(handle);
5496 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5497 if (ret != PMINFO_R_OK) {
5498 pkgmgrinfo_destroy_pkgdbinfo(handle);
5501 pkgmgrinfo_destroy_pkgdbinfo(handle);
5506 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5510 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5511 * @brief This API creates the package cert information handle to set data in db.
5513 * @par This API is for package-manager client application
5514 * @par Sync (or) Async : Synchronous API
5516 * @param[out] handle pointer to the package cert handle.
5517 * @return 0 if success, error code(<0) if fail
5518 * @retval PMINFO_R_OK success
5519 * @retval PMINFO_R_EINVAL invalid argument
5520 * @retval PMINFO_R_ERROR internal error
5522 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5523 * @see pkgmgrinfo_set_cert_value()
5524 * @see pkgmgrinfo_save_certinfo()
5526 static int set_cert_in_db(const char *pkgid)
5529 pkgmgrinfo_instcertinfo_h handle;
5530 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5531 if (ret != PMINFO_R_OK)
5533 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5534 if (ret != PMINFO_R_OK) {
5535 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5538 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5539 if (ret != PMINFO_R_OK) {
5540 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5543 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5548 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5551 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5552 * @brief This API sets the package cert information in the handle.
5554 * @par This API is for package-manager client application
5555 * @par Sync (or) Async : Synchronous API
5557 * @param[in] handle pointer to the package cert handle.
5558 * @param[in] cert_type certificate type.
5559 * @param[in] cert_value certificate value.
5560 * @return 0 if success, error code(<0) if fail
5561 * @retval PMINFO_R_OK success
5562 * @retval PMINFO_R_EINVAL invalid argument
5563 * @retval PMINFO_R_ERROR internal error
5564 * @pre pkgmgrinfo_create_certinfo_set_handle()
5565 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5566 * @see pkgmgrinfo_save_certinfo()
5568 static int set_cert_in_db(const char *pkgid)
5571 pkgmgrinfo_instcertinfo_h handle;
5572 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5573 if (ret != PMINFO_R_OK)
5575 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5576 if (ret != PMINFO_R_OK) {
5577 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5580 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5581 if (ret != PMINFO_R_OK) {
5582 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5585 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5590 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5593 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5594 * @brief This API saves the package cert information in the DB.
5596 * @par This API is for package-manager client application
5597 * @par Sync (or) Async : Synchronous API
5599 * @param[in] pkgid pointer to the package ID.
5600 * @param[in] handle pointer to the package cert handle.
5601 * @return 0 if success, error code(<0) if fail
5602 * @retval PMINFO_R_OK success
5603 * @retval PMINFO_R_EINVAL invalid argument
5604 * @retval PMINFO_R_ERROR internal error
5605 * @pre pkgmgrinfo_create_certinfo_set_handle()
5606 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5607 * @see pkgmgrinfo_save_certinfo()
5609 static int set_cert_in_db(const char *pkgid)
5612 pkgmgrinfo_instcertinfo_h handle;
5613 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5614 if (ret != PMINFO_R_OK)
5616 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5617 if (ret != PMINFO_R_OK) {
5618 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5621 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5622 if (ret != PMINFO_R_OK) {
5623 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5626 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5631 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5634 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5635 * @brief This API destroys the package cert information handle freeing up all the resources.
5637 * @par This API is for package-manager client application
5638 * @par Sync (or) Async : Synchronous API
5640 * @param[in] handle pointer to the package cert handle.
5641 * @return 0 if success, error code(<0) if fail
5642 * @retval PMINFO_R_OK success
5643 * @retval PMINFO_R_EINVAL invalid argument
5644 * @retval PMINFO_R_ERROR internal error
5645 * @pre pkgmgrinfo_create_certinfo_set_handle()
5647 * @see pkgmgrinfo_save_certinfo()
5649 static int set_cert_in_db(const char *pkgid)
5652 pkgmgrinfo_instcertinfo_h handle;
5653 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5654 if (ret != PMINFO_R_OK)
5656 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5657 if (ret != PMINFO_R_OK) {
5658 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5661 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5662 if (ret != PMINFO_R_OK) {
5663 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5666 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5671 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5674 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5675 * @brief This API gets the datacontrol info
5677 * @par This API is for package-manager client application
5678 * @par Sync (or) Async : Synchronous API
5680 * @param[in] providerid pointer to the providerid of dataconltrol.
5681 * @param[in] type pointer to the type of dataconltrol.
5682 * @param[out] appid pointer to hold appid, need to free after using
5683 * @param[out] access pointer to hold access, need to free after using
5684 * @return 0 if success, error code(<0) if fail
5685 * @retval PMINFO_R_OK success
5686 * @retval PMINFO_R_EINVAL invalid argument
5687 * @retval PMINFO_R_ERROR internal error
5690 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5693 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5694 * @brief This API gets the application 'guest mode visibility' value from the DB
5696 * @par This API is for package-manager client application
5697 * @par Sync (or) Async : Synchronous API
5699 * @param[in] handle pointer to application info handle
5700 * @param[out] status pointer to hold app guest mode visibility value
5701 * @return 0 if success, error code(<0) if fail
5702 * @retval PMINFO_R_OK success
5703 * @retval PMINFO_R_EINVAL invalid argument
5704 * @retval PMINFO_R_ERROR internal error
5705 * @pre pkgmgrinfo_appinfo_get_appinfo()
5706 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5707 * @see pkgmgrinfo_appinfo_get_appid()
5708 * @see pkgmgrinfo_appinfo_is_multiple()
5710 static int get_app_guestmode_visibility(const char *appid)
5714 pkgmgrinfo_appinfo_h handle;
5715 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5716 if (ret != PMINFO_R_OK)
5718 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5719 if (ret != PMINFO_R_OK) {
5720 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5723 printf("app guest mode visibility: %d\n", status);
5724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5729 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5732 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5733 * @brief This API sets the application 'guest mode visibility' value in the DB
5735 * @par This API is for package-manager client application
5736 * @par Sync (or) Async : Synchronous API
5738 * @param[in] handle pointer to application info handle
5739 * @param[out] status app guest mode visibility value
5740 * @return 0 if success, error code(<0) if fail
5741 * @retval PMINFO_R_OK success
5742 * @retval PMINFO_R_EINVAL invalid argument
5743 * @retval PMINFO_R_ERROR internal error
5744 * @pre pkgmgrinfo_appinfo_get_appinfo()
5745 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5746 * @see pkgmgrinfo_appinfo_get_appid()
5747 * @see pkgmgrinfo_appinfo_is_multiple()
5749 static int set_app_guestmode_visibility(const char *appid, bool value)
5752 pkgmgrinfo_appinfo_h handle;
5753 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5754 if (ret != PMINFO_R_OK)
5756 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5757 if (ret != PMINFO_R_OK) {
5758 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5761 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5766 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5767 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5770 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5771 * @brief This API sets the package 'installed_storage' value in db
5773 * @par This API is for package-manager client application
5774 * @par Sync (or) Async : Synchronous API
5776 * @param[in] pkgid pointer to the package ID.
5777 * @param[in] location package install location
5778 * @return 0 if success, error code(<0) if fail
5779 * @retval PMINFO_R_OK success
5780 * @retval PMINFO_R_EINVAL invalid argument
5781 * @retval PMINFO_R_ERROR internal error
5783 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5787 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5788 if (ret != PMINFO_R_OK) {
5795 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5796 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5799 * @pkgmgrinfo client API
5803 * @brief listening status type in pkgmgrinfo.
5805 #define PMINFO_CLIENT_STATUS_ALL 0x00
5806 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5807 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5808 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5809 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5810 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5811 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5814 * @brief This APIs provides pkgmgrinfo client listener
5816 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5817 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5818 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5819 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5820 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5824 * @pkgmgrinfo client API end
5832 #endif /* __PKG_INFO_H__ */