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_rpm_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, "rpm");
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 rpm 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_rpm_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, "rpm");
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 rpm 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_rpm_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, "rpm");
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 rpm 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_rpm_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, "rpm");
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_rpm_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, "rpm");
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 rpm 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_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1998 pkgmgrinfo_app_list_cb app_func, void *user_data)
1999 * @brief This API gets list of installed applications for a particular package
2001 * @par This API is for package-manager client application
2002 * @par Sync (or) Async : Synchronous API
2003 * @param[in] handle package info handle
2004 * @param[in] component application component
2005 * @param[in] app_func iteration function for list
2006 * @param[in] user_data user data to be passed to callback function
2007 * @return 0 if success, error code(<0) if fail
2008 * @retval PMINFO_R_OK success
2009 * @retval PMINFO_R_EINVAL invalid argument
2010 * @retval PMINFO_R_ERROR internal error
2011 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2012 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2014 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2017 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2018 printf("appid : %s\n", appid);
2022 static int list_apps(const char *pkgid)
2025 pkgmgrinfo_pkginfo_h handle;
2026 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2027 if (ret != PMINFO_R_OK)
2029 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2030 if (ret != PMINFO_R_OK) {
2031 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2034 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2039 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2040 pkgmgrinfo_app_list_cb app_func, void *user_data);
2041 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2042 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2044 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2045 * @brief This API gets list of installed applications from all packages with minimum informaion.
2047 * @par This API is for package-manager client application
2048 * @par Sync (or) Async : Synchronous API
2049 * @param[in] app_func iteration function for list
2050 * @param[in] user_data user data to be passed to callback function
2051 * @return 0 if success, error code(<0) if fail
2052 * @retval PMINFO_R_OK success
2053 * @retval PMINFO_R_EINVAL invalid argument
2054 * @retval PMINFO_R_ERROR internal error
2058 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2060 char *pkgid1 = NULL;
2061 char *pkgid2 = NULL;
2062 pkgid1 = (char *)user_data;
2063 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2064 if (strcmp(pkgid1, pkgid2) == 0) {
2071 static int list_apps()
2074 char *name = "helloworld";
2075 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2076 if (ret != PMINFO_R_OK) {
2083 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2084 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2086 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2087 * @brief This API gets list of installed applications from all packages.
2089 * @par This API is for package-manager client application
2090 * @par Sync (or) Async : Synchronous API
2091 * @param[in] app_func iteration function for list
2092 * @param[in] user_data user data to be passed to callback function
2093 * @return 0 if success, error code(<0) if fail
2094 * @retval PMINFO_R_OK success
2095 * @retval PMINFO_R_EINVAL invalid argument
2096 * @retval PMINFO_R_ERROR internal error
2100 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2102 char *pkgid1 = NULL;
2103 char *pkgid2 = NULL;
2104 pkgid1 = (char *)user_data;
2105 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2106 if (strcmp(pkgid1, pkgid2) == 0) {
2113 static int list_apps()
2116 char *name = "helloworld";
2117 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2118 if (ret != PMINFO_R_OK) {
2125 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2126 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2129 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2130 * @brief This API creates the application information handle from db
2132 * @par This API is for package-manager client application
2133 * @par Sync (or) Async : Synchronous API
2135 * @param[in] appid pointer to appid
2136 * @param[out] handle pointer to the application info handle.
2137 * @return 0 if success, error code(<0) if fail
2138 * @retval PMINFO_R_OK success
2139 * @retval PMINFO_R_EINVAL invalid argument
2140 * @retval PMINFO_R_ERROR internal error
2142 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2143 * @see pkgmgrinfo_appinfo_get_pkgid()
2144 * @see pkgmgrinfo_appinfo_is_multiple()
2146 static int get_app_type(const char *appid)
2150 pkgmgrinfo_appinfo_h handle;
2151 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2152 if (ret != PMINFO_R_OK)
2154 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2155 if (ret != PMINFO_R_OK) {
2156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2159 printf("apptype: %s\n", type);
2160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2165 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2166 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2168 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2169 * @brief This API gets the application ID
2171 * @par This API is for package-manager client application
2172 * @par Sync (or) Async : Synchronous API
2174 * @param[in] handle pointer to the application info handle.
2175 * @param[out] appid pointer to hold appid
2176 * @return 0 if success, error code(<0) if fail
2177 * @retval PMINFO_R_OK success
2178 * @retval PMINFO_R_EINVAL invalid argument
2179 * @retval PMINFO_R_ERROR internal error
2180 * @pre pkgmgrinfo_appinfo_get_appinfo()
2181 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2182 * @see pkgmgrinfo_appinfo_get_pkgid()
2183 * @see pkgmgrinfo_appinfo_is_multiple()
2185 static int get_app_id(const char *appid)
2188 char *app_id = NULL;
2189 pkgmgrinfo_appinfo_h handle;
2190 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2191 if (ret != PMINFO_R_OK)
2193 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2194 if (ret != PMINFO_R_OK) {
2195 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2198 printf("app id: %s\n", app_id);
2199 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2204 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2207 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2208 * @brief This API gets the package name of the application
2210 * @par This API is for package-manager client application
2211 * @par Sync (or) Async : Synchronous API
2213 * @param[in] handle pointer to the application info handle.
2214 * @param[out] pkg_name pointer to hold package name
2215 * @return 0 if success, error code(<0) if fail
2216 * @retval PMINFO_R_OK success
2217 * @retval PMINFO_R_EINVAL invalid argument
2218 * @retval PMINFO_R_ERROR internal error
2219 * @pre pkgmgrinfo_appinfo_get_appinfo()
2220 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2221 * @see pkgmgrinfo_appinfo_get_appid()
2222 * @see pkgmgrinfo_appinfo_is_multiple()
2224 static int get_app_pkgname(const char *appid)
2227 char *pkgname = NULL;
2228 pkgmgrinfo_appinfo_h handle;
2229 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2230 if (ret != PMINFO_R_OK)
2232 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2233 if (ret != PMINFO_R_OK) {
2234 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2237 printf("pkg name: %s\n", pkgname);
2238 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2243 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2246 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2247 * @brief This API gets the package id of the application
2249 * @par This API is for package-manager client application
2250 * @par Sync (or) Async : Synchronous API
2252 * @param[in] handle pointer to the application info handle.
2253 * @param[out] pkgid pointer to hold package id
2254 * @return 0 if success, error code(<0) if fail
2255 * @retval PMINFO_R_OK success
2256 * @retval PMINFO_R_EINVAL invalid argument
2257 * @retval PMINFO_R_ERROR internal error
2258 * @pre pkgmgrinfo_appinfo_get_appinfo()
2259 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2260 * @see pkgmgrinfo_appinfo_get_appid()
2261 * @see pkgmgrinfo_appinfo_is_multiple()
2263 static int get_app_pkgid(const char *appid)
2267 pkgmgrinfo_appinfo_h handle;
2268 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2269 if (ret != PMINFO_R_OK)
2271 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2272 if (ret != PMINFO_R_OK) {
2273 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2276 printf("pkg id: %s\n", pkgid);
2277 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2282 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2285 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2286 * @brief This API gets the executable name of the application
2288 * @par This API is for package-manager client application
2289 * @par Sync (or) Async : Synchronous API
2291 * @param[in] handle pointer to the application info handle.
2292 * @param[out] exec pointer to hold app exec name
2293 * @return 0 if success, error code(<0) if fail
2294 * @retval PMINFO_R_OK success
2295 * @retval PMINFO_R_EINVAL invalid argument
2296 * @retval PMINFO_R_ERROR internal error
2297 * @pre pkgmgrinfo_appinfo_get_appinfo()
2298 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2299 * @see pkgmgrinfo_appinfo_get_appid()
2300 * @see pkgmgrinfo_appinfo_is_multiple()
2302 static int get_app_exec(const char *appid)
2306 pkgmgrinfo_appinfo_h handle;
2307 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2308 if (ret != PMINFO_R_OK)
2310 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2311 if (ret != PMINFO_R_OK) {
2312 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2315 printf("exec name: %s\n", exec);
2316 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2321 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2324 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2325 * @brief This API gets the icon name of the application
2327 * @par This API is for package-manager client application
2328 * @par Sync (or) Async : Synchronous API
2330 * @param[in] handle pointer to the application info handle.
2331 * @param[out] icon pointer to hold app icon name
2332 * @return 0 if success, error code(<0) if fail
2333 * @retval PMINFO_R_OK success
2334 * @retval PMINFO_R_EINVAL invalid argument
2335 * @retval PMINFO_R_ERROR internal error
2336 * @pre pkgmgrinfo_appinfo_get_appinfo()
2337 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2338 * @see pkgmgrinfo_appinfo_get_appid()
2339 * @see pkgmgrinfo_appinfo_is_multiple()
2341 static int get_app_icon(const char *appid)
2345 pkgmgrinfo_appinfo_h handle;
2346 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2347 if (ret != PMINFO_R_OK)
2349 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2350 if (ret != PMINFO_R_OK) {
2351 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2354 printf("icon name: %s\n", icon);
2355 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2360 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2363 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2364 * @brief This API gets the label of the application
2366 * @par This API is for package-manager client application
2367 * @par Sync (or) Async : Synchronous API
2369 * @param[in] handle pointer to the application info handle.
2370 * @param[out] label pointer to hold app label
2371 * @return 0 if success, error code(<0) if fail
2372 * @retval PMINFO_R_OK success
2373 * @retval PMINFO_R_EINVAL invalid argument
2374 * @retval PMINFO_R_ERROR internal error
2375 * @pre pkgmgrinfo_appinfo_get_appinfo()
2376 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2377 * @see pkgmgrinfo_appinfo_get_appid()
2378 * @see pkgmgrinfo_appinfo_is_multiple()
2380 static int get_app_label(const char *appid)
2384 pkgmgrinfo_appinfo_h handle;
2385 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2386 if (ret != PMINFO_R_OK)
2388 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2389 if (ret != PMINFO_R_OK) {
2390 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2393 printf("label : %s\n", label);
2394 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2399 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2402 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2403 * @brief This API gets exactly matched label by given appid and locale
2405 * @par This API is for package-manager client application
2406 * @par Sync (or) Async : Synchronous API
2408 * @param[in] appid pointer to appid
2409 * @param[in] locale pointer to locale
2410 * @param[out] label pointer to hold app label
2411 * @return 0 if success, error code(<0) if fail
2412 * @retval PMINFO_R_OK success
2413 * @retval PMINFO_R_EINVAL invalid argument
2414 * @retval PMINFO_R_ERROR internal error
2416 static int get_localed_label(const char *appid, const char *locale)
2421 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2422 if (ret != PMINFO_R_OK)
2425 printf("localed label: %s\n", label);
2433 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2434 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2437 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2438 * @brief This API gets the component of the application
2440 * @par This API is for package-manager client application
2441 * @par Sync (or) Async : Synchronous API
2443 * @param[in] handle pointer to the application info handle.
2444 * @param[out] component pointer to hold app component
2445 * @return 0 if success, error code(<0) if fail
2446 * @retval PMINFO_R_OK success
2447 * @retval PMINFO_R_EINVAL invalid argument
2448 * @retval PMINFO_R_ERROR internal error
2449 * @pre pkgmgrinfo_appinfo_get_appinfo()
2450 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2451 * @see pkgmgrinfo_appinfo_get_appid()
2452 * @see pkgmgrinfo_appinfo_is_multiple()
2454 static int get_app_component(const char *appid)
2457 pkgmgrinfo_app_component component;
2458 pkgmgrinfo_appinfo_h handle;
2459 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2460 if (ret != PMINFO_R_OK)
2462 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2463 if (ret != PMINFO_R_OK) {
2464 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2467 printf("component : %s\n", component);
2468 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2473 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2476 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2477 * @brief This API gets the apptype of the application
2479 * @par This API is for package-manager client application
2480 * @par Sync (or) Async : Synchronous API
2482 * @param[in] handle pointer to the application info handle.
2483 * @param[out] app_type pointer to hold apptype
2484 * @return 0 if success, error code(<0) if fail
2485 * @retval PMINFO_R_OK success
2486 * @retval PMINFO_R_EINVAL invalid argument
2487 * @retval PMINFO_R_ERROR internal error
2488 * @pre pkgmgrinfo_appinfo_get_appinfo()
2489 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2490 * @see pkgmgrinfo_appinfo_get_appid()
2491 * @see pkgmgrinfo_appinfo_is_multiple()
2493 static int get_app_type(const char *appid)
2496 char *apptype = NULL;
2497 pkgmgrinfo_appinfo_h handle;
2498 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2499 if (ret != PMINFO_R_OK)
2501 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2502 if (ret != PMINFO_R_OK) {
2503 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2506 printf("apptype : %s\n", apptype);
2507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2512 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2515 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2516 int *operation_count, char ***operation)
2517 * @brief This API gets the list of operation of the application
2519 * @par This API is for package-manager client application
2520 * @par Sync (or) Async : Synchronous API
2522 * @param[in] handle pointer to the appcontrol handle.
2523 * @param[out] operation_count pointer to hold number of operations
2524 * @param[out] operation pointer to hold list of operations
2525 * @return 0 if success, error code(<0) if fail
2526 * @retval PMINFO_R_OK success
2527 * @retval PMINFO_R_EINVAL invalid argument
2528 * @retval PMINFO_R_ERROR internal error
2529 * @pre pkgmgrinfo_appinfo_get_appinfo()
2530 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2531 * @see pkgmgrinfo_appinfo_get_uri()
2532 * @see pkgmgrinfo_appinfo_get_mime()
2534 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2539 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2540 for (i = 0; i < oc; i++) {
2541 if (strcmp(operation[i], (char *)user_data) == 0)
2548 static int check_operation(const char *appid, char *operation)
2551 pkgmgrinfo_appinfo_h handle;
2552 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2553 if (ret != PMINFO_R_OK)
2555 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2556 if (ret != PMINFO_R_OK) {
2557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2560 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2565 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2566 int *operation_count, char ***operation);
2569 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2570 int *uri_count, char ***uri)
2571 * @brief This API gets the list of uri of the application
2573 * @par This API is for package-manager client application
2574 * @par Sync (or) Async : Synchronous API
2576 * @param[in] handle pointer to the appcontrol handle.
2577 * @param[out] uri_count pointer to hold number of uris
2578 * @param[out] uri pointer to hold list of uris
2579 * @return 0 if success, error code(<0) if fail
2580 * @retval PMINFO_R_OK success
2581 * @retval PMINFO_R_EINVAL invalid argument
2582 * @retval PMINFO_R_ERROR internal error
2583 * @pre pkgmgrinfo_appinfo_get_appinfo()
2584 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2585 * @see pkgmgrinfo_appinfo_get_operation()
2586 * @see pkgmgrinfo_appinfo_get_mime()
2588 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2593 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2594 for (i = 0; i < uc; i++) {
2595 if (strcmp(uri[i], (char *)user_data) == 0)
2602 static int check_uri(const char *appid, char *uri)
2605 pkgmgrinfo_appinfo_h handle;
2606 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2607 if (ret != PMINFO_R_OK)
2609 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2610 if (ret != PMINFO_R_OK) {
2611 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2614 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2619 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2620 int *uri_count, char ***uri);
2623 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2624 int *mime_count, char ***mime)
2625 * @brief This API gets the list of mime of the application
2627 * @par This API is for package-manager client application
2628 * @par Sync (or) Async : Synchronous API
2630 * @param[in] handle pointer to the appcontrol handle.
2631 * @param[out] mime_count pointer to hold number of mimes
2632 * @param[out] mime pointer to hold list of mimes
2633 * @return 0 if success, error code(<0) if fail
2634 * @retval PMINFO_R_OK success
2635 * @retval PMINFO_R_EINVAL invalid argument
2636 * @retval PMINFO_R_ERROR internal error
2637 * @pre pkgmgrinfo_appinfo_get_appinfo()
2638 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2639 * @see pkgmgrinfo_appinfo_get_uri()
2640 * @see pkgmgrinfo_appinfo_get_operation()
2642 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2647 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2648 for (i = 0; i < mc; i++) {
2649 if (strcmp(mime[i], (char *)user_data) == 0)
2656 static int check_mime(const char *appid, char *mime)
2659 pkgmgrinfo_appinfo_h handle;
2660 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2661 if (ret != PMINFO_R_OK)
2663 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2664 if (ret != PMINFO_R_OK) {
2665 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2668 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2673 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2674 int *mime_count, char ***mime);
2677 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2678 int *subapp_count, char ***subapp)
2679 * @brief This API gets the list of subapp of the application
2681 * @par This API is for package-manager client application
2682 * @par Sync (or) Async : Synchronous API
2684 * @param[in] handle pointer to the appcontrol handle.
2685 * @param[out] subapp_count pointer to hold number of subapp
2686 * @param[out] subapp pointer to hold list of subapp
2687 * @return 0 if success, error code(<0) if fail
2688 * @retval PMINFO_R_OK success
2689 * @retval PMINFO_R_EINVAL invalid argument
2690 * @retval PMINFO_R_ERROR internal error
2691 * @pre pkgmgrinfo_appinfo_get_appinfo()
2692 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2693 * @see pkgmgrinfo_appinfo_get_uri()
2694 * @see pkgmgrinfo_appinfo_get_operation()
2696 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2700 char **subapp = NULL;
2701 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2702 for (i = 0; i < sc; i++) {
2703 if (strcmp(subapp[i], (char *)user_data) == 0)
2710 static int check_subapp(const char *appid, char *subapp)
2713 pkgmgrinfo_appinfo_h handle = NULL;
2714 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2715 if (ret != PMINFO_R_OK)
2717 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2718 if (ret != PMINFO_R_OK) {
2719 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2722 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2727 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2728 int *subapp_count, char ***subapp);
2731 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2732 * @brief This API gets the notification icon of the application
2734 * @par This API is for package-manager client application
2735 * @par Sync (or) Async : Synchronous API
2737 * @param[in] handle pointer to the application info handle.
2738 * @param[out] path pointer to hold notification icon
2739 * @return 0 if success, error code(<0) if fail
2740 * @retval PMINFO_R_OK success
2741 * @retval PMINFO_R_EINVAL invalid argument
2742 * @retval PMINFO_R_ERROR internal error
2743 * @pre pkgmgrinfo_appinfo_get_appinfo()
2744 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2745 * @see pkgmgrinfo_appinfo_get_appid()
2746 * @see pkgmgrinfo_appinfo_is_multiple()
2748 static int get_app_notification_icon(const char *appid)
2751 char *notification_icon = NULL;
2752 pkgmgrinfo_appinfo_h handle;
2753 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2754 if (ret != PMINFO_R_OK)
2756 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2757 if (ret != PMINFO_R_OK) {
2758 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2761 printf("notification icon : %s\n", notification_icon);
2762 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2767 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2770 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2771 * @brief This API gets the setting icon of the application
2773 * @par This API is for package-manager client application
2774 * @par Sync (or) Async : Synchronous API
2776 * @param[in] handle pointer to the application info handle.
2777 * @param[out] path pointer to hold setting icon
2778 * @return 0 if success, error code(<0) if fail
2779 * @retval PMINFO_R_OK success
2780 * @retval PMINFO_R_EINVAL invalid argument
2781 * @retval PMINFO_R_ERROR internal error
2782 * @pre pkgmgrinfo_appinfo_get_appinfo()
2783 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2784 * @see pkgmgrinfo_appinfo_get_appid()
2785 * @see pkgmgrinfo_appinfo_is_multiple()
2787 static int get_app_setting_icon(const char *appid)
2790 char *setting_icon = NULL;
2791 pkgmgrinfo_appinfo_h handle;
2792 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2793 if (ret != PMINFO_R_OK)
2795 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2796 if (ret != PMINFO_R_OK) {
2797 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2800 printf("setting icon : %s\n", setting_icon);
2801 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2806 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2809 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2810 * @brief This API gets the type of recent image on app-tray
2812 * @par This API is for package-manager client application
2813 * @par Sync (or) Async : Synchronous API
2815 * @param[in] handle pointer to the application info handle.
2816 * @param[out] type pointer to hold image type
2817 * @return 0 if success, error code(<0) if fail
2818 * @retval PMINFO_R_OK success
2819 * @retval PMINFO_R_EINVAL invalid argument
2820 * @retval PMINFO_R_ERROR internal error
2821 * @pre pkgmgrinfo_appinfo_get_appinfo()
2822 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2823 * @see pkgmgrinfo_appinfo_get_appid()
2824 * @see pkgmgrinfo_appinfo_is_multiple()
2826 static int get_app_recent_image_type(const char *appid)
2829 pkgmgrinfo_app_recentimage type;
2830 pkgmgrinfo_appinfo_h handle;
2831 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2832 if (ret != PMINFO_R_OK)
2834 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2835 if (ret != PMINFO_R_OK) {
2836 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2839 printf("recent image type: %d\n", type);
2840 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2845 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2849 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2850 * @brief This API gets the preview image of application
2852 * @par Sync (or) Async : Synchronous API
2854 * @param[in] handle pointer to the application info handle.
2855 * @param[out] preview_img pointer to hold preview image path
2856 * @return 0 if success, error code(<0) if fail
2857 * @retval PMINFO_R_OK success
2858 * @retval PMINFO_R_EINVAL invalid argument
2859 * @retval PMINFO_R_ERROR internal error
2860 * @pre pkgmgrinfo_appinfo_get_appinfo()
2861 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2862 * @see pkgmgrinfo_appinfo_get_appid()
2864 static int get_app_previewimage(const char *appid)
2867 char *preview = NULL;
2868 pkgmgrinfo_appinfo_h handle = NULL;
2869 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2870 if (ret != PMINFO_R_OK)
2872 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2873 if (ret != PMINFO_R_OK) {
2874 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2877 printf("preview image path : %s\n", preview);
2878 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2883 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2887 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2888 * @brief This API gets the package permission type of the application
2890 * @par This API is for package-manager client application
2891 * @par Sync (or) Async : Synchronous API
2893 * @param[in] handle pointer to the application info handle.
2894 * @param[out] permission pointer to hold package permission
2895 * @return 0 if success, error code(<0) if fail
2896 * @retval PMINFO_R_OK success
2897 * @retval PMINFO_R_EINVAL invalid argument
2898 * @retval PMINFO_R_ERROR internal error
2899 * @pre pkgmgrinfo_appinfo_get_appinfo()
2900 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2901 * @see pkgmgrinfo_appinfo_get_appid()
2903 static int get_app_permission(const char *appid)
2906 pkgmgrinfo_permission_type permission = 0;
2907 pkgmgrinfo_appinfo_h handle;
2909 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2910 if (ret != PMINFO_R_OK)
2912 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2913 if (ret != PMINFO_R_OK) {
2914 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2917 printf("permission type: %d\n", permission);
2918 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2923 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2926 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2927 * @brief This API gets the component_type
2929 * @par This API is for package-manager client application
2930 * @par Sync (or) Async : Synchronous API
2932 * @param[in] handle pointer to the application info handle.
2933 * @param[out] component_type pointer to hold component_type
2934 * @return 0 if success, error code(<0) if fail
2935 * @retval PMINFO_R_OK success
2936 * @retval PMINFO_R_EINVAL invalid argument
2937 * @retval PMINFO_R_ERROR internal error
2938 * @pre pkgmgrinfo_appinfo_get_appinfo()
2939 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2940 * @see pkgmgrinfo_appinfo_get_pkgid()
2941 * @see pkgmgrinfo_appinfo_is_multiple()
2943 static int get_component_type(const char *appid)
2946 char *component_type = NULL;
2947 pkgmgrinfo_appinfo_h handle;
2948 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2949 if (ret != PMINFO_R_OK)
2951 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2952 if (ret != PMINFO_R_OK) {
2953 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2956 printf("component_type: %s\n", component_type);
2957 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2962 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2965 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2966 * @brief This API gets the application 'hwacceleration' value from the app ID
2968 * @par This API is for package-manager client application
2969 * @par Sync (or) Async : Synchronous API
2971 * @param[in] handle pointer to application info handle
2972 * @param[out] hwacceleration pointer to hold package hwacceleration value
2973 * @return 0 if success, error code(<0) if fail
2974 * @retval PMINFO_R_OK success
2975 * @retval PMINFO_R_EINVAL invalid argument
2976 * @retval PMINFO_R_ERROR internal error
2977 * @pre pkgmgrinfo_appinfo_get_appinfo()
2978 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2979 * @see pkgmgrinfo_appinfo_get_appid()
2980 * @see pkgmgrinfo_appinfo_is_multiple()
2982 static int get_app_hwacceleration(const char *appid)
2985 pkgmgrinfo_app_hwacceleration hwacceleration;
2986 pkgmgrinfo_appinfo_h handle;
2987 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2988 if (ret != PMINFO_R_OK)
2990 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2991 if (ret != PMINFO_R_OK) {
2992 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2995 printf("app hwacceleration: %d\n", hwacceleration);
2996 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3001 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3004 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3005 * @brief This API gets the application 'screenreader' value from the app ID
3007 * @par This API is for package-manager client application
3008 * @par Sync (or) Async : Synchronous API
3010 * @param[in] handle pointer to application info handle
3011 * @param[out] screenreader pointer to hold package accessibility value
3012 * @return 0 if success, error code(<0) if fail
3013 * @retval PMINFO_R_OK success
3014 * @retval PMINFO_R_EINVAL invalid argument
3015 * @retval PMINFO_R_ERROR internal error
3016 * @pre pkgmgrinfo_appinfo_get_appinfo()
3017 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3018 * @see pkgmgrinfo_appinfo_get_appid()
3019 * @see pkgmgrinfo_appinfo_is_multiple()
3021 static int get_app_screenreader(const char *appid)
3024 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3025 pkgmgrinfo_appinfo_h handle = NULL;
3026 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3027 if (ret != PMINFO_R_OK)
3029 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3030 if (ret != PMINFO_R_OK) {
3031 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3034 printf("app screenreader: %d\n", screenreader);
3035 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3040 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3043 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3044 * @brief This API gets the application's landscape & portrait effect images
3046 * @par This API is for package-manager client application
3047 * @par Sync (or) Async : Synchronous API
3049 * @param[in] handle pointer to application info handle
3050 * @param[out] portrait_img contains portrait mode effect image
3051 * @param[out] landscape_img contains landscape mode effect image
3052 * @return 0 if success, error code(<0) if fail
3053 * @retval PMINFO_R_OK success
3054 * @retval PMINFO_R_EINVAL invalid argument
3055 * @retval PMINFO_R_ERROR internal error
3056 * @pre pkgmgrinfo_appinfo_get_appinfo()
3057 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3058 * @see pkgmgrinfo_appinfo_get_appid()
3059 * @see pkgmgrinfo_appinfo_is_nodisplay()
3061 static int get_app_effectimages(const char *appid)
3064 char *portraitimg = NULL;
3065 char *landscapeimg = NULL;
3066 pkgmgrinfo_appinfo_h handle;
3067 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3068 if (ret != PMINFO_R_OK)
3070 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3071 if (ret != PMINFO_R_OK) {
3072 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3075 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3076 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3081 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3084 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3085 * @brief This API gets the application's effect image type
3087 * @par This API is for package-manager client application
3088 * @par Sync (or) Async : Synchronous API
3090 * @param[in] handle pointer to application info handle
3091 * @param[out] effectimg_type contains effect image type
3092 * @return 0 if success, error code(<0) if fail
3093 * @retval PMINFO_R_OK success
3094 * @retval PMINFO_R_EINVAL invalid argument
3095 * @retval PMINFO_R_ERROR internal error
3096 * @pre pkgmgrinfo_appinfo_get_appinfo()
3097 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3098 * @see pkgmgrinfo_appinfo_get_appid()
3099 * @see pkgmgrinfo_appinfo_is_nodisplay()
3101 static int get_app_effectimage_type(const char *appid)
3104 char *effectimg_type = NULL;
3105 pkgmgrinfo_appinfo_h handle = NULL;
3106 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3107 if (ret != PMINFO_R_OK)
3109 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3110 if (ret != PMINFO_R_OK) {
3111 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3114 printf("app effect image type: %s\n", effectimg_type);
3115 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3120 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3123 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3124 * @brief This API gets the submode_mainid of the application
3126 * @par This API is for package-manager client application
3127 * @par Sync (or) Async : Synchronous API
3129 * @param[in] handle pointer to the application info handle.
3130 * @param[out] submode_mainid pointer to hold package name
3131 * @return 0 if success, error code(<0) if fail
3132 * @retval PMINFO_R_OK success
3133 * @retval PMINFO_R_EINVAL invalid argument
3134 * @retval PMINFO_R_ERROR internal error
3135 * @pre pkgmgrinfo_appinfo_get_appinfo()
3136 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3137 * @see pkgmgrinfo_appinfo_get_appid()
3138 * @see pkgmgrinfo_appinfo_is_multiple()
3140 static int get_app_submode_mainid(const char *appid)
3143 char *submode_mainid = NULL;
3144 pkgmgrinfo_appinfo_h handle = NULL;
3145 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3146 if (ret != PMINFO_R_OK)
3148 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3149 if (ret != PMINFO_R_OK) {
3150 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3153 printf("submode_mainid: %s\n", submode_mainid);
3154 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3159 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3162 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3163 * @brief This API gets the datacontrol info
3165 * @par This API is for package-manager client application
3166 * @par Sync (or) Async : Synchronous API
3168 * @param[in] providerid pointer to the providerid of dataconltrol.
3169 * @param[in] type pointer to the type of dataconltrol.
3170 * @param[out] appid pointer to hold appid, need to free after using
3171 * @param[out] access pointer to hold access, need to free after using
3172 * @return 0 if success, error code(<0) if fail
3173 * @retval PMINFO_R_OK success
3174 * @retval PMINFO_R_EINVAL invalid argument
3175 * @retval PMINFO_R_ERROR internal error
3178 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3179 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3182 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3183 * @brief This API gets the appid of datacontrol
3185 * @par This API is for package-manager client application
3186 * @par Sync (or) Async : Synchronous API
3188 * @param[in] providerid pointer to the providerid of dataconltrol.
3189 * @param[out] appid pointer to hold appid, need to free after using
3190 * @return 0 if success, error code(<0) if fail
3191 * @retval PMINFO_R_OK success
3192 * @retval PMINFO_R_EINVAL invalid argument
3193 * @retval PMINFO_R_ERROR internal error
3196 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3197 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3200 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3201 * @brief This API gets the alias_appid of the application
3203 * @par This API is for package-manager client application
3204 * @par Sync (or) Async : Synchronous API
3206 * @param[in] handle pointer to the application info handle.
3207 * @param[out] alias_appid pointer to hold app alias_appid
3208 * @return 0 if success, error code(<0) if fail
3209 * @retval PMINFO_R_OK success
3210 * @retval PMINFO_R_EINVAL invalid argument
3211 * @retval PMINFO_R_ERROR internal error
3212 * @pre pkgmgrinfo_appinfo_get_appinfo()
3213 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3214 * @see pkgmgrinfo_appinfo_get_appid()
3216 static int get_alias_appid(const char *appid)
3219 char *alias_appid= 0;
3220 pkgmgrinfo_appinfo_h handle = NULL;
3221 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3222 if (ret != PMINFO_R_OK)
3224 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3225 if (ret != PMINFO_R_OK) {
3226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3229 printf("alias_appid: %s\n", alias_appid);
3230 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3235 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3238 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3239 * @brief This API gets the effective_appid of the application
3241 * @par This API is for package-manager client application
3242 * @par Sync (or) Async : Synchronous API
3244 * @param[in] handle pointer to the application info handle.
3245 * @param[out] effective_appid pointer to hold app effective_appid
3246 * @return 0 if success, error code(<0) if fail
3247 * @retval PMINFO_R_OK success
3248 * @retval PMINFO_R_EINVAL invalid argument
3249 * @retval PMINFO_R_ERROR internal error
3250 * @pre pkgmgrinfo_appinfo_get_appinfo()
3251 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3252 * @see pkgmgrinfo_appinfo_get_appid()
3254 static int get_effective_appid(const char *appid)
3257 char *effective_appid= 0;
3258 pkgmgrinfo_appinfo_h handle = NULL;
3259 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3260 if (ret != PMINFO_R_OK)
3262 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3263 if (ret != PMINFO_R_OK) {
3264 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3267 printf("effective_appid: %s\n", effective_appid);
3268 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3273 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3276 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3277 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3278 * @brief This API gets the list of permission for a particular application
3280 * @par This API is for package-manager client application
3281 * @par Sync (or) Async : Synchronous API
3282 * @param[in] handle pointer to the application info handle.
3283 * @param[in] permission_func callback function for list
3284 * @param[in] user_data user data to be passed to callback function
3285 * @return 0 if success, error code(<0) if fail
3286 * @retval PMINFO_R_OK success
3287 * @retval PMINFO_R_EINVAL invalid argument
3288 * @retval PMINFO_R_ERROR internal error
3289 * @pre pkgmgrinfo_appinfo_get_appinfo()
3290 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3292 int permission_func(const char *name, void *user_data)
3294 if (strcmp(name, (char *)user_data) == 0)
3300 static int list_permission(const char *appid, char *permission)
3303 pkgmgrinfo_appinfo_h handle;
3304 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3305 if (ret != PMINFO_R_OK)
3307 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3308 if (ret != PMINFO_R_OK) {
3309 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3312 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3317 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3318 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3321 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3322 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3323 * @brief This API gets the list of category for a particular application
3325 * @par This API is for package-manager client application
3326 * @par Sync (or) Async : Synchronous API
3327 * @param[in] handle pointer to the application info handle.
3328 * @param[in] category_func callback function for list
3329 * @param[in] user_data user data to be passed to callback function
3330 * @return 0 if success, error code(<0) if fail
3331 * @retval PMINFO_R_OK success
3332 * @retval PMINFO_R_EINVAL invalid argument
3333 * @retval PMINFO_R_ERROR internal error
3334 * @pre pkgmgrinfo_appinfo_get_appinfo()
3335 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3337 int category_func(const char *name, void *user_data)
3339 if (strcmp(name, (char *)user_data) == 0)
3345 static int list_category(const char *appid, char *category)
3348 pkgmgrinfo_appinfo_h handle;
3349 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3350 if (ret != PMINFO_R_OK)
3352 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3353 if (ret != PMINFO_R_OK) {
3354 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3357 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3362 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3363 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3366 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3367 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3368 * @brief This API gets the list of metadata for a particular application
3370 * @par This API is for package-manager client application
3371 * @par Sync (or) Async : Synchronous API
3372 * @param[in] handle pointer to the application info handle.
3373 * @param[in] metadata_func callback function for list
3374 * @param[in] user_data user data to be passed to callback function
3375 * @return 0 if success, error code(<0) if fail
3376 * @retval PMINFO_R_OK success
3377 * @retval PMINFO_R_EINVAL invalid argument
3378 * @retval PMINFO_R_ERROR internal error
3379 * @pre pkgmgrinfo_appinfo_get_appinfo()
3380 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3382 int metadata_func(const char *key, const char *value, void *user_data)
3384 if (strcmp(key, (char *)user_data) == 0) {
3385 printf("Value is %s\n", value);
3392 static int list_metadata(const char *appid, char *key)
3395 pkgmgrinfo_appinfo_h handle;
3396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3397 if (ret != PMINFO_R_OK)
3399 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3400 if (ret != PMINFO_R_OK) {
3401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3404 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3409 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3410 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3414 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3415 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3416 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3417 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3418 * @brief This API gets the list of app-control for a particular application
3420 * @par This API is for package-manager client application
3421 * @par Sync (or) Async : Synchronous API
3422 * @param[in] handle pointer to the application info handle.
3423 * @param[in] appcontrol_func callback function for list
3424 * @param[in] user_data user data to be passed to callback function
3425 * @param[in] uid the addressee user id of the instruction
3426 * @return 0 if success, error code(<0) if fail
3427 * @retval PMINFO_R_OK success
3428 * @retval PMINFO_R_EINVAL invalid argument
3429 * @retval PMINFO_R_ERROR internal error
3430 * @pre pkgmgrinfo_appinfo_get_appinfo()
3431 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3433 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3438 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3439 for (i = 0; i < oc; i++) {
3440 if (strcmp(operation[i], (char *)user_data) == 0)
3447 static int check_operation(const char *appid, char *operation)
3450 pkgmgrinfo_appinfo_h handle;
3451 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3452 if (ret != PMINFO_R_OK)
3454 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3455 if (ret != PMINFO_R_OK) {
3456 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3459 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3464 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3465 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3470 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3471 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3474 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3475 * @brief This API gets the application 'nodisplay' value from the app ID
3477 * @par This API is for package-manager client application
3478 * @par Sync (or) Async : Synchronous API
3480 * @param[in] handle pointer to application info handle
3481 * @param[out] nodisplay pointer to hold package nodisplay value
3482 * @return 0 if success, error code(<0) if fail
3483 * @retval PMINFO_R_OK success
3484 * @retval PMINFO_R_EINVAL invalid argument
3485 * @retval PMINFO_R_ERROR internal error
3486 * @pre pkgmgrinfo_appinfo_get_appinfo()
3487 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3488 * @see pkgmgrinfo_appinfo_get_appid()
3489 * @see pkgmgrinfo_appinfo_is_multiple()
3491 static int get_app_nodisplay(const char *appid)
3495 pkgmgrinfo_appinfo_h handle;
3496 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3497 if (ret != PMINFO_R_OK)
3499 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3500 if (ret != PMINFO_R_OK) {
3501 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3504 printf("app nodisplay: %d\n", nodisplay);
3505 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3510 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3513 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3514 * @brief This API gets the application 'multiple' value from the app ID
3516 * @par This API is for package-manager client application
3517 * @par Sync (or) Async : Synchronous API
3519 * @param[in] handle pointer to application info handle
3520 * @param[out] multiple pointer to hold package multiple value
3521 * @return 0 if success, error code(<0) if fail
3522 * @retval PMINFO_R_OK success
3523 * @retval PMINFO_R_EINVAL invalid argument
3524 * @retval PMINFO_R_ERROR internal error
3525 * @pre pkgmgrinfo_appinfo_get_appinfo()
3526 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3527 * @see pkgmgrinfo_appinfo_get_appid()
3528 * @see pkgmgrinfo_appinfo_is_nodisplay()
3530 static int get_app_multiple(const char *appid)
3534 pkgmgrinfo_appinfo_h handle;
3535 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3536 if (ret != PMINFO_R_OK)
3538 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3539 if (ret != PMINFO_R_OK) {
3540 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3543 printf("app multiple: %d\n", multiple);
3544 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3549 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3552 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3553 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3554 * application launching effect. If fales, indicator will be hidden during application launching effect
3556 * @par This API is for package-manager client application
3557 * @par Sync (or) Async : Synchronous API
3559 * @param[in] handle pointer to application info handle
3560 * @param[out] indicator_disp contains indicator display status for application launching effect
3561 * @return 0 if success, error code(<0) if fail
3562 * @retval PMINFO_R_OK success
3563 * @retval PMINFO_R_EINVAL invalid argument
3564 * @retval PMINFO_R_ERROR internal error
3565 * @pre pkgmgrinfo_appinfo_get_appinfo()
3566 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3567 * @see pkgmgrinfo_appinfo_get_appid()
3568 * @see pkgmgrinfo_appinfo_is_nodisplay()
3570 static int get_app_indicator_display(const char *appid)
3573 bool indicator_disp;
3574 pkgmgrinfo_appinfo_h handle;
3575 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3576 if (ret != PMINFO_R_OK)
3578 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3579 if (ret != PMINFO_R_OK){
3580 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3583 printf("app indicator disp : %d\n", indicator_disp);
3584 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3589 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3592 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3593 * @brief This API gets the application 'taskmanage' value from the app ID
3595 * @par This API is for package-manager client application
3596 * @par Sync (or) Async : Synchronous API
3598 * @param[in] handle pointer to application info handle
3599 * @param[out] taskmanage pointer to hold package taskmanage value
3600 * @return 0 if success, error code(<0) if fail
3601 * @retval PMINFO_R_OK success
3602 * @retval PMINFO_R_EINVAL invalid argument
3603 * @retval PMINFO_R_ERROR internal error
3604 * @pre pkgmgrinfo_appinfo_get_appinfo()
3605 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3606 * @see pkgmgrinfo_appinfo_get_appid()
3607 * @see pkgmgrinfo_appinfo_is_multiple()
3609 static int get_app_taskmanage(const char *appid)
3613 pkgmgrinfo_appinfo_h handle;
3614 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3615 if (ret != PMINFO_R_OK)
3617 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3618 if (ret != PMINFO_R_OK) {
3619 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3622 printf("app taskmanage: %d\n", taskmanage);
3623 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3628 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3631 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3632 * @brief This API gets the application 'taskmanage' value from the app ID
3634 * @par This API is for package-manager client application
3635 * @par Sync (or) Async : Synchronous API
3637 * @param[in] handle pointer to application info handle
3638 * @param[out] enabled pointer to hold package enabled value
3639 * @return 0 if success, error code(<0) if fail
3640 * @retval PMINFO_R_OK success
3641 * @retval PMINFO_R_EINVAL invalid argument
3642 * @retval PMINFO_R_ERROR internal error
3643 * @pre pkgmgrinfo_appinfo_get_appinfo()
3644 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3645 * @see pkgmgrinfo_appinfo_get_appid()
3646 * @see pkgmgrinfo_appinfo_is_multiple()
3648 static int get_app_enabled(const char *appid)
3652 pkgmgrinfo_appinfo_h handle;
3653 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3654 if (ret != PMINFO_R_OK)
3656 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3657 if (ret != PMINFO_R_OK) {
3658 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3661 printf("app enabled: %d\n", enabled);
3662 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3667 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3670 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3671 * @brief This API gets the application 'onboot' value from the app ID
3673 * @par This API is for package-manager client application
3674 * @par Sync (or) Async : Synchronous API
3676 * @param[in] handle pointer to application info handle
3677 * @param[out] onboot pointer to hold package onboot value
3678 * @return 0 if success, error code(<0) if fail
3679 * @retval PMINFO_R_OK success
3680 * @retval PMINFO_R_EINVAL invalid argument
3681 * @retval PMINFO_R_ERROR internal error
3682 * @pre pkgmgrinfo_appinfo_get_appinfo()
3683 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3684 * @see pkgmgrinfo_appinfo_get_appid()
3685 * @see pkgmgrinfo_appinfo_is_multiple()
3687 static int get_app_onboot(const char *appid)
3691 pkgmgrinfo_appinfo_h handle;
3692 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3693 if (ret != PMINFO_R_OK)
3695 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3696 if (ret != PMINFO_R_OK) {
3697 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3700 printf("app onboot: %d\n", onboot);
3701 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3706 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3709 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3710 * @brief This API gets the application 'autorestart' value from the app ID
3712 * @par This API is for package-manager client application
3713 * @par Sync (or) Async : Synchronous API
3715 * @param[in] handle pointer to application info handle
3716 * @param[out] autorestart pointer to hold package autorestart value
3717 * @return 0 if success, error code(<0) if fail
3718 * @retval PMINFO_R_OK success
3719 * @retval PMINFO_R_EINVAL invalid argument
3720 * @retval PMINFO_R_ERROR internal error
3721 * @pre pkgmgrinfo_appinfo_get_appinfo()
3722 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3723 * @see pkgmgrinfo_appinfo_get_appid()
3724 * @see pkgmgrinfo_appinfo_is_multiple()
3726 static int get_app_autorestart(const char *appid)
3730 pkgmgrinfo_appinfo_h handle;
3731 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3732 if (ret != PMINFO_R_OK)
3734 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3735 if (ret != PMINFO_R_OK) {
3736 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3739 printf("app autorestart: %d\n", autorestart);
3740 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3745 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3748 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3749 * @brief This API gets the value for given application is main app or not from handle
3751 * @par This API is for package-manager client application
3752 * @par Sync (or) Async : Synchronous API
3754 * @param[in] handle pointer to application info handle
3755 * @param[out] mainapp pointer to hold package mainapp is or not
3756 * @return 0 if success, error code(<0) if fail
3757 * @retval PMINFO_R_OK success
3758 * @retval PMINFO_R_EINVAL invalid argument
3759 * @retval PMINFO_R_ERROR internal error
3760 * @pre pkgmgrinfo_appinfo_get_appinfo()
3761 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3762 * @see pkgmgrinfo_appinfo_get_appid()
3763 * @see pkgmgrinfo_appinfo_is_multiple()
3765 static int get_app_mainapp(const char *appid)
3769 pkgmgrinfo_appinfo_h handle;
3770 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3771 if (ret != PMINFO_R_OK)
3773 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3774 if (ret != PMINFO_R_OK) {
3775 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3778 printf("mainapp: %d\n", mainapp);
3779 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3784 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3788 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3789 * @brief This API gets the value for given application is preload or not from handle
3791 * @par This API is for package-manager client application
3792 * @par Sync (or) Async : Synchronous API
3794 * @param[in] handle pointer to application info handle
3795 * @param[out] preload pointer to hold preload is or not
3796 * @return 0 if success, error code(<0) if fail
3797 * @retval PMINFO_R_OK success
3798 * @retval PMINFO_R_EINVAL invalid argument
3799 * @retval PMINFO_R_ERROR internal error
3800 * @pre pkgmgrinfo_appinfo_get_appinfo()
3801 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3802 * @see pkgmgrinfo_appinfo_get_appid()
3803 * @see pkgmgrinfo_appinfo_is_multiple()
3805 static int get_app_preload(const char *appid)
3809 pkgmgrinfo_appinfo_h handle = NULL;
3810 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3811 if (ret != PMINFO_R_OK)
3813 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3814 if (ret != PMINFO_R_OK) {
3815 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3818 printf("preload: %d\n", preload);
3819 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3824 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3827 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3828 * @brief This API gets the value for given application is submode or not from handle
3830 * @par This API is for package-manager client application
3831 * @par Sync (or) Async : Synchronous API
3833 * @param[in] handle pointer to application info handle
3834 * @param[out] submode pointer to hold submode is or not
3835 * @return 0 if success, error code(<0) if fail
3836 * @retval PMINFO_R_OK success
3837 * @retval PMINFO_R_EINVAL invalid argument
3838 * @retval PMINFO_R_ERROR internal error
3839 * @pre pkgmgrinfo_appinfo_get_appinfo()
3840 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3841 * @see pkgmgrinfo_appinfo_get_appid()
3842 * @see pkgmgrinfo_appinfo_is_multiple()
3844 static int get_app_submode(const char *appid)
3848 pkgmgrinfo_appinfo_h handle = NULL;
3849 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3850 if (ret != PMINFO_R_OK)
3852 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3853 if (ret != PMINFO_R_OK) {
3854 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3857 printf("submode: %d\n", submode);
3858 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3863 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3866 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
3867 * @brief This API gets the value for given application is process_pool or not from handle
3869 * @par This API is for package-manager client application
3870 * @par Sync (or) Async : Synchronous API
3872 * @param[in] handle pointer to application info handle
3873 * @param[out] process_pool pointer to hold process_pool is or not
3874 * @return 0 if success, error code(<0) if fail
3875 * @retval PMINFO_R_OK success
3876 * @retval PMINFO_R_EINVAL invalid argument
3877 * @retval PMINFO_R_ERROR internal error
3878 * @pre pkgmgrinfo_appinfo_get_appinfo()
3879 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3880 * @see pkgmgrinfo_appinfo_get_appid()
3882 static int get_app_process_pool(const char *appid)
3885 bool process_pool = 0;
3886 pkgmgrinfo_appinfo_h handle = NULL;
3887 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3888 if (ret != PMINFO_R_OK)
3890 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
3891 if (ret != PMINFO_R_OK) {
3892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3895 printf("process_pool: %d\n", process_pool);
3896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3901 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
3904 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
3905 * @brief This API gets the installed storage location of the application
3907 * @par This API is for package-manager client application
3908 * @par Sync (or) Async : Synchronous API
3910 * @param[in] handle pointer to the application info handle.
3911 * @param[out] app_type pointer to hold installed storage location
3912 * @return 0 if success, error code(<0) if fail
3913 * @retval PMINFO_R_OK success
3914 * @retval PMINFO_R_EINVAL invalid argument
3915 * @retval PMINFO_R_ERROR internal error
3916 * @pre pkgmgrinfo_appinfo_get_appinfo()
3917 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3918 * @see pkgmgrinfo_appinfo_get_appid()
3920 static int get_app_installed_location(const char *appid)
3923 pkgmgrinfo_installed_storage storage;
3924 pkgmgrinfo_appinfo_h handle = NULL;
3925 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3926 if (ret != PMINFO_R_OK)
3928 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
3929 if (ret != PMINFO_R_OK) {
3930 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3933 printf("Installed storage location : %d\n", storage);
3934 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3939 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
3943 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3944 * @brief This API checks if the application has the given category
3946 * @par This API is for package-manager client application
3947 * @par Sync (or) Async : Synchronous API
3949 * @param[in] handle pointer to the application info handle
3950 * @param[in] category category
3951 * @param[out] exist value Gets whether the application has the given category
3952 * @return 0 if success, error code(<0) if fail
3953 * @retval PMINFO_R_OK success
3954 * @retval PMINFO_R_EINVAL invalid argument
3955 * @retval PMINFO_R_ERROR internal error
3957 static int is_category_exist(const char *appid, const char *category)
3960 pkgmgrinfo_appinfo_h handle;
3963 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3964 if (ret != PMINFO_R_OK)
3967 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3968 if (ret != PMINFO_R_OK) {
3969 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3973 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3978 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3981 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
3982 * @brief This API gets the application 'ui_gadget' value from the app ID
3984 * @par This API is for package-manager client application
3985 * @par Sync (or) Async : Synchronous API
3987 * @param[in] handle pointer to application info handle
3988 * @param[out] ui_gadget pointer to hold package ui_gadget value
3989 * @return 0 if success, error code(<0) if fail
3990 * @retval PMINFO_R_OK success
3991 * @retval PMINFO_R_EINVAL invalid argument
3992 * @pre pkgmgrinfo_appinfo_get_appinfo()
3993 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3995 static int get_app_ui_gadget(const char *appid)
3999 pkgmgrinfo_appinfo_h handle = NULL;
4000 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4001 if (ret != PMINFO_R_OK)
4003 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4004 if (ret != PMINFO_R_OK) {
4005 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4008 printf("app ui_gadget: %d\n", ui_gadget);
4009 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4014 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4017 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4018 * @brief This API gets the application 'support_disable' value from the app ID
4020 * @par This API is for package-manager client application
4021 * @par Sync (or) Async : Synchronous API
4023 * @param[in] handle pointer to application info handle
4024 * @param[out] support_disable pointer to hold package support_disable value
4025 * @return 0 if success, error code(<0) if fail
4026 * @retval PMINFO_R_OK success
4027 * @retval PMINFO_R_EINVAL invalid argument
4028 * @pre pkgmgrinfo_appinfo_get_appinfo()
4029 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4031 static int get_app_support_disable(const char *appid)
4034 bool support_disable;
4035 pkgmgrinfo_appinfo_h handle = NULL;
4036 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4037 if (ret != PMINFO_R_OK)
4039 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4040 if (ret != PMINFO_R_OK) {
4041 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4044 printf("app support_disable: %d\n", support_disable);
4045 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4050 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4053 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4054 * @brief This API destroys the application information handle freeing up all the resources
4056 * @par This API is for package-manager client application
4057 * @par Sync (or) Async : Synchronous API
4059 * @param[in] handle pointer to the application info handle.
4060 * @return 0 if success, error code(<0) if fail
4061 * @retval PMINFO_R_OK success
4062 * @retval PMINFO_R_EINVAL invalid argument
4063 * @retval PMINFO_R_ERROR internal error
4064 * @pre pkgmgrinfo_appinfo_get_appinfo()
4066 * @see pkgmgrinfo_appinfo_get_pkgid()
4067 * @see pkgmgrinfo_appinfo_is_multiple()
4069 static int get_app_type(const char *appid)
4073 pkgmgrinfo_appinfo_h handle;
4074 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4075 if (ret != PMINFO_R_OK)
4077 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4078 if (ret != PMINFO_R_OK) {
4079 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4082 printf("apptype: %s\n", type);
4083 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4088 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4091 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4092 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4093 The query will search the entire application information collected from the manifest file of all the installed packages
4095 * @par This API is for package-manager client application
4096 * @par Sync (or) Async : Synchronous API
4098 * @param[out] handle pointer to the application info filter handle.
4099 * @return 0 if success, error code(<0) if fail
4100 * @retval PMINFO_R_OK success
4101 * @retval PMINFO_R_EINVAL invalid argument
4102 * @retval PMINFO_R_ERROR internal error
4104 * @post pkgmgrinfo_appinfo_filter_destroy()
4105 * @see pkgmgrinfo_appinfo_filter_count()
4106 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4108 static int get_capp_count()
4112 pkgmgrinfo_appinfo_filter_h handle;
4113 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4114 if (ret != PMINFO_R_OK)
4116 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4117 if (ret != PMINFO_R_OK) {
4118 pkgmgrinfo_appinfo_filter_destroy(handle);
4121 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4122 if (ret != PMINFO_R_OK) {
4123 pkgmgrinfo_appinfo_filter_destroy(handle);
4126 printf("No of capp: %d\n", count);
4127 pkgmgrinfo_appinfo_filter_destroy(handle);
4132 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4135 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4136 * @brief This API destroys the application information filter handle freeing up all the resources
4138 * @par This API is for package-manager client application
4139 * @par Sync (or) Async : Synchronous API
4141 * @param[in] handle pointer to the application info filter handle.
4142 * @return 0 if success, error code(<0) if fail
4143 * @retval PMINFO_R_OK success
4144 * @retval PMINFO_R_EINVAL invalid argument
4145 * @retval PMINFO_R_ERROR internal error
4146 * @pre pkgmgrinfo_appinfo_filter_create()
4148 * @see pkgmgrinfo_appinfo_filter_count()
4149 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4151 static int get_capp_count()
4155 pkgmgrinfo_appinfo_filter_h handle;
4156 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4157 if (ret != PMINFO_R_OK)
4159 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4160 if (ret != PMINFO_R_OK) {
4161 pkgmgrinfo_appinfo_filter_destroy(handle);
4164 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4165 if (ret != PMINFO_R_OK) {
4166 pkgmgrinfo_appinfo_filter_destroy(handle);
4169 printf("No of capp: %d\n", count);
4170 pkgmgrinfo_appinfo_filter_destroy(handle);
4175 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4178 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4179 * @brief This API adds a boolean filter property to the filter handle
4181 * @par This API is for package-manager client application
4182 * @par Sync (or) Async : Synchronous API
4184 * @param[in] handle pointer to the application info filter handle.
4185 * @param[in] property boolean property name.
4186 * @param[in] value value corresponding to the property.
4187 * @return 0 if success, error code(<0) if fail
4188 * @retval PMINFO_R_OK success
4189 * @retval PMINFO_R_EINVAL invalid argument
4190 * @retval PMINFO_R_ERROR internal error
4191 * @pre pkgmgrinfo_appinfo_filter_create()
4192 * @post pkgmgrinfo_appinfo_filter_destroy()
4193 * @see pkgmgrinfo_appinfo_filter_count()
4194 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4196 static int get_taskmanageable_app_count()
4200 pkgmgrinfo_appinfo_filter_h handle;
4201 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4202 if (ret != PMINFO_R_OK)
4204 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4205 if (ret != PMINFO_R_OK) {
4206 pkgmgrinfo_appinfo_filter_destroy(handle);
4209 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4210 if (ret != PMINFO_R_OK) {
4211 pkgmgrinfo_appinfo_filter_destroy(handle);
4214 printf("No of taskmanageable apps: %d\n", count);
4215 pkgmgrinfo_appinfo_filter_destroy(handle);
4220 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4221 const char *property, const bool value);
4224 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4225 * @brief This API adds an integer filter property to the filter handle
4227 * @par This API is for package-manager client application
4228 * @par Sync (or) Async : Synchronous API
4230 * @param[in] handle pointer to the application info filter handle.
4231 * @param[in] property integer property name.
4232 * @param[in] value value corresponding to the property.
4233 * @return 0 if success, error code(<0) if fail
4234 * @retval PMINFO_R_OK success
4235 * @retval PMINFO_R_EINVAL invalid argument
4236 * @retval PMINFO_R_ERROR internal error
4237 * @pre pkgmgrinfo_appinfo_filter_create()
4238 * @post pkgmgrinfo_appinfo_filter_destroy()
4239 * @see pkgmgrinfo_appinfo_filter_count()
4240 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4242 static int get_taskmanageable_app_count()
4246 pkgmgrinfo_appinfo_filter_h handle;
4247 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4248 if (ret != PMINFO_R_OK)
4250 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4251 if (ret != PMINFO_R_OK) {
4252 pkgmgrinfo_appinfo_filter_destroy(handle);
4255 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4256 if (ret != PMINFO_R_OK) {
4257 pkgmgrinfo_appinfo_filter_destroy(handle);
4260 printf("No of apps: %d\n", count);
4261 pkgmgrinfo_appinfo_filter_destroy(handle);
4266 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4267 const char *property, const int value);
4270 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4271 * @brief This API adds a string filter property to the filter handle
4273 * @par This API is for package-manager client application
4274 * @par Sync (or) Async : Synchronous API
4276 * @param[in] handle pointer to the application info filter handle.
4277 * @param[in] property string property name.
4278 * @param[in] value value corresponding to the property.
4279 * @return 0 if success, error code(<0) if fail
4280 * @retval PMINFO_R_OK success
4281 * @retval PMINFO_R_EINVAL invalid argument
4282 * @retval PMINFO_R_ERROR internal error
4283 * @pre pkgmgrinfo_appinfo_filter_create()
4284 * @post pkgmgrinfo_appinfo_filter_destroy()
4285 * @see pkgmgrinfo_appinfo_filter_count()
4286 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4288 static int get_capp_count()
4292 pkgmgrinfo_appinfo_filter_h handle;
4293 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4294 if (ret != PMINFO_R_OK)
4296 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4297 if (ret != PMINFO_R_OK) {
4298 pkgmgrinfo_appinfo_filter_destroy(handle);
4301 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4302 if (ret != PMINFO_R_OK) {
4303 pkgmgrinfo_appinfo_filter_destroy(handle);
4306 printf("No of capp: %d\n", count);
4307 pkgmgrinfo_appinfo_filter_destroy(handle);
4312 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4313 const char *property, const char *value);
4316 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4317 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4319 * @par This API is for package-manager client application
4320 * @par Sync (or) Async : Synchronous API
4322 * @param[in] handle pointer to the application info filter handle.
4323 * @param[in] app_cb callback function.
4324 * @param[in] user_data user data to be passed to the callback function
4325 * @return 0 if success, error code(<0) if fail
4326 * @retval PMINFO_R_OK success
4327 * @retval PMINFO_R_EINVAL invalid argument
4328 * @retval PMINFO_R_ERROR internal error
4329 * @pre pkgmgrinfo_appinfo_filter_create()
4330 * @post pkgmgrinfo_appinfo_filter_destroy()
4331 * @see pkgmgrinfo_appinfo_filter_count()
4333 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4336 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4337 printf("appid : %s\n", appid);
4341 static int get_capp_list()
4344 pkgmgrinfo_appinfo_filter_h handle;
4345 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4346 if (ret != PMINFO_R_OK)
4348 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4349 if (ret != PMINFO_R_OK) {
4350 pkgmgrinfo_appinfo_filter_destroy(handle);
4353 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4354 if (ret != PMINFO_R_OK) {
4355 pkgmgrinfo_appinfo_filter_destroy(handle);
4358 pkgmgrinfo_appinfo_filter_destroy(handle);
4363 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4364 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4365 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4366 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4369 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4370 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4371 * @brief This API counts the application that satisfy the filter conditions
4373 * @par This API is for package-manager client application
4374 * @par Sync (or) Async : Synchronous API
4376 * @param[in] handle pointer to the application info filter handle.
4377 * @param[in] count pointer to store count value
4378 * @param[in] uid the addressee user id of the instruction
4379 * @return 0 if success, error code(<0) if fail
4380 * @retval PMINFO_R_OK success
4381 * @retval PMINFO_R_EINVAL invalid argument
4382 * @retval PMINFO_R_ERROR internal error
4383 * @pre pkgmgrinfo_appinfo_filter_create()
4384 * @post pkgmgrinfo_appinfo_filter_destroy()
4385 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4387 static int get_capp_count()
4391 pkgmgrinfo_appinfo_filter_h handle;
4392 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4393 if (ret != PMINFO_R_OK)
4395 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4396 if (ret != PMINFO_R_OK) {
4397 pkgmgrinfo_appinfo_filter_destroy(handle);
4400 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4401 if (ret != PMINFO_R_OK) {
4402 pkgmgrinfo_appinfo_filter_destroy(handle);
4405 printf("No of capp: %d\n", count);
4406 pkgmgrinfo_appinfo_filter_destroy(handle);
4411 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4412 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4414 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4415 * @brief This API creates the application's metadata information filter handle from db.
4417 * @par This API is for package-manager client application
4418 * @par Sync (or) Async : Synchronous API
4420 * @param[out] handle pointer to the application metadata info filter handle.
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
4426 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4427 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
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_app_list(const char *mkey, const char *mvalue)
4440 pkgmgrinfo_appinfo_metadata_filter_h handle;
4441 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4442 if (ret != PMINFO_R_OK)
4444 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4445 if (ret != PMINFO_R_OK) {
4446 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4449 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4450 if (ret != PMINFO_R_OK) {
4451 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4454 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4459 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4462 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4463 * @brief This API destroys the application's metadata information filter handle.
4465 * @par This API is for package-manager client application
4466 * @par Sync (or) Async : Synchronous API
4468 * @param[in] handle pointer to the application metadata info filter handle.
4469 * @return 0 if success, error code(<0) if fail
4470 * @retval PMINFO_R_OK success
4471 * @retval PMINFO_R_EINVAL invalid argument
4472 * @retval PMINFO_R_ERROR internal error
4473 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4475 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4477 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4480 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4481 printf("appid : %s\n", appid);
4485 static int get_app_list(const char *mkey, const char *mvalue)
4488 pkgmgrinfo_appinfo_metadata_filter_h handle;
4489 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4490 if (ret != PMINFO_R_OK)
4492 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4493 if (ret != PMINFO_R_OK) {
4494 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4497 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4498 if (ret != PMINFO_R_OK) {
4499 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4502 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4507 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4510 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4511 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4512 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4514 * @par This API is for package-manager client application
4515 * @par Sync (or) Async : Synchronous API
4517 * @param[in] handle pointer to the application metadata info filter handle.
4518 * @param[in] key pointer to metadata key
4519 * @param[in] value pointer to metadata value
4520 * @return 0 if success, error code(<0) if fail
4521 * @retval PMINFO_R_OK success
4522 * @retval PMINFO_R_EINVAL invalid argument
4523 * @retval PMINFO_R_ERROR internal error
4524 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4525 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4526 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4528 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4531 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4532 printf("appid : %s\n", appid);
4536 static int get_app_list(const char *mkey, const char *mvalue)
4539 pkgmgrinfo_appinfo_metadata_filter_h handle;
4540 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4541 if (ret != PMINFO_R_OK)
4543 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4544 if (ret != PMINFO_R_OK) {
4545 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4548 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4549 if (ret != PMINFO_R_OK) {
4550 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4553 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4558 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4559 const char *key, const char *value);
4562 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4563 * @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)
4564 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4565 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4566 * negative value, no more callbacks will be called and API will return.
4568 * @par This API is for package-manager client application
4569 * @par Sync (or) Async : Synchronous API
4571 * @param[in] handle pointer to the application metadata info filter handle.
4572 * @param[in] app_cb function pointer to callback
4573 * @param[in] user_data pointer to user data
4574 * @param[in] uid the addressee user id of the instruction
4575 * @return 0 if success, error code(<0) if fail
4576 * @retval PMINFO_R_OK success
4577 * @retval PMINFO_R_EINVAL invalid argument
4578 * @retval PMINFO_R_ERROR internal error
4579 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4580 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4582 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4585 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4586 printf("appid : %s\n", appid);
4590 static int get_app_list(const char *mkey, const char *mvalue)
4593 pkgmgrinfo_appinfo_metadata_filter_h handle;
4594 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4595 if (ret != PMINFO_R_OK)
4597 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4598 if (ret != PMINFO_R_OK) {
4599 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4602 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4603 if (ret != PMINFO_R_OK) {
4604 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4607 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4612 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4613 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4614 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4615 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4617 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4618 * @brief This API creates the package cert information handle to get data from db.
4620 * @par This API is for package-manager client application
4621 * @par Sync (or) Async : Synchronous API
4623 * @param[out] handle pointer to the package cert handle.
4624 * @return 0 if success, error code(<0) if fail
4625 * @retval PMINFO_R_OK success
4626 * @retval PMINFO_R_EINVAL invalid argument
4627 * @retval PMINFO_R_ERROR internal error
4629 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4630 * @see pkgmgrinfo_pkginfo_get_cert_value()
4631 * @see pkgmgrinfo_pkginfo_load_certinfo()
4633 static int get_cert_info(const char *pkgid)
4636 pkgmgrinfo_certinfo_h handle;
4637 char *auth_cert = NULL;
4638 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4639 if (ret != PMINFO_R_OK)
4641 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4642 if (ret != PMINFO_R_OK) {
4643 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4646 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4647 if (ret != PMINFO_R_OK) {
4648 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4651 printf("Author root certificate: %s\n", auth_root);
4652 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4657 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4660 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4661 * @brief This API loads the package cert information handle with data from db.
4663 * @par This API is for package-manager client application
4664 * @par Sync (or) Async : Synchronous API
4666 * @param[in] pkgid pointer to the package ID.
4667 * @param[in] handle pointer to the package cert handle.
4668 * @return 0 if success, error code(<0) if fail
4669 * @retval PMINFO_R_OK success
4670 * @retval PMINFO_R_EINVAL invalid argument
4671 * @retval PMINFO_R_ERROR internal error
4672 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4673 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4674 * @see pkgmgrinfo_pkginfo_get_cert_value()
4676 static int get_cert_info(const char *pkgid)
4679 pkgmgrinfo_certinfo_h handle;
4680 char *auth_cert = NULL;
4681 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4682 if (ret != PMINFO_R_OK)
4684 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4685 if (ret != PMINFO_R_OK) {
4686 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4689 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4690 if (ret != PMINFO_R_OK) {
4691 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4694 printf("Author root certificate: %s\n", auth_root);
4695 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4700 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4703 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4704 * @brief This API gets the package cert information from the handle
4706 * @par This API is for package-manager client application
4707 * @par Sync (or) Async : Synchronous API
4709 * @param[in] handle pointer to the package cert handle.
4710 * @param[in] cert_type certificate type
4711 * @param[out] cert_value pointer to hold certificate value
4712 * @return 0 if success, error code(<0) if fail
4713 * @retval PMINFO_R_OK success
4714 * @retval PMINFO_R_EINVAL invalid argument
4715 * @retval PMINFO_R_ERROR internal error
4716 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4717 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4718 * @see pkgmgrinfo_pkginfo_load_certinfo()
4720 static int get_cert_info(const char *pkgid)
4723 pkgmgrinfo_certinfo_h handle;
4724 char *auth_cert = NULL;
4725 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4726 if (ret != PMINFO_R_OK)
4728 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4729 if (ret != PMINFO_R_OK) {
4730 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4733 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4734 if (ret != PMINFO_R_OK) {
4735 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4738 printf("Author root certificate: %s\n", auth_root);
4739 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4744 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4747 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4748 * @brief This API destroys the package cert information handle freeing up all the resources
4750 * @par This API is for package-manager client application
4751 * @par Sync (or) Async : Synchronous API
4753 * @param[in] handle pointer to the package cert handle.
4754 * @return 0 if success, error code(<0) if fail
4755 * @retval PMINFO_R_OK success
4756 * @retval PMINFO_R_EINVAL invalid argument
4757 * @retval PMINFO_R_ERROR internal error
4758 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4760 * @see pkgmgrinfo_pkginfo_load_certinfo()
4762 static int get_cert_info(const char *pkgid)
4765 pkgmgrinfo_certinfo_h handle;
4766 char *auth_cert = NULL;
4767 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4768 if (ret != PMINFO_R_OK)
4770 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4771 if (ret != PMINFO_R_OK) {
4772 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4775 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4776 if (ret != PMINFO_R_OK) {
4777 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4780 printf("Author root certificate: %s\n", auth_root);
4781 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4786 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4789 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4790 * @brief This API deletes the package cert information from DB
4792 * @par This API is for package-manager client application
4793 * @par Sync (or) Async : Synchronous API
4795 * @param[in] pkgid pointer to the package ID.
4796 * @return 0 if success, error code(<0) if fail
4797 * @retval PMINFO_R_OK success
4798 * @retval PMINFO_R_EINVAL invalid argument
4799 * @retval PMINFO_R_ERROR internal error
4803 static int delete_cert_info(const char *pkgid)
4806 ret = pkgmgrinfo_delete_certinfo(pkgid);
4807 if (ret != PMINFO_R_OK)
4813 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4814 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4816 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4817 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4818 * @brief This API creates the package db information handle to set data in db.
4820 * @par This API is for package-manager client application
4821 * @par Sync (or) Async : Synchronous API
4823 * @param[in] pkgid pointer to the package ID.
4824 * @param[in] uid the addressee user id of the instruction
4825 * @param[out] handle pointer to the package db info handle.
4826 * @return 0 if success, error code(<0) if fail
4827 * @retval PMINFO_R_OK success
4828 * @retval PMINFO_R_EINVAL invalid argument
4829 * @retval PMINFO_R_ERROR internal error
4831 * @post pkgmgrinfo_destroy_pkgdbinfo()
4832 * @see pkgmgrinfo_save_pkgdbinfo()
4833 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4835 static int set_pkg_in_db(const char *pkgid)
4838 pkgmgrinfo_pkgdbinfo_h handle;
4839 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4840 if (ret != PMINFO_R_OK)
4842 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4843 if (ret != PMINFO_R_OK) {
4844 pkgmgrinfo_destroy_pkgdbinfo(handle);
4847 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4848 if (ret != PMINFO_R_OK) {
4849 pkgmgrinfo_destroy_pkgdbinfo(handle);
4852 pkgmgrinfo_destroy_pkgdbinfo(handle);
4857 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4858 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4861 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4862 * @brief This API sets the package type in db handle
4864 * @par This API is for package-manager client application
4865 * @par Sync (or) Async : Synchronous API
4867 * @param[in] handle pointer to the pkgdbinfo handle.
4868 * @param[in] type pointer to the package type.
4869 * @return 0 if success, error code(<0) if fail
4870 * @retval PMINFO_R_OK success
4871 * @retval PMINFO_R_EINVAL invalid argument
4872 * @retval PMINFO_R_ERROR internal error
4873 * @pre pkgmgrinfo_create_pkgdbinfo()
4874 * @post pkgmgrinfo_destroy_pkgdbinfo()
4875 * @see pkgmgrinfo_save_pkgdbinfo()
4876 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4878 static int set_pkg_type_in_db(const char *pkgid)
4881 pkgmgrinfo_pkgdbinfo_h handle;
4882 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4883 if (ret != PMINFO_R_OK)
4885 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4886 if (ret != PMINFO_R_OK) {
4887 pkgmgrinfo_destroy_pkgdbinfo(handle);
4890 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4891 if (ret != PMINFO_R_OK) {
4892 pkgmgrinfo_destroy_pkgdbinfo(handle);
4895 pkgmgrinfo_destroy_pkgdbinfo(handle);
4900 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4903 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4904 * @brief This API sets the package version in db handle
4906 * @par This API is for package-manager client application
4907 * @par Sync (or) Async : Synchronous API
4909 * @param[in] handle pointer to the pkgdbinfo handle.
4910 * @param[in] version pointer to the package version
4911 * @return 0 if success, error code(<0) if fail
4912 * @retval PMINFO_R_OK success
4913 * @retval PMINFO_R_EINVAL invalid argument
4914 * @retval PMINFO_R_ERROR internal error
4915 * @pre pkgmgrinfo_create_pkgdbinfo()
4916 * @post pkgmgrinfo_destroy_pkgdbinfo()
4917 * @see pkgmgrinfo_save_pkgdbinfo()
4918 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4920 static int set_pkg_version_in_db(const char *pkgid)
4923 pkgmgrinfo_pkgdbinfo_h handle;
4924 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4925 if (ret != PMINFO_R_OK)
4927 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4928 if (ret != PMINFO_R_OK) {
4929 pkgmgrinfo_destroy_pkgdbinfo(handle);
4932 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4933 if (ret != PMINFO_R_OK) {
4934 pkgmgrinfo_destroy_pkgdbinfo(handle);
4937 pkgmgrinfo_destroy_pkgdbinfo(handle);
4942 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4945 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4946 * @brief This API sets the package install location in db handle
4948 * @par This API is for package-manager client application
4949 * @par Sync (or) Async : Synchronous API
4951 * @param[in] handle pointer to the pkgdbinfo handle.
4952 * @param[in] location package install location
4953 * @return 0 if success, error code(<0) if fail
4954 * @retval PMINFO_R_OK success
4955 * @retval PMINFO_R_EINVAL invalid argument
4956 * @retval PMINFO_R_ERROR internal error
4957 * @pre pkgmgrinfo_create_pkgdbinfo()
4958 * @post pkgmgrinfo_destroy_pkgdbinfo()
4959 * @see pkgmgrinfo_save_pkgdbinfo()
4960 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4962 static int set_pkg_install_location_in_db(const char *pkgid)
4965 pkgmgrinfo_pkgdbinfo_h handle;
4966 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4967 if (ret != PMINFO_R_OK)
4969 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4970 if (ret != PMINFO_R_OK) {
4971 pkgmgrinfo_destroy_pkgdbinfo(handle);
4974 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4975 if (ret != PMINFO_R_OK) {
4976 pkgmgrinfo_destroy_pkgdbinfo(handle);
4979 pkgmgrinfo_destroy_pkgdbinfo(handle);
4984 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4987 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4988 * @brief This API sets the package size in db handle
4990 * @par This API is for package-manager client application
4991 * @par Sync (or) Async : Synchronous API
4993 * @param[in] handle pointer to the pkgdbinfo handle.
4994 * @param[in] size pointer to the package size
4995 * @return 0 if success, error code(<0) if fail
4996 * @retval PMINFO_R_OK success
4997 * @retval PMINFO_R_EINVAL invalid argument
4998 * @retval PMINFO_R_ERROR internal error
4999 * @pre pkgmgrinfo_create_pkgdbinfo()
5000 * @post pkgmgrinfo_destroy_pkgdbinfo()
5001 * @see pkgmgrinfo_save_pkgdbinfo()
5002 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5004 static int set_pkg_size_in_db(const char *pkgid)
5007 pkgmgrinfo_pkgdbinfo_h handle;
5008 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5009 if (ret != PMINFO_R_OK)
5011 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
5012 if (ret != PMINFO_R_OK) {
5013 pkgmgrinfo_destroy_pkgdbinfo(handle);
5016 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5017 if (ret != PMINFO_R_OK) {
5018 pkgmgrinfo_destroy_pkgdbinfo(handle);
5021 pkgmgrinfo_destroy_pkgdbinfo(handle);
5026 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
5029 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
5030 * @brief This API sets the package label in db handle
5032 * @par This API is for package-manager client application
5033 * @par Sync (or) Async : Synchronous API
5035 * @param[in] handle pointer to the pkgdbinfo handle.
5036 * @param[in] label pointer to the package label
5037 * @param[in] locale pointer to the locale
5038 * @return 0 if success, error code(<0) if fail
5039 * @retval PMINFO_R_OK success
5040 * @retval PMINFO_R_EINVAL invalid argument
5041 * @retval PMINFO_R_ERROR internal error
5042 * @pre pkgmgrinfo_create_pkgdbinfo()
5043 * @post pkgmgrinfo_destroy_pkgdbinfo()
5044 * @see pkgmgrinfo_save_pkgdbinfo()
5045 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5047 static int set_pkg_label_in_db(const char *pkgid)
5050 pkgmgrinfo_pkgdbinfo_h handle;
5051 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5052 if (ret != PMINFO_R_OK)
5054 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
5055 if (ret != PMINFO_R_OK) {
5056 pkgmgrinfo_destroy_pkgdbinfo(handle);
5059 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5060 if (ret != PMINFO_R_OK) {
5061 pkgmgrinfo_destroy_pkgdbinfo(handle);
5064 pkgmgrinfo_destroy_pkgdbinfo(handle);
5069 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
5072 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
5073 * @brief This API sets the package icon in db handle
5075 * @par This API is for package-manager client application
5076 * @par Sync (or) Async : Synchronous API
5078 * @param[in] handle pointer to the pkgdbinfo handle.
5079 * @param[in] icon pointer to the package icon
5080 * @param[in] locale pointer to the locale
5081 * @return 0 if success, error code(<0) if fail
5082 * @retval PMINFO_R_OK success
5083 * @retval PMINFO_R_EINVAL invalid argument
5084 * @retval PMINFO_R_ERROR internal error
5085 * @pre pkgmgrinfo_create_pkgdbinfo()
5086 * @post pkgmgrinfo_destroy_pkgdbinfo()
5087 * @see pkgmgrinfo_save_pkgdbinfo()
5088 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5090 static int set_pkg_icon_in_db(const char *pkgid)
5093 pkgmgrinfo_pkgdbinfo_h handle;
5094 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5095 if (ret != PMINFO_R_OK)
5097 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
5098 if (ret != PMINFO_R_OK) {
5099 pkgmgrinfo_destroy_pkgdbinfo(handle);
5102 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5103 if (ret != PMINFO_R_OK) {
5104 pkgmgrinfo_destroy_pkgdbinfo(handle);
5107 pkgmgrinfo_destroy_pkgdbinfo(handle);
5112 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5115 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5116 * @brief This API sets the package description in db handle
5118 * @par This API is for package-manager client application
5119 * @par Sync (or) Async : Synchronous API
5121 * @param[in] handle pointer to the pkgdbinfo handle.
5122 * @param[in] description pointer to the package description
5123 * @param[in] locale pointer to the locale
5124 * @return 0 if success, error code(<0) if fail
5125 * @retval PMINFO_R_OK success
5126 * @retval PMINFO_R_EINVAL invalid argument
5127 * @retval PMINFO_R_ERROR internal error
5128 * @pre pkgmgrinfo_create_pkgdbinfo()
5129 * @post pkgmgrinfo_destroy_pkgdbinfo()
5130 * @see pkgmgrinfo_save_pkgdbinfo()
5131 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5133 static int set_pkg_description_in_db(const char *pkgid)
5136 pkgmgrinfo_pkgdbinfo_h handle;
5137 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5138 if (ret != PMINFO_R_OK)
5140 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5141 if (ret != PMINFO_R_OK) {
5142 pkgmgrinfo_destroy_pkgdbinfo(handle);
5145 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5146 if (ret != PMINFO_R_OK) {
5147 pkgmgrinfo_destroy_pkgdbinfo(handle);
5150 pkgmgrinfo_destroy_pkgdbinfo(handle);
5155 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5158 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5159 const char *author_email, const char *author_href, const char *locale)
5160 * @brief This API sets the package author info in db handle
5162 * @par This API is for package-manager client application
5163 * @par Sync (or) Async : Synchronous API
5165 * @param[in] handle pointer to the pkgdbinfo handle.
5166 * @param[in] author_name pointer to the package author name
5167 * @param[in] author_email pointer to the package author email
5168 * @param[in] author_href pointer to the package author href
5169 * @param[in] locale pointer to the locale
5170 * @return 0 if success, error code(<0) if fail
5171 * @retval PMINFO_R_OK success
5172 * @retval PMINFO_R_EINVAL invalid argument
5173 * @retval PMINFO_R_ERROR internal error
5174 * @pre pkgmgrinfo_create_pkgdbinfo()
5175 * @post pkgmgrinfo_destroy_pkgdbinfo()
5176 * @see pkgmgrinfo_save_pkgdbinfo()
5177 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5179 static int set_pkg_author_in_db(const char *pkgid)
5182 pkgmgrinfo_pkgdbinfo_h handle;
5183 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5184 if (ret != PMINFO_R_OK)
5186 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5187 if (ret != PMINFO_R_OK) {
5188 pkgmgrinfo_destroy_pkgdbinfo(handle);
5191 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5192 if (ret != PMINFO_R_OK) {
5193 pkgmgrinfo_destroy_pkgdbinfo(handle);
5196 pkgmgrinfo_destroy_pkgdbinfo(handle);
5201 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5202 const char *author_email, const char *author_href, const char *locale);
5205 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5206 * @brief This API sets the package 'removable' value in db handle
5208 * @par This API is for package-manager client application
5209 * @par Sync (or) Async : Synchronous API
5211 * @param[in] handle pointer to the pkgdbinfo handle.
5212 * @param[in] removable package removable value
5213 * @return 0 if success, error code(<0) if fail
5214 * @retval PMINFO_R_OK success
5215 * @retval PMINFO_R_EINVAL invalid argument
5216 * @retval PMINFO_R_ERROR internal error
5217 * @pre pkgmgrinfo_create_pkgdbinfo()
5218 * @post pkgmgrinfo_destroy_pkgdbinfo()
5219 * @see pkgmgrinfo_save_pkgdbinfo()
5220 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5222 static int set_pkg_removable_in_db(const char *pkgid)
5225 pkgmgrinfo_pkgdbinfo_h handle;
5226 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5227 if (ret != PMINFO_R_OK)
5229 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5230 if (ret != PMINFO_R_OK) {
5231 pkgmgrinfo_destroy_pkgdbinfo(handle);
5234 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5235 if (ret != PMINFO_R_OK) {
5236 pkgmgrinfo_destroy_pkgdbinfo(handle);
5239 pkgmgrinfo_destroy_pkgdbinfo(handle);
5244 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5247 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5248 * @brief This API sets the package 'preload' value in db handle
5250 * @par This API is for package-manager client application
5251 * @par Sync (or) Async : Synchronous API
5253 * @param[in] handle pointer to the pkgdbinfo handle.
5254 * @param[in] preload package preload value
5255 * @return 0 if success, error code(<0) if fail
5256 * @retval PMINFO_R_OK success
5257 * @retval PMINFO_R_EINVAL invalid argument
5258 * @retval PMINFO_R_ERROR internal error
5259 * @pre pkgmgrinfo_create_pkgdbinfo()
5260 * @post pkgmgrinfo_destroy_pkgdbinfo()
5261 * @see pkgmgrinfo_save_pkgdbinfo()
5262 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5264 static int set_pkg_preload_in_db(const char *pkgid)
5267 pkgmgrinfo_pkgdbinfo_h handle;
5268 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5269 if (ret != PMINFO_R_OK)
5271 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5272 if (ret != PMINFO_R_OK) {
5273 pkgmgrinfo_destroy_pkgdbinfo(handle);
5276 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5277 if (ret != PMINFO_R_OK) {
5278 pkgmgrinfo_destroy_pkgdbinfo(handle);
5281 pkgmgrinfo_destroy_pkgdbinfo(handle);
5286 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5289 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5290 * @brief This API sets the package 'installed_storage' value in db handle
5292 * @par This API is for package-manager client application
5293 * @par Sync (or) Async : Synchronous API
5295 * @param[in] handle pointer to the pkgdbinfo handle.
5296 * @param[in] location installed_storage value
5297 * @return 0 if success, error code(<0) if fail
5298 * @retval PMINFO_R_OK success
5299 * @retval PMINFO_R_EINVAL invalid argument
5300 * @retval PMINFO_R_ERROR internal error
5301 * @pre pkgmgrinfo_create_pkgdbinfo()
5302 * @post pkgmgrinfo_destroy_pkgdbinfo()
5303 * @see pkgmgrinfo_save_pkgdbinfo()
5305 static int set_pkg_installed_storage_in_db(const char *pkgid)
5308 pkgmgrinfo_pkgdbinfo_h handle;
5309 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5310 if (ret != PMINFO_R_OK)
5312 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5313 if (ret != PMINFO_R_OK) {
5314 pkgmgrinfo_destroy_pkgdbinfo(handle);
5317 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5318 if (ret != PMINFO_R_OK) {
5319 pkgmgrinfo_destroy_pkgdbinfo(handle);
5322 pkgmgrinfo_destroy_pkgdbinfo(handle);
5327 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5330 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5331 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5332 * @brief This API saves all the information from the handle to the DB.
5334 * @par This API is for package-manager client application
5335 * @par Sync (or) Async : Synchronous API
5337 * @param[in] handle pointer to the package db info handle.
5338 * @param[in] uid the addressee user id of the instruction
5339 * @return 0 if success, error code(<0) if fail
5340 * @retval PMINFO_R_OK success
5341 * @retval PMINFO_R_EINVAL invalid argument
5342 * @retval PMINFO_R_ERROR internal error
5343 * @pre pkgmgrinfo_create_pkgdbinfo()
5344 * @post pkgmgrinfo_destroy_pkgdbinfo()
5345 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5347 static int set_pkg_in_db(const char *pkgid)
5350 pkgmgrinfo_pkgdbinfo_h handle;
5351 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5352 if (ret != PMINFO_R_OK)
5354 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5355 if (ret != PMINFO_R_OK) {
5356 pkgmgrinfo_destroy_pkgdbinfo(handle);
5359 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5360 if (ret != PMINFO_R_OK) {
5361 pkgmgrinfo_destroy_pkgdbinfo(handle);
5364 pkgmgrinfo_destroy_pkgdbinfo(handle);
5369 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5370 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5372 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5373 * @brief This API destroys the package db information handle freeing up all the resources
5375 * @par This API is for package-manager client application
5376 * @par Sync (or) Async : Synchronous API
5378 * @param[in] handle pointer to the package db info handle.
5379 * @return 0 if success, error code(<0) if fail
5380 * @retval PMINFO_R_OK success
5381 * @retval PMINFO_R_EINVAL invalid argument
5382 * @retval PMINFO_R_ERROR internal error
5383 * @pre pkgmgrinfo_create_pkgdbinfo()
5385 * @see pkgmgrinfo_save_pkgdbinfo()
5386 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5388 static int set_pkg_in_db(const char *pkgid)
5391 pkgmgrinfo_pkgdbinfo_h handle;
5392 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5393 if (ret != PMINFO_R_OK)
5395 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5396 if (ret != PMINFO_R_OK) {
5397 pkgmgrinfo_destroy_pkgdbinfo(handle);
5400 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5401 if (ret != PMINFO_R_OK) {
5402 pkgmgrinfo_destroy_pkgdbinfo(handle);
5405 pkgmgrinfo_destroy_pkgdbinfo(handle);
5410 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5414 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5415 * @brief This API creates the package cert information handle to set data in db.
5417 * @par This API is for package-manager client application
5418 * @par Sync (or) Async : Synchronous API
5420 * @param[out] handle pointer to the package cert handle.
5421 * @return 0 if success, error code(<0) if fail
5422 * @retval PMINFO_R_OK success
5423 * @retval PMINFO_R_EINVAL invalid argument
5424 * @retval PMINFO_R_ERROR internal error
5426 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5427 * @see pkgmgrinfo_set_cert_value()
5428 * @see pkgmgrinfo_save_certinfo()
5430 static int set_cert_in_db(const char *pkgid)
5433 pkgmgrinfo_instcertinfo_h handle;
5434 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5435 if (ret != PMINFO_R_OK)
5437 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5438 if (ret != PMINFO_R_OK) {
5439 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5442 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5443 if (ret != PMINFO_R_OK) {
5444 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5447 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5452 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5455 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5456 * @brief This API sets the package cert information in the handle.
5458 * @par This API is for package-manager client application
5459 * @par Sync (or) Async : Synchronous API
5461 * @param[in] handle pointer to the package cert handle.
5462 * @param[in] cert_type certificate type.
5463 * @param[in] cert_value certificate value.
5464 * @return 0 if success, error code(<0) if fail
5465 * @retval PMINFO_R_OK success
5466 * @retval PMINFO_R_EINVAL invalid argument
5467 * @retval PMINFO_R_ERROR internal error
5468 * @pre pkgmgrinfo_create_certinfo_set_handle()
5469 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5470 * @see pkgmgrinfo_save_certinfo()
5472 static int set_cert_in_db(const char *pkgid)
5475 pkgmgrinfo_instcertinfo_h handle;
5476 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5477 if (ret != PMINFO_R_OK)
5479 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5480 if (ret != PMINFO_R_OK) {
5481 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5484 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5485 if (ret != PMINFO_R_OK) {
5486 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5489 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5494 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5497 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5498 * @brief This API saves the package cert information in the DB.
5500 * @par This API is for package-manager client application
5501 * @par Sync (or) Async : Synchronous API
5503 * @param[in] pkgid pointer to the package ID.
5504 * @param[in] handle pointer to the package cert handle.
5505 * @return 0 if success, error code(<0) if fail
5506 * @retval PMINFO_R_OK success
5507 * @retval PMINFO_R_EINVAL invalid argument
5508 * @retval PMINFO_R_ERROR internal error
5509 * @pre pkgmgrinfo_create_certinfo_set_handle()
5510 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5511 * @see pkgmgrinfo_save_certinfo()
5513 static int set_cert_in_db(const char *pkgid)
5516 pkgmgrinfo_instcertinfo_h handle;
5517 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5518 if (ret != PMINFO_R_OK)
5520 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5521 if (ret != PMINFO_R_OK) {
5522 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5525 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5526 if (ret != PMINFO_R_OK) {
5527 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5530 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5535 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5538 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5539 * @brief This API destroys the package cert information handle freeing up all the resources.
5541 * @par This API is for package-manager client application
5542 * @par Sync (or) Async : Synchronous API
5544 * @param[in] handle pointer to the package cert handle.
5545 * @return 0 if success, error code(<0) if fail
5546 * @retval PMINFO_R_OK success
5547 * @retval PMINFO_R_EINVAL invalid argument
5548 * @retval PMINFO_R_ERROR internal error
5549 * @pre pkgmgrinfo_create_certinfo_set_handle()
5551 * @see pkgmgrinfo_save_certinfo()
5553 static int set_cert_in_db(const char *pkgid)
5556 pkgmgrinfo_instcertinfo_h handle;
5557 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5558 if (ret != PMINFO_R_OK)
5560 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5561 if (ret != PMINFO_R_OK) {
5562 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5565 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5566 if (ret != PMINFO_R_OK) {
5567 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5570 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5575 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5578 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5579 * @brief This API gets the datacontrol info
5581 * @par This API is for package-manager client application
5582 * @par Sync (or) Async : Synchronous API
5584 * @param[in] providerid pointer to the providerid of dataconltrol.
5585 * @param[in] type pointer to the type of dataconltrol.
5586 * @param[out] appid pointer to hold appid, need to free after using
5587 * @param[out] access pointer to hold access, need to free after using
5588 * @return 0 if success, error code(<0) if fail
5589 * @retval PMINFO_R_OK success
5590 * @retval PMINFO_R_EINVAL invalid argument
5591 * @retval PMINFO_R_ERROR internal error
5594 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5597 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5598 * @brief This API gets the application 'guest mode visibility' value from the DB
5600 * @par This API is for package-manager client application
5601 * @par Sync (or) Async : Synchronous API
5603 * @param[in] handle pointer to application info handle
5604 * @param[out] status pointer to hold app guest mode visibility value
5605 * @return 0 if success, error code(<0) if fail
5606 * @retval PMINFO_R_OK success
5607 * @retval PMINFO_R_EINVAL invalid argument
5608 * @retval PMINFO_R_ERROR internal error
5609 * @pre pkgmgrinfo_appinfo_get_appinfo()
5610 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5611 * @see pkgmgrinfo_appinfo_get_appid()
5612 * @see pkgmgrinfo_appinfo_is_multiple()
5614 static int get_app_guestmode_visibility(const char *appid)
5618 pkgmgrinfo_appinfo_h handle;
5619 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5620 if (ret != PMINFO_R_OK)
5622 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5623 if (ret != PMINFO_R_OK) {
5624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5627 printf("app guest mode visibility: %d\n", status);
5628 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5633 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5636 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5637 * @brief This API sets the application 'guest mode visibility' value in the DB
5639 * @par This API is for package-manager client application
5640 * @par Sync (or) Async : Synchronous API
5642 * @param[in] handle pointer to application info handle
5643 * @param[out] status app guest mode visibility value
5644 * @return 0 if success, error code(<0) if fail
5645 * @retval PMINFO_R_OK success
5646 * @retval PMINFO_R_EINVAL invalid argument
5647 * @retval PMINFO_R_ERROR internal error
5648 * @pre pkgmgrinfo_appinfo_get_appinfo()
5649 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5650 * @see pkgmgrinfo_appinfo_get_appid()
5651 * @see pkgmgrinfo_appinfo_is_multiple()
5653 static int set_app_guestmode_visibility(const char *appid, bool value)
5656 pkgmgrinfo_appinfo_h handle;
5657 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5658 if (ret != PMINFO_R_OK)
5660 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5661 if (ret != PMINFO_R_OK) {
5662 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5665 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5670 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5671 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5674 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5675 * @brief This API sets the package 'installed_storage' value in db
5677 * @par This API is for package-manager client application
5678 * @par Sync (or) Async : Synchronous API
5680 * @param[in] pkgid pointer to the package ID.
5681 * @param[in] location package install location
5682 * @return 0 if success, error code(<0) if fail
5683 * @retval PMINFO_R_OK success
5684 * @retval PMINFO_R_EINVAL invalid argument
5685 * @retval PMINFO_R_ERROR internal error
5687 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5691 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5692 if (ret != PMINFO_R_OK) {
5699 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5700 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5703 * @pkgmgrinfo client API
5707 * @brief listening status type in pkgmgrinfo.
5709 #define PMINFO_CLIENT_STATUS_ALL 0x00
5710 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5711 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5712 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5713 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5714 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5715 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5718 * @brief This APIs provides pkgmgrinfo client listener
5720 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5721 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5722 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5723 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5724 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5728 * @pkgmgrinfo client API end
5736 #endif /* __PKG_INFO_H__ */