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"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
113 /** Integer property for filtering based on package info*/
114 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
116 /** String property for filtering based on app info*/
117 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE"
145 /** Integer property for filtering app disabled by user*/
146 #define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE"
148 /** Boolean property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
167 /** will be updated*/
168 /** string property for filtering based on pkg info*/
169 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
171 /* For multiuser support */
172 const char *getIconPath(uid_t uid, bool readonly);
173 const char *getUserPkgParserDBPath(void);
174 const char *getUserPkgParserDBPathUID(uid_t uid);
175 const char *getUserPkgCertDBPath(void);
176 const char *getUserPkgCertDBPathUID(uid_t uid);
177 const char *getUserManifestPath(uid_t uid, bool readonly);
180 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
181 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
182 * @brief This API gets list of installed packages
184 * @par This API is for package-manager client application
185 * @par Sync (or) Async : Synchronous API
186 * @param[in] pkg_list_cb iteration function for list
187 * @param[in] user_data user data to be passed to callback function
188 * @param[in] uid the addressee user id of the instruction
189 * @return 0 if success, error code(<0) if fail
190 * @retval PMINFO_R_OK success
191 * @retval PMINFO_R_EINVAL invalid argument
192 * @retval PMINFO_R_ERROR internal error
196 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
200 pkgid1 = (char *)user_data;
201 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
202 if (strcmp(pkgid1, pkgid2) == 0) {
209 static int list_pkgs()
212 char *name = "helloworld";
213 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
214 if (ret != PMINFO_R_OK) {
221 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
222 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
224 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
225 * @brief This API creates the package information handle from db
227 * @par This API is for package-manager client application
228 * @par Sync (or) Async : Synchronous API
230 * @param[in] pkgid pointer to package ID
231 * @param[in] uid the addressee user id of the instruction
232 * @param[out] handle pointer to the package info handle.
233 * @return 0 if success, error code(<0) if fail
234 * @retval PMINFO_R_OK success
235 * @retval PMINFO_R_EINVAL invalid argument
236 * @retval PMINFO_R_ERROR internal error
238 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
239 * @see pkgmgrinfo_pkginfo_get_pkgid()
240 * @see pkgmgrinfo_pkginfo_is_removable()
242 static int get_pkg_type(const char *pkgid)
246 pkgmgrinfo_pkginfo_h handle;
247 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
248 if (ret != PMINFO_R_OK)
250 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
251 if (ret != PMINFO_R_OK) {
252 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
255 printf("pkgtype: %s\n", type);
256 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
261 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
262 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
265 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
266 * @brief This API gets the package name from the package ID
268 * @par This API is for package-manager client application
269 * @par Sync (or) Async : Synchronous API
271 * @param[in] handle pointer to package info handle
272 * @param[out] pkg_name pointer to hold package name
273 * @return 0 if success, error code(<0) if fail
274 * @retval PMINFO_R_OK success
275 * @retval PMINFO_R_EINVAL invalid argument
276 * @retval PMINFO_R_ERROR internal error
277 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
278 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
279 * @see pkgmgrinfo_pkginfo_get_type()
280 * @see pkgmgrinfo_pkginfo_is_removable()
282 static int get_pkg_name(const char *pkgid)
285 char *pkgname = NULL;
286 pkgmgrinfo_pkginfo_h handle;
287 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
288 if (ret != PMINFO_R_OK)
290 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
291 if (ret != PMINFO_R_OK) {
292 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
295 printf("pkgname: %s\n", pkgname);
296 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
301 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
304 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
305 * @brief This API gets the package id from the package ID
307 * @par This API is for package-manager client application
308 * @par Sync (or) Async : Synchronous API
310 * @param[in] handle pointer to package info handle
311 * @param[out] pkgid pointer to hold package id
312 * @return 0 if success, error code(<0) if fail
313 * @retval PMINFO_R_OK success
314 * @retval PMINFO_R_EINVAL invalid argument
315 * @retval PMINFO_R_ERROR internal error
316 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
317 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
318 * @see pkgmgrinfo_pkginfo_get_type()
319 * @see pkgmgrinfo_pkginfo_is_removable()
321 static int get_pkgid(const char *pkgid)
325 pkgmgrinfo_pkginfo_h handle;
326 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
327 if (ret != PMINFO_R_OK)
329 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
330 if (ret != PMINFO_R_OK) {
331 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
334 printf("pkg id: %s\n", pkg_id);
335 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
340 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
343 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
344 * @brief This API gets the package type from the package ID
346 * @par This API is for package-manager client application
347 * @par Sync (or) Async : Synchronous API
349 * @param[in] handle pointer to package info handle
350 * @param[out] type pointer to hold package type
351 * @return 0 if success, error code(<0) if fail
352 * @retval PMINFO_R_OK success
353 * @retval PMINFO_R_EINVAL invalid argument
354 * @retval PMINFO_R_ERROR internal error
355 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
356 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
357 * @see pkgmgrinfo_pkginfo_get_pkgid()
358 * @see pkgmgrinfo_pkginfo_is_removable()
360 static int get_pkg_type(const char *pkgid)
364 pkgmgrinfo_pkginfo_h handle;
365 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
366 if (ret != PMINFO_R_OK)
368 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
369 if (ret != PMINFO_R_OK) {
370 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
373 printf("pkgtype: %s\n", type);
374 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
379 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
382 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
383 * @brief This API gets the package version from the package ID
385 * @par This API is for package-manager client application
386 * @par Sync (or) Async : Synchronous API
388 * @param[in] handle pointer to package info handle
389 * @param[out] version pointer to hold package version
390 * @return 0 if success, error code(<0) if fail
391 * @retval PMINFO_R_OK success
392 * @retval PMINFO_R_EINVAL invalid argument
393 * @retval PMINFO_R_ERROR internal error
394 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
395 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
396 * @see pkgmgrinfo_pkginfo_get_pkgid()
397 * @see pkgmgrinfo_pkginfo_is_removable()
399 static int get_pkg_version(const char *pkgid)
402 char *version = NULL;
403 pkgmgrinfo_pkginfo_h handle;
404 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
405 if (ret != PMINFO_R_OK)
407 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
408 if (ret != PMINFO_R_OK) {
409 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
412 printf("pkg version: %s\n", version);
413 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
418 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
421 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
422 * @brief This API gets the package api_version from the package ID
424 * @par This API is for package-manager client application
425 * @par Sync (or) Async : Synchronous API
427 * @param[in] handle pointer to package info handle
428 * @param[out] api_version pointer to hold package api_version
429 * @return 0 if success, error code(<0) if fail
430 * @retval PMINFO_R_OK success
431 * @retval PMINFO_R_EINVAL invalid argument
432 * @retval PMINFO_R_ERROR internal error
433 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
434 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
435 * @see pkgmgrinfo_pkginfo_get_pkgid()
436 * @see pkgmgrinfo_pkginfo_is_removable()
438 static int get_pkg_api_version(const char *pkgid)
441 char *api_version = NULL;
442 pkgmgrinfo_pkginfo_h handle = NULL;
443 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
444 if (ret != PMINFO_R_OK)
446 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
447 if (ret != PMINFO_R_OK) {
448 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
451 printf("pkg api_version: %s\n", api_version);
452 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
457 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
460 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
461 * @brief This API gets tep(tizen expansion package) file name associated with the package
463 * @par This API is for package-manager client application
464 * @par Sync (or) Async : Synchronous API
466 * @param[in] handle pointer to the pkginfo handle.
467 * @param[out] tep_name pointer to hold tep name
468 * @return 0 if success, error code(<0) if fail
469 * @retval PMINFO_R_OK success
470 * @retval PMINFO_R_EINVAL invalid argument
471 * @retval PMINFO_R_ERROR internal error
472 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
473 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
474 * @see pkgmgrinfo_pkginfo_get_pkgid()
476 static int get_tep_name(const char *pkgid)
479 char *tep_name = NULL;
480 pkgmgrinfo_pkginfo_h handle = NULL;
481 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
482 if (ret != PMINFO_R_OK)
484 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
485 if (ret != PMINFO_R_OK) {
486 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
489 printf("TEP name is: %s\n", tep_name);
490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
495 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
498 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
499 * @brief This API gets package mount point path associated with the package
500 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
502 * @par This API is for package-manager client application
503 * @par Sync (or) Async : Synchronous API
505 * @param[in] handle pointer to the pkginfo handle.
506 * @param[out] zip_mount_file pointer to hold zip mount file
507 * @return 0 if success, error code(<0) if fail
508 * @retval PMINFO_R_OK success
509 * @retval PMINFO_R_EINVAL invalid argument
510 * @retval PMINFO_R_ERROR internal error
511 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
512 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
513 * @see pkgmgrinfo_pkginfo_get_pkgid()
515 static int get_zip_mount_file(const char *pkgid)
518 char *zip_mount_file = NULL;
519 pkgmgrinfo_pkginfo_h handle = NULL;
520 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
521 if (ret != PMINFO_R_OK)
523 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
524 if (ret != PMINFO_R_OK) {
525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
528 if (zip_mount_file != NULL)
529 printf("Zip mount path is: %s\n", zip_mount_file);
530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
535 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
538 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
539 * @brief This API gets the package install location from the package ID
541 * @par This API is for package-manager client application
542 * @par Sync (or) Async : Synchronous API
544 * @param[in] handle pointer to package info handle
545 * @param[out] location pointer to hold package install location
546 * @return 0 if success, error code(<0) if fail
547 * @retval PMINFO_R_OK success
548 * @retval PMINFO_R_EINVAL invalid argument
549 * @retval PMINFO_R_ERROR internal error
550 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
551 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
552 * @see pkgmgrinfo_pkginfo_get_pkgid()
553 * @see pkgmgrinfo_pkginfo_is_removable()
555 static int get_pkg_install_location(const char *pkgid)
558 pkgmgrinfo_install_location location;
559 pkgmgrinfo_pkginfo_h handle;
560 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
561 if (ret != PMINFO_R_OK)
563 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
564 if (ret != PMINFO_R_OK) {
565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
568 printf("pkg install location: %d\n", location);
569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
574 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
577 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
578 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
579 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
580 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
582 * @par This API is for package-manager client application
583 * @par Sync (or) Async : Synchronous API
585 * @param[in] handle pointer to package info handle
586 * @param[out] size pointer to hold package size
587 * @return 0 if success, error code(<0) if fail
588 * @retval PMINFO_R_OK success
589 * @retval PMINFO_R_EINVAL invalid argument
590 * @retval PMINFO_R_ERROR internal error
591 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
592 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
593 * @see pkgmgrinfo_pkginfo_get_pkgid()
594 * @see pkgmgrinfo_pkginfo_is_removable()
596 static int get_pkg_size(const char *pkgid)
600 pkgmgrinfo_pkginfo_h handle;
601 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
602 if (ret != PMINFO_R_OK)
604 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
605 if (ret != PMINFO_R_OK) {
606 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
609 printf("pkgsize: %d\n", size);
610 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
615 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
618 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
619 * @brief This API gets the package icon from the package ID
621 * @par This API is for package-manager client application
622 * @par Sync (or) Async : Synchronous API
624 * @param[in] handle pointer to package info handle
625 * @param[out] icon pointer to hold package icon
626 * @return 0 if success, error code(<0) if fail
627 * @retval PMINFO_R_OK success
628 * @retval PMINFO_R_EINVAL invalid argument
629 * @retval PMINFO_R_ERROR internal error
630 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
631 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
632 * @see pkgmgrinfo_pkginfo_get_pkgid()
633 * @see pkgmgrinfo_pkginfo_is_removable()
635 static int get_pkg_icon(const char *pkgid)
639 pkgmgrinfo_pkginfo_h handle;
640 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
641 if (ret != PMINFO_R_OK)
643 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
644 if (ret != PMINFO_R_OK) {
645 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
648 printf("pkg icon: %s\n", icon);
649 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
654 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
657 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
658 * @brief This API gets the package label from the package ID
660 * @par This API is for package-manager client application
661 * @par Sync (or) Async : Synchronous API
663 * @param[in] handle pointer to package info handle
664 * @param[out] label pointer to hold package label
665 * @return 0 if success, error code(<0) if fail
666 * @retval PMINFO_R_OK success
667 * @retval PMINFO_R_EINVAL invalid argument
668 * @retval PMINFO_R_ERROR internal error
669 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
670 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
671 * @see pkgmgrinfo_pkginfo_get_pkgid()
672 * @see pkgmgrinfo_pkginfo_is_removable()
674 static int get_pkg_label(const char *pkgid)
678 pkgmgrinfo_pkginfo_h handle;
679 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
680 if (ret != PMINFO_R_OK)
682 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
683 if (ret != PMINFO_R_OK) {
684 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
687 printf("pkg label: %s\n", label);
688 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
693 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
696 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
697 * @brief This API gets the package description from the package ID
699 * @par This API is for package-manager client application
700 * @par Sync (or) Async : Synchronous API
702 * @param[in] handle pointer to package info handle
703 * @param[out] description pointer to hold package description
704 * @return 0 if success, error code(<0) if fail
705 * @retval PMINFO_R_OK success
706 * @retval PMINFO_R_EINVAL invalid argument
707 * @retval PMINFO_R_ERROR internal error
708 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
709 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
710 * @see pkgmgrinfo_pkginfo_get_pkgid()
711 * @see pkgmgrinfo_pkginfo_is_removable()
713 static int get_pkg_description(const char *pkgid)
716 char *description = NULL;
717 pkgmgrinfo_pkginfo_h handle;
718 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
719 if (ret != PMINFO_R_OK)
721 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
722 if (ret != PMINFO_R_OK) {
723 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
726 printf("pkg description: %s\n", description);
727 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
732 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
735 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
736 * @brief This API gets the package's author name from the package ID
738 * @par This API is for package-manager client application
739 * @par Sync (or) Async : Synchronous API
741 * @param[in] handle pointer to package info handle
742 * @param[out] author_name pointer to hold package author name
743 * @return 0 if success, error code(<0) if fail
744 * @retval PMINFO_R_OK success
745 * @retval PMINFO_R_EINVAL invalid argument
746 * @retval PMINFO_R_ERROR internal error
747 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
748 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
749 * @see pkgmgrinfo_pkginfo_get_pkgid()
750 * @see pkgmgrinfo_pkginfo_is_removable()
752 static int get_pkg_author_name(const char *pkgid)
755 char *author_name = NULL;
756 pkgmgrinfo_pkginfo_h handle;
757 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
758 if (ret != PMINFO_R_OK)
760 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
761 if (ret != PMINFO_R_OK) {
762 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
765 printf("pkg author name: %s\n", author_name);
766 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
771 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
774 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
775 * @brief This API gets the package's author email from the package ID
777 * @par This API is for package-manager client application
778 * @par Sync (or) Async : Synchronous API
780 * @param[in] handle pointer to package info handle
781 * @param[out] author_email pointer to hold package author email
782 * @return 0 if success, error code(<0) if fail
783 * @retval PMINFO_R_OK success
784 * @retval PMINFO_R_EINVAL invalid argument
785 * @retval PMINFO_R_ERROR internal error
786 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
787 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
788 * @see pkgmgrinfo_pkginfo_get_pkgid()
789 * @see pkgmgrinfo_pkginfo_is_removable()
791 static int get_pkg_author_email(const char *pkgid)
794 char *author_email = NULL;
795 pkgmgrinfo_pkginfo_h handle;
796 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
797 if (ret != PMINFO_R_OK)
799 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
800 if (ret != PMINFO_R_OK) {
801 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
804 printf("pkg author email: %s\n", author_email);
805 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
810 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
813 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
814 * @brief This API gets the package's author href from the package ID
816 * @par This API is for package-manager client application
817 * @par Sync (or) Async : Synchronous API
819 * @param[in] handle pointer to package info handle
820 * @param[out] author_href pointer to hold package author href
821 * @return 0 if success, error code(<0) if fail
822 * @retval PMINFO_R_OK success
823 * @retval PMINFO_R_EINVAL invalid argument
824 * @retval PMINFO_R_ERROR internal error
825 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
826 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
827 * @see pkgmgrinfo_pkginfo_get_pkgid()
828 * @see pkgmgrinfo_pkginfo_is_removable()
830 static int get_pkg_author_href(const char *pkgid)
833 char *author_href = NULL;
834 pkgmgrinfo_pkginfo_h handle;
835 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
836 if (ret != PMINFO_R_OK)
838 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
839 if (ret != PMINFO_R_OK) {
840 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
843 printf("pkg author href: %s\n", author_href);
844 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
849 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
852 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
853 * @brief This API gets the package installed storagae value from the package ID
855 * @par This API is for package-manager client application
856 * @par Sync (or) Async : Synchronous API
858 * @param[in] handle pointer to package info handle
859 * @param[out] storage pointer to hold package installed storage
860 * @return 0 if success, error code(<0) if fail
861 * @retval PMINFO_R_OK success
862 * @retval PMINFO_R_EINVAL invalid argument
863 * @retval PMINFO_R_ERROR internal error
864 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
865 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
866 * @see pkgmgrinfo_pkginfo_get_pkgid()
867 * @see pkgmgrinfo_pkginfo_is_removable()
869 static int get_pkg_installed_storage(const char *pkgid)
872 pkgmgrinfo_installed_storage storage;
873 pkgmgrinfo_pkginfo_h handle;
874 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
875 if (ret != PMINFO_R_OK)
877 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
878 if (ret != PMINFO_R_OK) {
879 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
882 printf("pkg installed storage: %d\n", storage);
883 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
888 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
891 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
892 * @brief This API gets the installed time of package from the package ID
894 * @par This API is for package-manager client application
895 * @par Sync (or) Async : Synchronous API
897 * @param[in] handle pointer to package info handle
898 * @param[out] installed_time pointer to hold installed time of package
899 * @return 0 if success, error code(<0) if fail
900 * @retval PMINFO_R_OK success
901 * @retval PMINFO_R_EINVAL invalid argument
902 * @retval PMINFO_R_ERROR internal error
903 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
904 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
905 * @see pkgmgrinfo_pkginfo_get_pkgid()
906 * @see pkgmgrinfo_pkginfo_is_removable()
908 static int get_pkg_installed_time(const char *pkgid)
911 int installed_time = 0;
912 pkgmgrinfo_pkginfo_h handle;
913 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
914 if (ret != PMINFO_R_OK)
916 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
917 if (ret != PMINFO_R_OK) {
918 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
921 printf("installed_time: %d\n", installed_time);
922 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
927 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
930 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
931 * @brief This API gets the launch mode of package from the package ID
933 * @par This API is for package-manager client application
934 * @par Sync (or) Async : Synchronous API
936 * @param[in] handle pointer to package info handle
937 * @param[out] mode pointer to hold launch mode of package
938 * @return 0 if success, error code(<0) if fail
939 * @retval PMINFO_R_OK success
940 * @retval PMINFO_R_EINVAL invalid argument
941 * @retval PMINFO_R_ERROR internal error
942 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
943 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
944 * @see pkgmgrinfo_pkginfo_get_pkgid()
945 * @see pkgmgrinfo_pkginfo_is_removable()
947 static int get_pkg_launch_mode(const char *pkgid)
950 char *launch_mode = NULL;
951 pkgmgrinfo_pkginfo_h handle;
952 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
953 if (ret != PMINFO_R_OK)
955 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
956 if (ret != PMINFO_R_OK) {
957 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
960 printf("launch mode: %s\n", mode);
961 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
966 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
969 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
970 * @brief This API gets the store client id of package from the package ID
972 * @par This API is for package-manager client application
973 * @par Sync (or) Async : Synchronous API
975 * @param[in] handle pointer to package info handle
976 * @param[out] storeclientid pointer to hold store client id of package
977 * @return 0 if success, error code(<0) if fail
978 * @retval PMINFO_R_OK success
979 * @retval PMINFO_R_EINVAL invalid argument
980 * @retval PMINFO_R_ERROR internal error
981 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
982 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
983 * @see pkgmgrinfo_pkginfo_get_pkgid()
984 * @see pkgmgrinfo_pkginfo_is_removable()
986 static int get_pkg_storeclientid(const char *pkgid)
989 char *storeclientid = 0;
990 pkgmgrinfo_pkginfo_h handle;
991 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
992 if (ret != PMINFO_R_OK)
994 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
995 if (ret != PMINFO_R_OK) {
996 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
999 printf(store client id: %s\n", storeclientid);
1000 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1005 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1008 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1009 * @brief This API gets the main app id of package from the package ID
1011 * @par This API is for package-manager client application
1012 * @par Sync (or) Async : Synchronous API
1014 * @param[in] handle pointer to package info handle
1015 * @param[out] mainappid pointer to hold main app id of package
1016 * @return 0 if success, error code(<0) if fail
1017 * @retval PMINFO_R_OK success
1018 * @retval PMINFO_R_EINVAL invalid argument
1019 * @retval PMINFO_R_ERROR internal error
1020 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1021 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1022 * @see pkgmgrinfo_pkginfo_get_pkgid()
1023 * @see pkgmgrinfo_pkginfo_is_removable()
1025 static int get_pkg_mainappid(const char *pkgid)
1028 char *mainappid = 0;
1029 pkgmgrinfo_pkginfo_h handle;
1030 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1031 if (ret != PMINFO_R_OK)
1033 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1034 if (ret != PMINFO_R_OK) {
1035 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1038 printf(main app id: %s\n", mainappid);
1039 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1044 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1047 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1048 * @brief This API gets the url of package from the package ID
1050 * @par This API is for package-manager client application
1051 * @par Sync (or) Async : Synchronous API
1053 * @param[in] handle pointer to package info handle
1054 * @param[out] url pointer to hold url of package
1055 * @return 0 if success, error code(<0) if fail
1056 * @retval PMINFO_R_OK success
1057 * @retval PMINFO_R_EINVAL invalid argument
1058 * @retval PMINFO_R_ERROR internal error
1059 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1060 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1061 * @see pkgmgrinfo_pkginfo_get_pkgid()
1062 * @see pkgmgrinfo_pkginfo_is_removable()
1064 static int get_pkg_url(const char *pkgid)
1068 pkgmgrinfo_pkginfo_h handle;
1069 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1070 if (ret != PMINFO_R_OK)
1072 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1073 if (ret != PMINFO_R_OK) {
1074 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1077 printf("url : %s\n", url);
1078 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1083 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1086 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1087 * @brief This API gets the root path of package
1089 * @par Sync (or) Async : Synchronous API
1091 * @param[in] handle pointer to package info handle
1092 * @param[out] path pointer to hold root path of package
1093 * @return 0 if success, error code(<0) if fail
1094 * @retval PMINFO_R_OK success
1095 * @retval PMINFO_R_EINVAL invalid argument
1096 * @retval PMINFO_R_ERROR internal error
1098 static int get_root_path(const char *pkgid)
1102 pkgmgrinfo_pkginfo_h handle;
1103 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1104 if (ret != PMINFO_R_OK)
1107 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1108 if (ret != PMINFO_R_OK) {
1109 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1112 printf("path : %s\n", path);
1113 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1119 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1123 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1124 * @brief This API gets the csc path of package
1126 * @par Sync (or) Async : Synchronous API
1128 * @param[in] handle pointer to package info handle
1129 * @param[out] path pointer to hold csc path of package
1130 * @return 0 if success, error code(<0) if fail
1131 * @retval PMINFO_R_OK success
1132 * @retval PMINFO_R_EINVAL invalid argument
1133 * @retval PMINFO_R_ERROR internal error
1135 static int get_csc_path(const char *pkgid)
1139 pkgmgrinfo_pkginfo_h handle;
1140 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1141 if (ret != PMINFO_R_OK)
1144 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1145 if (ret != PMINFO_R_OK) {
1146 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1149 printf("path : %s\n", path);
1150 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1156 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1159 * @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)
1160 * @brief This API compare the cert information from given package id
1162 * @par This API is for package-manager client application
1163 * @par Sync (or) Async : Synchronous API
1165 * @param[in] lhs_package_id pointer to first package ID
1166 * @param[in] rhs_package_id pointer to second package ID
1167 * @param[out] compare_result pointer to the compare result.
1168 * @return 0 if success, error code(<0) if fail
1169 * @retval PMINFO_R_OK success
1170 * @retval PMINFO_R_EINVAL invalid argument
1171 * @retval PMINFO_R_ERROR internal error
1173 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1174 * @see pkgmgrinfo_pkginfo_get_pkgid()
1175 * @see pkgmgrinfo_pkginfo_is_removable()
1177 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1180 pkgmgrinfo_cert_compare_result_type_e result;
1182 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1183 if (ret != PMINFO_R_OK) {
1186 printf("result: %d\n", result);
1191 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);
1192 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);
1194 * @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)
1195 * @brief This API compare the cert information from given app id
1197 * @par This API is for package-manager client application
1198 * @par Sync (or) Async : Synchronous API
1200 * @param[in] lhs_app_id pointer to first app ID
1201 * @param[in] rhs_app_id pointer to second app ID
1202 * @param[out] compare_result pointer to the compare result.
1203 * @return 0 if success, error code(<0) if fail
1204 * @retval PMINFO_R_OK success
1205 * @retval PMINFO_R_EINVAL invalid argument
1206 * @retval PMINFO_R_ERROR internal error
1208 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1209 * @see pkgmgrinfo_pkginfo_get_pkgid()
1210 * @see pkgmgrinfo_pkginfo_is_removable()
1212 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1215 pkgmgrinfo_cert_compare_result_type_e result;
1217 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1218 if (ret != PMINFO_R_OK) {
1221 printf("result: %d\n", result);
1226 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);
1227 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);
1229 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1230 * @brief This API gets the package 'removable' value from the package ID
1232 * @par This API is for package-manager client application
1233 * @par Sync (or) Async : Synchronous API
1235 * @param[in] handle pointer to package info handle
1236 * @param[out] removable pointer to hold package removable value
1237 * @return 0 if success, error code(<0) if fail
1238 * @retval PMINFO_R_OK success
1239 * @retval PMINFO_R_EINVAL invalid argument
1240 * @retval PMINFO_R_ERROR internal error
1241 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1242 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1243 * @see pkgmgrinfo_pkginfo_get_pkgid()
1244 * @see pkgmgrinfo_pkginfo_is_readonly()
1246 static int get_pkg_removable(const char *pkgid)
1250 pkgmgrinfo_pkginfo_h handle;
1251 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1252 if (ret != PMINFO_R_OK)
1254 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1255 if (ret != PMINFO_R_OK) {
1256 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1259 printf("pkg removable: %d\n", removable);
1260 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1265 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1268 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1269 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1271 * @par This API is for package-manager client application
1272 * @par Sync (or) Async : Synchronous API
1274 * @param[in] handle pointer to package info handle
1275 * @param[out] movable pointer to hold package movable state
1276 * @return 0 if success, error code(<0) if fail
1277 * @retval PMINFO_R_OK success
1278 * @retval PMINFO_R_EINVAL invalid argument
1279 * @retval PMINFO_R_ERROR internal error
1280 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1281 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1282 * @see pkgmgrinfo_pkginfo_get_pkgid()
1284 static int get_pkg_movable(const char *pkgid)
1288 pkgmgrinfo_pkginfo_h handle;
1289 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1290 if (ret != PMINFO_R_OK)
1292 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1293 if (ret != PMINFO_R_OK) {
1294 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1297 printf("pkg movable: %d\n", movable);
1298 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1303 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1306 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1307 * @brief This API gets the package 'preload' value from the package ID
1309 * @par This API is for package-manager client application
1310 * @par Sync (or) Async : Synchronous API
1312 * @param[in] handle pointer to package info handle
1313 * @param[out] preload pointer to hold package preload value
1314 * @return 0 if success, error code(<0) if fail
1315 * @retval PMINFO_R_OK success
1316 * @retval PMINFO_R_EINVAL invalid argument
1317 * @retval PMINFO_R_ERROR internal error
1318 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1319 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1320 * @see pkgmgrinfo_pkginfo_get_pkgid()
1321 * @see pkgmgrinfo_pkginfo_is_readonly()
1323 static int get_pkg_preload(const char *pkgid)
1327 pkgmgrinfo_pkginfo_h handle;
1328 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1329 if (ret != PMINFO_R_OK)
1331 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1332 if (ret != PMINFO_R_OK) {
1333 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1336 printf("pkg preload: %d\n", preload);
1337 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1342 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1345 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1346 * @brief This API gets the value for given handle is system or not
1348 * @par This API is for package-manager client application
1349 * @par Sync (or) Async : Synchronous API
1351 * @param[in] handle pointer to package info handle
1352 * @param[out] system pointer to hold system is or not
1353 * @return 0 if success, error code(<0) if fail
1354 * @retval PMINFO_R_OK success
1355 * @retval PMINFO_R_EINVAL invalid argument
1356 * @retval PMINFO_R_ERROR internal error
1357 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1358 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1359 * @see pkgmgrinfo_pkginfo_get_pkgid()
1360 * @see pkgmgrinfo_pkginfo_is_readonly()
1362 static int get_pkg_system(const char *pkgid)
1365 bool system = false;
1366 pkgmgrinfo_pkginfo_h handle = NULL;
1367 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1368 if (ret != PMINFO_R_OK)
1370 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1371 if (ret != PMINFO_R_OK) {
1372 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1375 printf("pkg system: %d\n", system);
1376 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1381 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1384 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1385 * @brief This API gets the package 'readonly' value from the package ID
1387 * @par This API is for package-manager client application
1388 * @par Sync (or) Async : Synchronous API
1390 * @param[in] handle pointer to package info handle
1391 * @param[out] readonly pointer to hold package readonly value
1392 * @return 0 if success, error code(<0) if fail
1393 * @retval PMINFO_R_OK success
1394 * @retval PMINFO_R_EINVAL invalid argument
1395 * @retval PMINFO_R_ERROR internal error
1396 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1397 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1398 * @see pkgmgrinfo_pkginfo_get_pkgid()
1399 * @see pkgmgrinfo_pkginfo_is_removable()
1401 static int get_pkg_readonly(const char *pkgid)
1405 pkgmgrinfo_pkginfo_h handle;
1406 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1407 if (ret != PMINFO_R_OK)
1409 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1410 if (ret != PMINFO_R_OK) {
1411 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1414 printf("pkg readonly: %d\n", readonly);
1415 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1420 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1424 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1425 * @brief This API gets the package 'upate' value from the package ID
1427 * @par This API is for package-manager client application
1428 * @par Sync (or) Async : Synchronous API
1430 * @param[in] handle pointer to package info handle
1431 * @param[out] update pointer to hold package update value
1432 * @return 0 if success, error code(<0) if fail
1433 * @retval PMINFO_R_OK success
1434 * @retval PMINFO_R_EINVAL invalid argument
1435 * @retval PMINFO_R_ERROR internal error
1436 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1437 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1438 * @see pkgmgrinfo_pkginfo_get_pkgid()
1440 static int get_pkg_update(const char *pkgid)
1444 pkgmgrinfo_pkginfo_h handle;
1445 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1446 if (ret != PMINFO_R_OK)
1448 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1449 if (ret != PMINFO_R_OK) {
1450 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1453 printf("pkg update: %d\n", update);
1454 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1459 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1462 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1463 * @brief This API gets the package 'support_disable' value from the package ID
1465 * @par This API is for package-manager client application
1466 * @par Sync (or) Async : Synchronous API
1468 * @param[in] handle pointer to package info handle
1469 * @param[out] support_disable pointer to hold package support_disable value
1470 * @return 0 if success, error code(<0) if fail
1471 * @retval PMINFO_R_OK success
1472 * @retval PMINFO_R_EINVAL invalid argument
1473 * @retval PMINFO_R_ERROR internal error
1474 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1475 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1476 * @see pkgmgrinfo_pkginfo_get_pkgid()
1478 static int get_pkg_support_disable(const char *pkgid)
1481 bool support_disable;
1482 pkgmgrinfo_pkginfo_h handle = NULL;
1483 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1484 if (ret != PMINFO_R_OK)
1486 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1487 if (ret != PMINFO_R_OK) {
1488 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1491 printf("pkg support_disable: %d\n", support_disable);
1492 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1497 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1500 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1501 * @brief This API gets whethere the given package is global package or user package
1503 * @par This API is for package-manager client application
1504 * @par Sync (or) Async : Synchronous API
1506 * @param[in] handle pointer to package info handle
1507 * @param[in] global pointer to hold package global value
1508 * @return 0 if success, error code(<0) if fail
1509 * @retval PMINFO_R_OK success
1510 * @retval PMINFO_R_EINVAL invalid argument
1511 * @retval PMINFO_R_ERROR internal error
1512 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1513 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1514 * @see pkgmgrinfo_pkginfo_get_pkgid()
1515 static int get_pkg_support_disable(const char *pkgid)
1519 pkgmgrinfo_pkginfo_h handle = NULL;
1520 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1521 if (ret != PMINFO_R_OK)
1523 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1524 if (ret != PMINFO_R_OK) {
1525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1528 printf("pkg is_global: %d\n", global);
1529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1534 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1537 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1538 * @brief This API gets the package 'accessible' value from the package ID
1540 * @par This API is for package-manager client application
1541 * @par Sync (or) Async : Synchronous API
1543 * @param[in] handle pointer to package info handle
1544 * @param[out] accessible pointer to hold package accessible value
1545 * @return 0 if success, error code(<0) if fail
1546 * @retval PMINFO_R_OK success
1547 * @retval PMINFO_R_EINVAL invalid argument
1548 * @retval PMINFO_R_ERROR internal error
1549 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1550 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1551 * @see pkgmgrinfo_pkginfo_get_pkgid()
1552 * @see pkgmgrinfo_pkginfo_is_readonly()
1554 static int get_pkg_accessible(const char *pkgid)
1558 pkgmgrinfo_pkginfo_h handle;
1559 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1560 if (ret != PMINFO_R_OK)
1562 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1563 if (ret != PMINFO_R_OK) {
1564 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1567 printf("pkg accessible: %d\n", accessible);
1568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1573 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1576 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1577 * @brief This API destroys the package information handle freeing up all the resources
1579 * @par This API is for package-manager client application
1580 * @par Sync (or) Async : Synchronous API
1582 * @param[in] handle pointer to the package info handle
1583 * @return 0 if success, error code(<0) if fail
1584 * @retval PMINFO_R_OK success
1585 * @retval PMINFO_R_EINVAL invalid argument
1586 * @retval PMINFO_R_ERROR internal error
1587 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1589 * @see pkgmgrinfo_pkginfo_get_pkgid()
1590 * @see pkgmgrinfo_pkginfo_is_removable()
1592 static int get_pkg_type(const char *pkgid)
1596 pkgmgrinfo_pkginfo_h handle;
1597 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1598 if (ret != PMINFO_R_OK)
1600 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1601 if (ret != PMINFO_R_OK) {
1602 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1605 printf("pkgtype: %s\n", type);
1606 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1614 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1615 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1616 The query will search the entire package information collected from the manifest file of all the installed packages
1618 * @par This API is for package-manager client application
1619 * @par Sync (or) Async : Synchronous API
1621 * @param[out] handle pointer to the package info filter handle.
1622 * @return 0 if success, error code(<0) if fail
1623 * @retval PMINFO_R_OK success
1624 * @retval PMINFO_R_EINVAL invalid argument
1625 * @retval PMINFO_R_ERROR internal error
1627 * @post pkgmgrinfo_pkginfo_filter_destroy()
1628 * @see pkgmgrinfo_pkginfo_filter_count()
1629 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1631 static int get_tpk_pkg_count()
1635 pkgmgrinfo_pkginfo_filter_h handle;
1636 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1637 if (ret != PMINFO_R_OK)
1639 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1640 if (ret != PMINFO_R_OK) {
1641 pkgmgrinfo_pkginfo_filter_destroy(handle);
1644 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1645 if (ret != PMINFO_R_OK) {
1646 pkgmgrinfo_pkginfo_filter_destroy(handle);
1649 printf("No of tpk pkgs: %d\n", count);
1650 pkgmgrinfo_pkginfo_filter_destroy(handle);
1655 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1658 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1659 * @brief This API destroys the package information filter handle freeing up all the resources
1661 * @par This API is for package-manager client application
1662 * @par Sync (or) Async : Synchronous API
1664 * @param[in] handle pointer to the package info filter handle.
1665 * @return 0 if success, error code(<0) if fail
1666 * @retval PMINFO_R_OK success
1667 * @retval PMINFO_R_EINVAL invalid argument
1668 * @retval PMINFO_R_ERROR internal error
1669 * @pre pkgmgrinfo_pkginfo_filter_create()
1671 * @see pkgmgrinfo_pkginfo_filter_count()
1672 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1674 static int get_tpk_pkg_count()
1678 pkgmgrinfo_pkginfo_filter_h handle;
1679 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1680 if (ret != PMINFO_R_OK)
1682 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1683 if (ret != PMINFO_R_OK) {
1684 pkgmgrinfo_pkginfo_filter_destroy(handle);
1687 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1688 if (ret != PMINFO_R_OK) {
1689 pkgmgrinfo_pkginfo_filter_destroy(handle);
1692 printf("No of tpk pkgs: %d\n", count);
1693 pkgmgrinfo_pkginfo_filter_destroy(handle);
1698 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1701 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1702 * @brief This API adds a boolean filter property to the filter handle
1704 * @par This API is for package-manager client application
1705 * @par Sync (or) Async : Synchronous API
1707 * @param[in] handle pointer to the package info filter handle.
1708 * @param[in] property boolean property name.
1709 * @param[in] value value corresponding to the property.
1710 * @return 0 if success, error code(<0) if fail
1711 * @retval PMINFO_R_OK success
1712 * @retval PMINFO_R_EINVAL invalid argument
1713 * @retval PMINFO_R_ERROR internal error
1714 * @pre pkgmgrinfo_pkginfo_filter_create()
1715 * @post pkgmgrinfo_pkginfo_filter_destroy()
1716 * @see pkgmgrinfo_pkginfo_filter_count()
1717 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1719 static int get_preload_pkg_count()
1723 pkgmgrinfo_pkginfo_filter_h handle;
1724 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1725 if (ret != PMINFO_R_OK)
1727 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1728 if (ret != PMINFO_R_OK) {
1729 pkgmgrinfo_pkginfo_filter_destroy(handle);
1732 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1733 if (ret != PMINFO_R_OK) {
1734 pkgmgrinfo_pkginfo_filter_destroy(handle);
1737 printf("No of preload pkgs: %d\n", count);
1738 pkgmgrinfo_pkginfo_filter_destroy(handle);
1743 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1744 const char *property, const bool value);
1747 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1748 * @brief This API adds an integer filter property to the filter handle
1750 * @par This API is for package-manager client application
1751 * @par Sync (or) Async : Synchronous API
1753 * @param[in] handle pointer to the package info filter handle.
1754 * @param[in] property integer property name.
1755 * @param[in] value value corresponding to the property.
1756 * @return 0 if success, error code(<0) if fail
1757 * @retval PMINFO_R_OK success
1758 * @retval PMINFO_R_EINVAL invalid argument
1759 * @retval PMINFO_R_ERROR internal error
1760 * @pre pkgmgrinfo_pkginfo_filter_create()
1761 * @post pkgmgrinfo_pkginfo_filter_destroy()
1762 * @see pkgmgrinfo_pkginfo_filter_count()
1763 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1765 static int get_pkg_count()
1769 pkgmgrinfo_pkginfo_filter_h handle;
1770 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1771 if (ret != PMINFO_R_OK)
1773 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1774 if (ret != PMINFO_R_OK) {
1775 pkgmgrinfo_pkginfo_filter_destroy(handle);
1778 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1779 if (ret != PMINFO_R_OK) {
1780 pkgmgrinfo_pkginfo_filter_destroy(handle);
1783 printf("No of preload pkgs: %d\n", count);
1784 pkgmgrinfo_pkginfo_filter_destroy(handle);
1789 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1790 const char *property, const int value);
1793 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1794 * @brief This API adds a string filter property to the filter handle
1796 * @par This API is for package-manager client application
1797 * @par Sync (or) Async : Synchronous API
1799 * @param[in] handle pointer to the package info filter handle.
1800 * @param[in] property string property name.
1801 * @param[in] value value corresponding to the property.
1802 * @return 0 if success, error code(<0) if fail
1803 * @retval PMINFO_R_OK success
1804 * @retval PMINFO_R_EINVAL invalid argument
1805 * @retval PMINFO_R_ERROR internal error
1806 * @pre pkgmgrinfo_pkginfo_filter_create()
1807 * @post pkgmgrinfo_pkginfo_filter_destroy()
1808 * @see pkgmgrinfo_pkginfo_filter_count()
1809 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1811 static int get_tpk_pkg_count()
1815 pkgmgrinfo_pkginfo_filter_h handle;
1816 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1817 if (ret != PMINFO_R_OK)
1819 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1820 if (ret != PMINFO_R_OK) {
1821 pkgmgrinfo_pkginfo_filter_destroy(handle);
1824 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1825 if (ret != PMINFO_R_OK) {
1826 pkgmgrinfo_pkginfo_filter_destroy(handle);
1829 printf("No of tpk pkgs: %d\n", count);
1830 pkgmgrinfo_pkginfo_filter_destroy(handle);
1835 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1836 const char *property, const char *value);
1839 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1840 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1842 * @par This API is for package-manager client application
1843 * @par Sync (or) Async : Synchronous API
1845 * @param[in] handle pointer to the package info filter handle.
1846 * @param[in] pkg_cb callback function.
1847 * @param[in] user_data user data to be passed to the callback function
1848 * @return 0 if success, error code(<0) if fail
1849 * @retval PMINFO_R_OK success
1850 * @retval PMINFO_R_EINVAL invalid argument
1851 * @retval PMINFO_R_ERROR internal error
1852 * @pre pkgmgrinfo_pkginfo_filter_create()
1853 * @post pkgmgrinfo_pkginfo_filter_destroy()
1854 * @see pkgmgrinfo_pkginfo_filter_count()
1856 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1859 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1860 printf("pkg id : %s\n", pkgid);
1864 static int get_tpk_pkg_list()
1867 pkgmgrinfo_pkginfo_filter_h handle;
1868 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1869 if (ret != PMINFO_R_OK)
1871 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1872 if (ret != PMINFO_R_OK) {
1873 pkgmgrinfo_pkginfo_filter_destroy(handle);
1876 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1877 if (ret != PMINFO_R_OK) {
1878 pkgmgrinfo_pkginfo_filter_destroy(handle);
1881 pkgmgrinfo_pkginfo_filter_destroy(handle);
1886 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1887 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1888 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1889 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1892 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1893 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1894 * @brief This API counts the package that satisfy the filter conditions
1896 * @par This API is for package-manager client application
1897 * @par Sync (or) Async : Synchronous API
1899 * @param[in] handle pointer to the package info filter handle.
1900 * @param[in] count pointer to store the count value.
1901 * @param[in] uid the addressee user id of the instruction
1902 * @return 0 if success, error code(<0) if fail
1903 * @retval PMINFO_R_OK success
1904 * @retval PMINFO_R_EINVAL invalid argument
1905 * @retval PMINFO_R_ERROR internal error
1906 * @pre pkgmgrinfo_pkginfo_filter_create()
1907 * @post pkgmgrinfo_pkginfo_filter_destroy()
1908 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1910 static int get_tpk_pkg_count()
1914 pkgmgrinfo_pkginfo_filter_h handle;
1915 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1916 if (ret != PMINFO_R_OK)
1918 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1919 if (ret != PMINFO_R_OK) {
1920 pkgmgrinfo_pkginfo_filter_destroy(handle);
1923 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1924 if (ret != PMINFO_R_OK) {
1925 pkgmgrinfo_pkginfo_filter_destroy(handle);
1928 printf("No of tpk pkgs: %d\n", count);
1929 pkgmgrinfo_pkginfo_filter_destroy(handle);
1934 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1935 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1937 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1938 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1939 * @brief This API gets the list of privilege for a particular package
1941 * @par This API is for package-manager client application
1942 * @par Sync (or) Async : Synchronous API
1943 * @param[in] handle pointer to the package info handle.
1944 * @param[in] privilege_func callback function for list
1945 * @param[in] user_data user data to be passed to callback function
1946 * @return 0 if success, error code(<0) if fail
1947 * @retval PMINFO_R_OK success
1948 * @retval PMINFO_R_EINVAL invalid argument
1949 * @retval PMINFO_R_ERROR internal error
1950 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1951 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1953 int privilege_func(const char *name, void *user_data)
1955 if (strcmp(name, (char *)user_data) == 0)
1961 static int list_privilege(const char *package, char *privilege)
1964 pkgmgrinfo_pkginfo_h handle;
1965 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1966 if (ret != PMINFO_R_OK)
1968 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1969 if (ret != PMINFO_R_OK) {
1970 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1973 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1978 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1979 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1981 /* TODO: add doxygen comment here */
1982 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1983 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1984 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1985 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1986 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1989 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
1990 * @brief This API copy the application information handle
1992 * @par This API is for package-manager client application
1993 * @par Sync (or) Async : Synchronous API
1995 * @param[in] handle pointer to the package info handle.
1996 * @param[out] handle pointer to the package info handle.
1997 * @return 0 if success, error code(<0) if fail
1998 * @retval PMINFO_R_OK success
1999 * @retval PMINFO_R_EINVAL invalid argument
2000 * @retval PMINFO_R_ERROR internal error
2002 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2004 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2008 pkgmgrinfo_pkginfo_h clone;
2010 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2011 if (ret != PMINFO_R_OK)
2015 printf("package: %s\n", clone->package);
2016 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2021 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2025 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2026 pkgmgrinfo_app_list_cb app_func, void *user_data)
2027 * @brief This API gets list of installed applications for a particular package
2029 * @par This API is for package-manager client application
2030 * @par Sync (or) Async : Synchronous API
2031 * @param[in] handle package info handle
2032 * @param[in] component application component
2033 * @param[in] app_func iteration function for list
2034 * @param[in] user_data user data to be passed to callback function
2035 * @return 0 if success, error code(<0) if fail
2036 * @retval PMINFO_R_OK success
2037 * @retval PMINFO_R_EINVAL invalid argument
2038 * @retval PMINFO_R_ERROR internal error
2039 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2040 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2042 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2045 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2046 printf("appid : %s\n", appid);
2050 static int list_apps(const char *pkgid)
2053 pkgmgrinfo_pkginfo_h handle;
2054 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2055 if (ret != PMINFO_R_OK)
2057 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2058 if (ret != PMINFO_R_OK) {
2059 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2062 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2067 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2068 pkgmgrinfo_app_list_cb app_func, void *user_data);
2069 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2070 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2073 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2074 * @brief This API gets list of installed applications from all packages with minimum informaion.
2076 * @par This API is for package-manager client application
2077 * @par Sync (or) Async : Synchronous API
2078 * @param[in] app_func iteration function for list
2079 * @param[in] user_data user data to be passed to callback function
2080 * @return 0 if success, error code(<0) if fail
2081 * @retval PMINFO_R_OK success
2082 * @retval PMINFO_R_EINVAL invalid argument
2083 * @retval PMINFO_R_ERROR internal error
2087 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2089 char *pkgid1 = NULL;
2090 char *pkgid2 = NULL;
2091 pkgid1 = (char *)user_data;
2092 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2093 if (strcmp(pkgid1, pkgid2) == 0) {
2100 static int list_apps()
2103 char *name = "helloworld";
2104 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2105 if (ret != PMINFO_R_OK) {
2112 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2113 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2116 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2117 * @brief This API gets list of installed applications from all packages.
2119 * @par This API is for package-manager client application
2120 * @par Sync (or) Async : Synchronous API
2121 * @param[in] app_func iteration function for list
2122 * @param[in] user_data user data to be passed to callback function
2123 * @return 0 if success, error code(<0) if fail
2124 * @retval PMINFO_R_OK success
2125 * @retval PMINFO_R_EINVAL invalid argument
2126 * @retval PMINFO_R_ERROR internal error
2130 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2132 char *pkgid1 = NULL;
2133 char *pkgid2 = NULL;
2134 pkgid1 = (char *)user_data;
2135 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2136 if (strcmp(pkgid1, pkgid2) == 0) {
2143 static int list_apps()
2146 char *name = "helloworld";
2147 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2148 if (ret != PMINFO_R_OK) {
2155 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2156 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2159 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2160 * @brief This API creates the disabled application information handle from db
2162 * @par This API is for package-manager client application
2163 * @par Sync (or) Async : Synchronous API
2165 * @param[in] appid pointer to appid
2166 * @param[out] handle pointer to the application info handle.
2167 * @return 0 if success, error code(<0) if fail
2168 * @retval PMINFO_R_OK success
2169 * @retval PMINFO_R_EINVAL invalid argument
2170 * @retval PMINFO_R_ERROR internal error
2172 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2173 * @see pkgmgrinfo_appinfo_get_pkgid()
2174 * @see pkgmgrinfo_appinfo_is_multiple()
2176 static int get_disabled_app_type(const char *appid)
2180 pkgmgrinfo_appinfo_h handle;
2181 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2182 if (ret != PMINFO_R_OK)
2184 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2185 if (ret != PMINFO_R_OK) {
2186 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2189 printf("apptype: %s\n", type);
2190 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2195 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2196 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2199 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2200 * @brief This API creates the application information handle from db
2202 * @par This API is for package-manager client application
2203 * @par Sync (or) Async : Synchronous API
2205 * @param[in] appid pointer to appid
2206 * @param[out] handle pointer to the application info handle.
2207 * @return 0 if success, error code(<0) if fail
2208 * @retval PMINFO_R_OK success
2209 * @retval PMINFO_R_EINVAL invalid argument
2210 * @retval PMINFO_R_ERROR internal error
2212 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2213 * @see pkgmgrinfo_appinfo_get_pkgid()
2214 * @see pkgmgrinfo_appinfo_is_multiple()
2216 static int get_app_type(const char *appid)
2220 pkgmgrinfo_appinfo_h handle;
2221 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2222 if (ret != PMINFO_R_OK)
2224 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2225 if (ret != PMINFO_R_OK) {
2226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2229 printf("apptype: %s\n", type);
2230 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2235 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2236 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2239 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2240 * @brief This API gets the application ID
2242 * @par This API is for package-manager client application
2243 * @par Sync (or) Async : Synchronous API
2245 * @param[in] handle pointer to the application info handle.
2246 * @param[out] appid pointer to hold appid
2247 * @return 0 if success, error code(<0) if fail
2248 * @retval PMINFO_R_OK success
2249 * @retval PMINFO_R_EINVAL invalid argument
2250 * @retval PMINFO_R_ERROR internal error
2251 * @pre pkgmgrinfo_appinfo_get_appinfo()
2252 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2253 * @see pkgmgrinfo_appinfo_get_pkgid()
2254 * @see pkgmgrinfo_appinfo_is_multiple()
2256 static int get_app_id(const char *appid)
2259 char *app_id = NULL;
2260 pkgmgrinfo_appinfo_h handle;
2261 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2262 if (ret != PMINFO_R_OK)
2264 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2265 if (ret != PMINFO_R_OK) {
2266 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2269 printf("app id: %s\n", app_id);
2270 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2275 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2278 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2279 * @brief This API gets the package name of the application
2281 * @par This API is for package-manager client application
2282 * @par Sync (or) Async : Synchronous API
2284 * @param[in] handle pointer to the application info handle.
2285 * @param[out] pkg_name pointer to hold package name
2286 * @return 0 if success, error code(<0) if fail
2287 * @retval PMINFO_R_OK success
2288 * @retval PMINFO_R_EINVAL invalid argument
2289 * @retval PMINFO_R_ERROR internal error
2290 * @pre pkgmgrinfo_appinfo_get_appinfo()
2291 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2292 * @see pkgmgrinfo_appinfo_get_appid()
2293 * @see pkgmgrinfo_appinfo_is_multiple()
2295 static int get_app_pkgname(const char *appid)
2298 char *pkgname = NULL;
2299 pkgmgrinfo_appinfo_h handle;
2300 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2301 if (ret != PMINFO_R_OK)
2303 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2304 if (ret != PMINFO_R_OK) {
2305 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2308 printf("pkg name: %s\n", pkgname);
2309 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2314 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2317 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2318 * @brief This API gets the package id of the application
2320 * @par This API is for package-manager client application
2321 * @par Sync (or) Async : Synchronous API
2323 * @param[in] handle pointer to the application info handle.
2324 * @param[out] pkgid pointer to hold package id
2325 * @return 0 if success, error code(<0) if fail
2326 * @retval PMINFO_R_OK success
2327 * @retval PMINFO_R_EINVAL invalid argument
2328 * @retval PMINFO_R_ERROR internal error
2329 * @pre pkgmgrinfo_appinfo_get_appinfo()
2330 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2331 * @see pkgmgrinfo_appinfo_get_appid()
2332 * @see pkgmgrinfo_appinfo_is_multiple()
2334 static int get_app_pkgid(const char *appid)
2338 pkgmgrinfo_appinfo_h handle;
2339 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2340 if (ret != PMINFO_R_OK)
2342 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2343 if (ret != PMINFO_R_OK) {
2344 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2347 printf("pkg id: %s\n", pkgid);
2348 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2353 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2356 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2357 * @brief This API gets the package type of the application
2359 * @par This API is for package-manager client application
2360 * @par Sync (or) Async : Synchronous API
2362 * @param[in] handle pointer to the application info handle.
2363 * @param[out] pkgtype pointer to hold package type
2364 * @return 0 if success, error code(<0) if fail
2365 * @retval PMINFO_R_OK success
2366 * @retval PMINFO_R_EINVAL invalid argument
2367 * @retval PMINFO_R_ERROR internal error
2368 * @pre pkgmgrinfo_appinfo_get_appinfo()
2369 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2370 * @see pkgmgrinfo_appinfo_get_appid()
2371 * @see pkgmgrinfo_appinfo_is_multiple()
2373 static int get_app_pkgtype(const char *appid)
2376 char *pkgtype = NULL;
2377 pkgmgrinfo_appinfo_h handle = NULL;
2378 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2379 if (ret != PMINFO_R_OK)
2381 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2382 if (ret != PMINFO_R_OK) {
2383 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2386 printf("pkgtype: %s\n", pkgtype);
2387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2392 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2395 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2396 * @brief This API gets the executable name of the application
2398 * @par This API is for package-manager client application
2399 * @par Sync (or) Async : Synchronous API
2401 * @param[in] handle pointer to the application info handle.
2402 * @param[out] exec pointer to hold app exec name
2403 * @return 0 if success, error code(<0) if fail
2404 * @retval PMINFO_R_OK success
2405 * @retval PMINFO_R_EINVAL invalid argument
2406 * @retval PMINFO_R_ERROR internal error
2407 * @pre pkgmgrinfo_appinfo_get_appinfo()
2408 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2409 * @see pkgmgrinfo_appinfo_get_appid()
2410 * @see pkgmgrinfo_appinfo_is_multiple()
2412 static int get_app_exec(const char *appid)
2416 pkgmgrinfo_appinfo_h handle;
2417 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2418 if (ret != PMINFO_R_OK)
2420 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2421 if (ret != PMINFO_R_OK) {
2422 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2425 printf("exec name: %s\n", exec);
2426 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2431 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2434 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2435 * @brief This API gets the icon name of the application
2437 * @par This API is for package-manager client application
2438 * @par Sync (or) Async : Synchronous API
2440 * @param[in] handle pointer to the application info handle.
2441 * @param[out] icon pointer to hold app icon name
2442 * @return 0 if success, error code(<0) if fail
2443 * @retval PMINFO_R_OK success
2444 * @retval PMINFO_R_EINVAL invalid argument
2445 * @retval PMINFO_R_ERROR internal error
2446 * @pre pkgmgrinfo_appinfo_get_appinfo()
2447 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2448 * @see pkgmgrinfo_appinfo_get_appid()
2449 * @see pkgmgrinfo_appinfo_is_multiple()
2451 static int get_app_icon(const char *appid)
2455 pkgmgrinfo_appinfo_h handle;
2456 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2457 if (ret != PMINFO_R_OK)
2459 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2460 if (ret != PMINFO_R_OK) {
2461 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2464 printf("icon name: %s\n", icon);
2465 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2470 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2473 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2474 * @brief This API gets the label of the application
2476 * @par This API is for package-manager client application
2477 * @par Sync (or) Async : Synchronous API
2479 * @param[in] handle pointer to the application info handle.
2480 * @param[out] label pointer to hold app label
2481 * @return 0 if success, error code(<0) if fail
2482 * @retval PMINFO_R_OK success
2483 * @retval PMINFO_R_EINVAL invalid argument
2484 * @retval PMINFO_R_ERROR internal error
2485 * @pre pkgmgrinfo_appinfo_get_appinfo()
2486 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2487 * @see pkgmgrinfo_appinfo_get_appid()
2488 * @see pkgmgrinfo_appinfo_is_multiple()
2490 static int get_app_label(const char *appid)
2494 pkgmgrinfo_appinfo_h handle;
2495 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2496 if (ret != PMINFO_R_OK)
2498 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2499 if (ret != PMINFO_R_OK) {
2500 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2503 printf("label : %s\n", label);
2504 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2509 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2512 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2513 * @brief This API gets exactly matched label by given appid and locale
2515 * @par This API is for package-manager client application
2516 * @par Sync (or) Async : Synchronous API
2518 * @param[in] appid pointer to appid
2519 * @param[in] locale pointer to locale
2520 * @param[out] label pointer to hold app label
2521 * @return 0 if success, error code(<0) if fail
2522 * @retval PMINFO_R_OK success
2523 * @retval PMINFO_R_EINVAL invalid argument
2524 * @retval PMINFO_R_ERROR internal error
2526 static int get_localed_label(const char *appid, const char *locale)
2531 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2532 if (ret != PMINFO_R_OK)
2535 printf("localed label: %s\n", label);
2543 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2544 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2547 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2548 * @brief This API gets metadata value by given metadata key
2550 * @par This API is for package-manager client application
2551 * @par Sync (or) Async : Synchronous API
2553 * @param[in] handle pointer to the application info handle
2554 * @param[in] metadata_key metadata key
2555 * @param[out] metadata_value pointer to hold metadata value
2556 * @return 0 if success, error code(<0) if fail
2557 * @retval PMINFO_R_OK success
2558 * @retval PMINFO_R_EINVAL invalid argument
2560 static int get_metadata_value(const char *appid, const char *metadata_key)
2563 pkgmgrinfo_appinfo_h handle = NULL;
2564 char *metadata_value = NULL;
2566 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2567 if (ret != PMINFO_R_OK)
2570 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2571 if (ret != PMINFO_R_OK) {
2572 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2576 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2581 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2584 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2585 * @brief This API gets the component of the application
2587 * @par This API is for package-manager client application
2588 * @par Sync (or) Async : Synchronous API
2590 * @param[in] handle pointer to the application info handle.
2591 * @param[out] component pointer to hold app component
2592 * @return 0 if success, error code(<0) if fail
2593 * @retval PMINFO_R_OK success
2594 * @retval PMINFO_R_EINVAL invalid argument
2595 * @retval PMINFO_R_ERROR internal error
2596 * @pre pkgmgrinfo_appinfo_get_appinfo()
2597 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2598 * @see pkgmgrinfo_appinfo_get_appid()
2599 * @see pkgmgrinfo_appinfo_is_multiple()
2601 static int get_app_component(const char *appid)
2604 pkgmgrinfo_app_component component;
2605 pkgmgrinfo_appinfo_h handle;
2606 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2607 if (ret != PMINFO_R_OK)
2609 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2610 if (ret != PMINFO_R_OK) {
2611 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2614 printf("component : %s\n", component);
2615 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2620 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2623 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2624 * @brief This API gets the apptype of the application
2626 * @par This API is for package-manager client application
2627 * @par Sync (or) Async : Synchronous API
2629 * @param[in] handle pointer to the application info handle.
2630 * @param[out] app_type pointer to hold apptype
2631 * @return 0 if success, error code(<0) if fail
2632 * @retval PMINFO_R_OK success
2633 * @retval PMINFO_R_EINVAL invalid argument
2634 * @retval PMINFO_R_ERROR internal error
2635 * @pre pkgmgrinfo_appinfo_get_appinfo()
2636 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2637 * @see pkgmgrinfo_appinfo_get_appid()
2638 * @see pkgmgrinfo_appinfo_is_multiple()
2640 static int get_app_type(const char *appid)
2643 char *apptype = NULL;
2644 pkgmgrinfo_appinfo_h handle;
2645 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2646 if (ret != PMINFO_R_OK)
2648 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2649 if (ret != PMINFO_R_OK) {
2650 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2653 printf("apptype : %s\n", apptype);
2654 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2659 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2662 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2663 int *operation_count, char ***operation)
2664 * @brief This API gets the list of operation of the application
2666 * @par This API is for package-manager client application
2667 * @par Sync (or) Async : Synchronous API
2669 * @param[in] handle pointer to the appcontrol handle.
2670 * @param[out] operation_count pointer to hold number of operations
2671 * @param[out] operation pointer to hold list of operations
2672 * @return 0 if success, error code(<0) if fail
2673 * @retval PMINFO_R_OK success
2674 * @retval PMINFO_R_EINVAL invalid argument
2675 * @retval PMINFO_R_ERROR internal error
2676 * @pre pkgmgrinfo_appinfo_get_appinfo()
2677 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2678 * @see pkgmgrinfo_appinfo_get_uri()
2679 * @see pkgmgrinfo_appinfo_get_mime()
2681 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2686 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2687 for (i = 0; i < oc; i++) {
2688 if (strcmp(operation[i], (char *)user_data) == 0)
2695 static int check_operation(const char *appid, char *operation)
2698 pkgmgrinfo_appinfo_h handle;
2699 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2700 if (ret != PMINFO_R_OK)
2702 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2703 if (ret != PMINFO_R_OK) {
2704 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2707 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2712 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2713 int *operation_count, char ***operation);
2716 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2717 int *uri_count, char ***uri)
2718 * @brief This API gets the list of uri of the application
2720 * @par This API is for package-manager client application
2721 * @par Sync (or) Async : Synchronous API
2723 * @param[in] handle pointer to the appcontrol handle.
2724 * @param[out] uri_count pointer to hold number of uris
2725 * @param[out] uri pointer to hold list of uris
2726 * @return 0 if success, error code(<0) if fail
2727 * @retval PMINFO_R_OK success
2728 * @retval PMINFO_R_EINVAL invalid argument
2729 * @retval PMINFO_R_ERROR internal error
2730 * @pre pkgmgrinfo_appinfo_get_appinfo()
2731 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2732 * @see pkgmgrinfo_appinfo_get_operation()
2733 * @see pkgmgrinfo_appinfo_get_mime()
2735 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2740 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2741 for (i = 0; i < uc; i++) {
2742 if (strcmp(uri[i], (char *)user_data) == 0)
2749 static int check_uri(const char *appid, char *uri)
2752 pkgmgrinfo_appinfo_h handle;
2753 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2754 if (ret != PMINFO_R_OK)
2756 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2757 if (ret != PMINFO_R_OK) {
2758 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2761 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2766 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2767 int *uri_count, char ***uri);
2770 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2771 int *mime_count, char ***mime)
2772 * @brief This API gets the list of mime of the application
2774 * @par This API is for package-manager client application
2775 * @par Sync (or) Async : Synchronous API
2777 * @param[in] handle pointer to the appcontrol handle.
2778 * @param[out] mime_count pointer to hold number of mimes
2779 * @param[out] mime pointer to hold list of mimes
2780 * @return 0 if success, error code(<0) if fail
2781 * @retval PMINFO_R_OK success
2782 * @retval PMINFO_R_EINVAL invalid argument
2783 * @retval PMINFO_R_ERROR internal error
2784 * @pre pkgmgrinfo_appinfo_get_appinfo()
2785 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2786 * @see pkgmgrinfo_appinfo_get_uri()
2787 * @see pkgmgrinfo_appinfo_get_operation()
2789 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2794 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2795 for (i = 0; i < mc; i++) {
2796 if (strcmp(mime[i], (char *)user_data) == 0)
2803 static int check_mime(const char *appid, char *mime)
2806 pkgmgrinfo_appinfo_h handle;
2807 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2808 if (ret != PMINFO_R_OK)
2810 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2811 if (ret != PMINFO_R_OK) {
2812 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2815 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2820 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2821 int *mime_count, char ***mime);
2824 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2825 int *subapp_count, char ***subapp)
2826 * @brief This API gets the list of subapp of the application
2828 * @par This API is for package-manager client application
2829 * @par Sync (or) Async : Synchronous API
2831 * @param[in] handle pointer to the appcontrol handle.
2832 * @param[out] subapp_count pointer to hold number of subapp
2833 * @param[out] subapp pointer to hold list of subapp
2834 * @return 0 if success, error code(<0) if fail
2835 * @retval PMINFO_R_OK success
2836 * @retval PMINFO_R_EINVAL invalid argument
2837 * @retval PMINFO_R_ERROR internal error
2838 * @pre pkgmgrinfo_appinfo_get_appinfo()
2839 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2840 * @see pkgmgrinfo_appinfo_get_uri()
2841 * @see pkgmgrinfo_appinfo_get_operation()
2843 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2847 char **subapp = NULL;
2848 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2849 for (i = 0; i < sc; i++) {
2850 if (strcmp(subapp[i], (char *)user_data) == 0)
2857 static int check_subapp(const char *appid, char *subapp)
2860 pkgmgrinfo_appinfo_h handle = NULL;
2861 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2862 if (ret != PMINFO_R_OK)
2864 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2865 if (ret != PMINFO_R_OK) {
2866 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2869 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2874 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2875 int *subapp_count, char ***subapp);
2878 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2879 * @brief This API gets the notification icon of the application
2881 * @par This API is for package-manager client application
2882 * @par Sync (or) Async : Synchronous API
2884 * @param[in] handle pointer to the application info handle.
2885 * @param[out] path pointer to hold notification icon
2886 * @return 0 if success, error code(<0) if fail
2887 * @retval PMINFO_R_OK success
2888 * @retval PMINFO_R_EINVAL invalid argument
2889 * @retval PMINFO_R_ERROR internal error
2890 * @pre pkgmgrinfo_appinfo_get_appinfo()
2891 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2892 * @see pkgmgrinfo_appinfo_get_appid()
2893 * @see pkgmgrinfo_appinfo_is_multiple()
2895 static int get_app_notification_icon(const char *appid)
2898 char *notification_icon = NULL;
2899 pkgmgrinfo_appinfo_h handle;
2900 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2901 if (ret != PMINFO_R_OK)
2903 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2904 if (ret != PMINFO_R_OK) {
2905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2908 printf("notification icon : %s\n", notification_icon);
2909 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2914 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2917 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2918 * @brief This API gets the setting icon of the application
2920 * @par This API is for package-manager client application
2921 * @par Sync (or) Async : Synchronous API
2923 * @param[in] handle pointer to the application info handle.
2924 * @param[out] path pointer to hold setting icon
2925 * @return 0 if success, error code(<0) if fail
2926 * @retval PMINFO_R_OK success
2927 * @retval PMINFO_R_EINVAL invalid argument
2928 * @retval PMINFO_R_ERROR internal error
2929 * @pre pkgmgrinfo_appinfo_get_appinfo()
2930 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2931 * @see pkgmgrinfo_appinfo_get_appid()
2932 * @see pkgmgrinfo_appinfo_is_multiple()
2934 static int get_app_setting_icon(const char *appid)
2937 char *setting_icon = NULL;
2938 pkgmgrinfo_appinfo_h handle;
2939 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2940 if (ret != PMINFO_R_OK)
2942 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2943 if (ret != PMINFO_R_OK) {
2944 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2947 printf("setting icon : %s\n", setting_icon);
2948 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2953 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2956 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2957 * @brief This API gets the type of recent image on app-tray
2959 * @par This API is for package-manager client application
2960 * @par Sync (or) Async : Synchronous API
2962 * @param[in] handle pointer to the application info handle.
2963 * @param[out] type pointer to hold image type
2964 * @return 0 if success, error code(<0) if fail
2965 * @retval PMINFO_R_OK success
2966 * @retval PMINFO_R_EINVAL invalid argument
2967 * @retval PMINFO_R_ERROR internal error
2968 * @pre pkgmgrinfo_appinfo_get_appinfo()
2969 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2970 * @see pkgmgrinfo_appinfo_get_appid()
2971 * @see pkgmgrinfo_appinfo_is_multiple()
2973 static int get_app_recent_image_type(const char *appid)
2976 pkgmgrinfo_app_recentimage type;
2977 pkgmgrinfo_appinfo_h handle;
2978 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2979 if (ret != PMINFO_R_OK)
2981 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2982 if (ret != PMINFO_R_OK) {
2983 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2986 printf("recent image type: %d\n", type);
2987 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2992 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2996 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2997 * @brief This API gets the preview image of application
2999 * @par Sync (or) Async : Synchronous API
3001 * @param[in] handle pointer to the application info handle.
3002 * @param[out] preview_img pointer to hold preview image path
3003 * @return 0 if success, error code(<0) if fail
3004 * @retval PMINFO_R_OK success
3005 * @retval PMINFO_R_EINVAL invalid argument
3006 * @retval PMINFO_R_ERROR internal error
3007 * @pre pkgmgrinfo_appinfo_get_appinfo()
3008 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3009 * @see pkgmgrinfo_appinfo_get_appid()
3011 static int get_app_previewimage(const char *appid)
3014 char *preview = NULL;
3015 pkgmgrinfo_appinfo_h handle = NULL;
3016 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3017 if (ret != PMINFO_R_OK)
3019 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3020 if (ret != PMINFO_R_OK) {
3021 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3024 printf("preview image path : %s\n", preview);
3025 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3030 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3034 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3035 * @brief This API gets the package permission type of the application
3037 * @par This API is for package-manager client application
3038 * @par Sync (or) Async : Synchronous API
3040 * @param[in] handle pointer to the application info handle.
3041 * @param[out] permission pointer to hold package permission
3042 * @return 0 if success, error code(<0) if fail
3043 * @retval PMINFO_R_OK success
3044 * @retval PMINFO_R_EINVAL invalid argument
3045 * @retval PMINFO_R_ERROR internal error
3046 * @pre pkgmgrinfo_appinfo_get_appinfo()
3047 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3048 * @see pkgmgrinfo_appinfo_get_appid()
3050 static int get_app_permission(const char *appid)
3053 pkgmgrinfo_permission_type permission = 0;
3054 pkgmgrinfo_appinfo_h handle;
3056 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3057 if (ret != PMINFO_R_OK)
3059 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3060 if (ret != PMINFO_R_OK) {
3061 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3064 printf("permission type: %d\n", permission);
3065 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3070 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3073 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3074 * @brief This API gets the component_type
3076 * @par This API is for package-manager client application
3077 * @par Sync (or) Async : Synchronous API
3079 * @param[in] handle pointer to the application info handle.
3080 * @param[out] component_type pointer to hold component_type
3081 * @return 0 if success, error code(<0) if fail
3082 * @retval PMINFO_R_OK success
3083 * @retval PMINFO_R_EINVAL invalid argument
3084 * @retval PMINFO_R_ERROR internal error
3085 * @pre pkgmgrinfo_appinfo_get_appinfo()
3086 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3087 * @see pkgmgrinfo_appinfo_get_pkgid()
3088 * @see pkgmgrinfo_appinfo_is_multiple()
3090 static int get_component_type(const char *appid)
3093 char *component_type = NULL;
3094 pkgmgrinfo_appinfo_h handle;
3095 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3096 if (ret != PMINFO_R_OK)
3098 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3099 if (ret != PMINFO_R_OK) {
3100 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3103 printf("component_type: %s\n", component_type);
3104 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3109 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3112 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3113 * @brief This API gets the application 'hwacceleration' value from the app ID
3115 * @par This API is for package-manager client application
3116 * @par Sync (or) Async : Synchronous API
3118 * @param[in] handle pointer to application info handle
3119 * @param[out] hwacceleration pointer to hold package hwacceleration value
3120 * @return 0 if success, error code(<0) if fail
3121 * @retval PMINFO_R_OK success
3122 * @retval PMINFO_R_EINVAL invalid argument
3123 * @retval PMINFO_R_ERROR internal error
3124 * @pre pkgmgrinfo_appinfo_get_appinfo()
3125 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3126 * @see pkgmgrinfo_appinfo_get_appid()
3127 * @see pkgmgrinfo_appinfo_is_multiple()
3129 static int get_app_hwacceleration(const char *appid)
3132 pkgmgrinfo_app_hwacceleration hwacceleration;
3133 pkgmgrinfo_appinfo_h handle;
3134 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3135 if (ret != PMINFO_R_OK)
3137 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3138 if (ret != PMINFO_R_OK) {
3139 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3142 printf("app hwacceleration: %d\n", hwacceleration);
3143 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3148 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3151 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3152 * @brief This API gets the application 'screenreader' value from the app ID
3154 * @par This API is for package-manager client application
3155 * @par Sync (or) Async : Synchronous API
3157 * @param[in] handle pointer to application info handle
3158 * @param[out] screenreader pointer to hold package accessibility value
3159 * @return 0 if success, error code(<0) if fail
3160 * @retval PMINFO_R_OK success
3161 * @retval PMINFO_R_EINVAL invalid argument
3162 * @retval PMINFO_R_ERROR internal error
3163 * @pre pkgmgrinfo_appinfo_get_appinfo()
3164 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3165 * @see pkgmgrinfo_appinfo_get_appid()
3166 * @see pkgmgrinfo_appinfo_is_multiple()
3168 static int get_app_screenreader(const char *appid)
3171 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3172 pkgmgrinfo_appinfo_h handle = NULL;
3173 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3174 if (ret != PMINFO_R_OK)
3176 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3177 if (ret != PMINFO_R_OK) {
3178 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3181 printf("app screenreader: %d\n", screenreader);
3182 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3187 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3190 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3191 * @brief This API gets the application's landscape & portrait effect images
3193 * @par This API is for package-manager client application
3194 * @par Sync (or) Async : Synchronous API
3196 * @param[in] handle pointer to application info handle
3197 * @param[out] portrait_img contains portrait mode effect image
3198 * @param[out] landscape_img contains landscape mode effect image
3199 * @return 0 if success, error code(<0) if fail
3200 * @retval PMINFO_R_OK success
3201 * @retval PMINFO_R_EINVAL invalid argument
3202 * @retval PMINFO_R_ERROR internal error
3203 * @pre pkgmgrinfo_appinfo_get_appinfo()
3204 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3205 * @see pkgmgrinfo_appinfo_get_appid()
3206 * @see pkgmgrinfo_appinfo_is_nodisplay()
3208 static int get_app_effectimages(const char *appid)
3211 char *portraitimg = NULL;
3212 char *landscapeimg = NULL;
3213 pkgmgrinfo_appinfo_h handle;
3214 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3215 if (ret != PMINFO_R_OK)
3217 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3218 if (ret != PMINFO_R_OK) {
3219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3222 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3223 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3228 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3231 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3232 * @brief This API gets the application's effect image type
3234 * @par This API is for package-manager client application
3235 * @par Sync (or) Async : Synchronous API
3237 * @param[in] handle pointer to application info handle
3238 * @param[out] effectimg_type contains effect image type
3239 * @return 0 if success, error code(<0) if fail
3240 * @retval PMINFO_R_OK success
3241 * @retval PMINFO_R_EINVAL invalid argument
3242 * @retval PMINFO_R_ERROR internal error
3243 * @pre pkgmgrinfo_appinfo_get_appinfo()
3244 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3245 * @see pkgmgrinfo_appinfo_get_appid()
3246 * @see pkgmgrinfo_appinfo_is_nodisplay()
3248 static int get_app_effectimage_type(const char *appid)
3251 char *effectimg_type = NULL;
3252 pkgmgrinfo_appinfo_h handle = NULL;
3253 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3254 if (ret != PMINFO_R_OK)
3256 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3257 if (ret != PMINFO_R_OK) {
3258 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3261 printf("app effect image type: %s\n", effectimg_type);
3262 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3267 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3270 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3271 * @brief This API gets the submode_mainid of the application
3273 * @par This API is for package-manager client application
3274 * @par Sync (or) Async : Synchronous API
3276 * @param[in] handle pointer to the application info handle.
3277 * @param[out] submode_mainid pointer to hold package name
3278 * @return 0 if success, error code(<0) if fail
3279 * @retval PMINFO_R_OK success
3280 * @retval PMINFO_R_EINVAL invalid argument
3281 * @retval PMINFO_R_ERROR internal error
3282 * @pre pkgmgrinfo_appinfo_get_appinfo()
3283 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3284 * @see pkgmgrinfo_appinfo_get_appid()
3285 * @see pkgmgrinfo_appinfo_is_multiple()
3287 static int get_app_submode_mainid(const char *appid)
3290 char *submode_mainid = NULL;
3291 pkgmgrinfo_appinfo_h handle = NULL;
3292 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3293 if (ret != PMINFO_R_OK)
3295 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3296 if (ret != PMINFO_R_OK) {
3297 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3300 printf("submode_mainid: %s\n", submode_mainid);
3301 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3306 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3309 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3310 * @brief This API gets the datacontrol info
3312 * @par This API is for package-manager client application
3313 * @par Sync (or) Async : Synchronous API
3315 * @param[in] providerid pointer to the providerid of dataconltrol.
3316 * @param[in] type pointer to the type of dataconltrol.
3317 * @param[out] appid pointer to hold appid, need to free after using
3318 * @param[out] access pointer to hold access, need to free after using
3319 * @return 0 if success, error code(<0) if fail
3320 * @retval PMINFO_R_OK success
3321 * @retval PMINFO_R_EINVAL invalid argument
3322 * @retval PMINFO_R_ERROR internal error
3325 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3326 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3329 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3330 * @brief This API gets the appid of datacontrol
3332 * @par This API is for package-manager client application
3333 * @par Sync (or) Async : Synchronous API
3335 * @param[in] providerid pointer to the providerid of dataconltrol.
3336 * @param[out] appid pointer to hold appid, need to free after using
3337 * @return 0 if success, error code(<0) if fail
3338 * @retval PMINFO_R_OK success
3339 * @retval PMINFO_R_EINVAL invalid argument
3340 * @retval PMINFO_R_ERROR internal error
3343 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3344 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3347 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3348 * @brief This API gets the alias_appid of the application
3350 * @par This API is for package-manager client application
3351 * @par Sync (or) Async : Synchronous API
3353 * @param[in] handle pointer to the application info handle.
3354 * @param[out] alias_appid pointer to hold app alias_appid
3355 * @return 0 if success, error code(<0) if fail
3356 * @retval PMINFO_R_OK success
3357 * @retval PMINFO_R_EINVAL invalid argument
3358 * @retval PMINFO_R_ERROR internal error
3359 * @pre pkgmgrinfo_appinfo_get_appinfo()
3360 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3361 * @see pkgmgrinfo_appinfo_get_appid()
3363 static int get_alias_appid(const char *appid)
3366 char *alias_appid= 0;
3367 pkgmgrinfo_appinfo_h handle = NULL;
3368 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3369 if (ret != PMINFO_R_OK)
3371 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3372 if (ret != PMINFO_R_OK) {
3373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3376 printf("alias_appid: %s\n", alias_appid);
3377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3382 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3385 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3386 * @brief This API gets the effective_appid of the application
3388 * @par This API is for package-manager client application
3389 * @par Sync (or) Async : Synchronous API
3391 * @param[in] handle pointer to the application info handle.
3392 * @param[out] effective_appid pointer to hold app effective_appid
3393 * @return 0 if success, error code(<0) if fail
3394 * @retval PMINFO_R_OK success
3395 * @retval PMINFO_R_EINVAL invalid argument
3396 * @retval PMINFO_R_ERROR internal error
3397 * @pre pkgmgrinfo_appinfo_get_appinfo()
3398 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3399 * @see pkgmgrinfo_appinfo_get_appid()
3401 static int get_effective_appid(const char *appid)
3404 char *effective_appid= 0;
3405 pkgmgrinfo_appinfo_h handle = NULL;
3406 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3407 if (ret != PMINFO_R_OK)
3409 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3410 if (ret != PMINFO_R_OK) {
3411 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3414 printf("effective_appid: %s\n", effective_appid);
3415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3420 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3423 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3424 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3426 * @par This API is for package-manager client application
3427 * @par Sync (or) Async : Synchronous API
3429 * @param[in] handle pointer to the appinfo handle.
3430 * @param[out] tep_name pointer to hold tep name
3431 * @return 0 if success, error code(<0) if fail
3432 * @retval PMINFO_R_OK success
3433 * @retval PMINFO_R_EINVAL invalid argument
3434 * @retval PMINFO_R_ERROR internal error
3435 * @pre pkgmgrinfo_appinfo_get_appinfo()
3436 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3437 * @see pkgmgrinfo_appinfo_get_appid()
3439 static int get_tep_name(const char *appid)
3442 char *tep_name = NULL;
3443 pkgmgrinfo_appinfo_h handle = NULL;
3444 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3445 if (ret != PMINFO_R_OK)
3447 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3448 if (ret != PMINFO_R_OK) {
3449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3452 printf("TEP name is: %s\n", tep_name);
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3458 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3461 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3462 * @brief This API gets zip mount file name associated with the package which contain given application
3463 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3465 * @par This API is for package-manager client application
3466 * @par Sync (or) Async : Synchronous API
3468 * @param[in] handle pointer to the appinfo handle.
3469 * @param[out] zip_mount_file pointer to hold zip mount file name
3470 * @return 0 if success, error code(<0) if fail
3471 * @retval PMINFO_R_OK success
3472 * @retval PMINFO_R_EINVAL invalid argument
3473 * @retval PMINFO_R_ERROR internal error
3474 * @pre pkgmgrinfo_appinfo_get_appinfo()
3475 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3476 * @see pkgmgrinfo_appinfo_get_appid()
3478 static int get_zip_mount_file(const char *appid)
3481 char *zip_mount_file = NULL;
3482 pkgmgrinfo_appinfo_h handle = NULL;
3483 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3484 if (ret != PMINFO_R_OK)
3486 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3487 if (ret != PMINFO_R_OK) {
3488 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3491 printf("Mount file name is: %s\n", zip_mount_file);
3492 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3497 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3500 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3501 * @brief This API gets the root path of application
3503 * @par Sync (or) Async : Synchronous API
3505 * @param[in] handle pointer to appinfo handle
3506 * @param[out] path pointer to hold root path of application
3507 * @return 0 if success, error code(<0) if fail
3508 * @retval PMINFO_R_OK success
3509 * @retval PMINFO_R_EINVAL invalid argument
3510 * @retval PMINFO_R_ERROR internal error
3512 static int get_root_path(const char *appid)
3516 pkgmgrinfo_appinfo_h handle;
3517 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3518 if (ret != PMINFO_R_OK)
3521 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3522 if (ret != PMINFO_R_OK) {
3523 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3526 printf("path : %s\n", path);
3527 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3533 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3536 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3537 * @brief This API gets the application api_version from the application ID
3539 * @par This API is for package-manager client application
3540 * @par Sync (or) Async : Synchronous API
3542 * @param[in] handle pointer to appinfo handle
3543 * @param[out] api_version pointer to hold application api_version
3544 * @return 0 if success, error code(<0) if fail
3545 * @retval PMINFO_R_OK success
3546 * @retval PMINFO_R_EINVAL invalid argument
3547 * @retval PMINFO_R_ERROR internal error
3548 * @pre pkgmgrinfo_appinfo_get_appinfo()
3549 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3550 * @see pkgmgrinfo_appinfo_get_appid()
3552 static int get_app_api_version(const char *appid)
3555 char *api_version = NULL;
3556 pkgmgrinfo_appinfo_h handle = NULL;
3557 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3558 if (ret != PMINFO_R_OK)
3560 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3561 if (ret != PMINFO_R_OK) {
3562 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3565 printf("app api_version: %s\n", api_version);
3566 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3571 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3574 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3575 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3576 * @brief This API gets the list of permission for a particular application
3578 * @par This API is for package-manager client application
3579 * @par Sync (or) Async : Synchronous API
3580 * @param[in] handle pointer to the application info handle.
3581 * @param[in] permission_func callback function for list
3582 * @param[in] user_data user data to be passed to callback function
3583 * @return 0 if success, error code(<0) if fail
3584 * @retval PMINFO_R_OK success
3585 * @retval PMINFO_R_EINVAL invalid argument
3586 * @retval PMINFO_R_ERROR internal error
3587 * @pre pkgmgrinfo_appinfo_get_appinfo()
3588 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3590 int permission_func(const char *name, void *user_data)
3592 if (strcmp(name, (char *)user_data) == 0)
3598 static int list_permission(const char *appid, char *permission)
3601 pkgmgrinfo_appinfo_h handle;
3602 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3603 if (ret != PMINFO_R_OK)
3605 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3606 if (ret != PMINFO_R_OK) {
3607 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3610 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3615 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3616 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3619 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3620 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3621 * @brief This API gets the list of category for a particular application
3623 * @par This API is for package-manager client application
3624 * @par Sync (or) Async : Synchronous API
3625 * @param[in] handle pointer to the application info handle.
3626 * @param[in] category_func callback function for list
3627 * @param[in] user_data user data to be passed to callback function
3628 * @return 0 if success, error code(<0) if fail
3629 * @retval PMINFO_R_OK success
3630 * @retval PMINFO_R_EINVAL invalid argument
3631 * @retval PMINFO_R_ERROR internal error
3632 * @pre pkgmgrinfo_appinfo_get_appinfo()
3633 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3635 int category_func(const char *name, void *user_data)
3637 if (strcmp(name, (char *)user_data) == 0)
3643 static int list_category(const char *appid, char *category)
3646 pkgmgrinfo_appinfo_h handle;
3647 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3648 if (ret != PMINFO_R_OK)
3650 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3651 if (ret != PMINFO_R_OK) {
3652 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3655 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3660 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3661 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3664 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3665 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3666 * @brief This API gets the list of metadata for a particular application
3668 * @par This API is for package-manager client application
3669 * @par Sync (or) Async : Synchronous API
3670 * @param[in] handle pointer to the application info handle.
3671 * @param[in] metadata_func callback function for list
3672 * @param[in] user_data user data to be passed to callback function
3673 * @return 0 if success, error code(<0) if fail
3674 * @retval PMINFO_R_OK success
3675 * @retval PMINFO_R_EINVAL invalid argument
3676 * @retval PMINFO_R_ERROR internal error
3677 * @pre pkgmgrinfo_appinfo_get_appinfo()
3678 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3680 int metadata_func(const char *key, const char *value, void *user_data)
3682 if (strcmp(key, (char *)user_data) == 0) {
3683 printf("Value is %s\n", value);
3690 static int list_metadata(const char *appid, char *key)
3693 pkgmgrinfo_appinfo_h handle;
3694 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3695 if (ret != PMINFO_R_OK)
3697 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3698 if (ret != PMINFO_R_OK) {
3699 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3707 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3708 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3712 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3713 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3714 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3715 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3716 * @brief This API gets the list of app-control for a particular application
3718 * @par This API is for package-manager client application
3719 * @par Sync (or) Async : Synchronous API
3720 * @param[in] handle pointer to the application info handle.
3721 * @param[in] appcontrol_func callback function for list
3722 * @param[in] user_data user data to be passed to callback function
3723 * @param[in] uid the addressee user id of the instruction
3724 * @return 0 if success, error code(<0) if fail
3725 * @retval PMINFO_R_OK success
3726 * @retval PMINFO_R_EINVAL invalid argument
3727 * @retval PMINFO_R_ERROR internal error
3728 * @pre pkgmgrinfo_appinfo_get_appinfo()
3729 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3731 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3736 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3737 for (i = 0; i < oc; i++) {
3738 if (strcmp(operation[i], (char *)user_data) == 0)
3745 static int check_operation(const char *appid, char *operation)
3748 pkgmgrinfo_appinfo_h handle;
3749 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3750 if (ret != PMINFO_R_OK)
3752 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3753 if (ret != PMINFO_R_OK) {
3754 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3757 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3762 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3763 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3768 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3769 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3772 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3773 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3774 * @brief This API gets the list of splashscreen for a particular application
3776 * @par This API is for package-manager client application
3777 * @par Sync (or) Async : Synchronous API
3778 * @param[in] handle pointer to the application info handle.
3779 * @param[in] splash_screen_func callback function for list
3780 * @param[in] user_data user data to be passed to callback function
3781 * @return 0 if success, error code(<0) if fail
3782 * @retval PMINFO_R_OK success
3783 * @retval PMINFO_R_EINVAL invalid argument
3784 * @retval PMINFO_R_ERROR internal error
3785 * @pre pkgmgrinfo_appinfo_get_appinfo()
3786 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3789 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3790 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3793 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3794 * @brief This API gets the application 'nodisplay' value from the app ID
3796 * @par This API is for package-manager client application
3797 * @par Sync (or) Async : Synchronous API
3799 * @param[in] handle pointer to application info handle
3800 * @param[out] nodisplay pointer to hold package nodisplay value
3801 * @return 0 if success, error code(<0) if fail
3802 * @retval PMINFO_R_OK success
3803 * @retval PMINFO_R_EINVAL invalid argument
3804 * @retval PMINFO_R_ERROR internal error
3805 * @pre pkgmgrinfo_appinfo_get_appinfo()
3806 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3807 * @see pkgmgrinfo_appinfo_get_appid()
3808 * @see pkgmgrinfo_appinfo_is_multiple()
3810 static int get_app_nodisplay(const char *appid)
3814 pkgmgrinfo_appinfo_h handle;
3815 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3816 if (ret != PMINFO_R_OK)
3818 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3819 if (ret != PMINFO_R_OK) {
3820 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3823 printf("app nodisplay: %d\n", nodisplay);
3824 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3829 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3832 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3833 * @brief This API gets the application 'multiple' value from the app ID
3835 * @par This API is for package-manager client application
3836 * @par Sync (or) Async : Synchronous API
3838 * @param[in] handle pointer to application info handle
3839 * @param[out] multiple pointer to hold package multiple value
3840 * @return 0 if success, error code(<0) if fail
3841 * @retval PMINFO_R_OK success
3842 * @retval PMINFO_R_EINVAL invalid argument
3843 * @retval PMINFO_R_ERROR internal error
3844 * @pre pkgmgrinfo_appinfo_get_appinfo()
3845 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3846 * @see pkgmgrinfo_appinfo_get_appid()
3847 * @see pkgmgrinfo_appinfo_is_nodisplay()
3849 static int get_app_multiple(const char *appid)
3853 pkgmgrinfo_appinfo_h handle;
3854 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3855 if (ret != PMINFO_R_OK)
3857 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3858 if (ret != PMINFO_R_OK) {
3859 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3862 printf("app multiple: %d\n", multiple);
3863 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3868 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3871 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3872 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3873 * application launching effect. If fales, indicator will be hidden during application launching effect
3875 * @par This API is for package-manager client application
3876 * @par Sync (or) Async : Synchronous API
3878 * @param[in] handle pointer to application info handle
3879 * @param[out] indicator_disp contains indicator display status for application launching effect
3880 * @return 0 if success, error code(<0) if fail
3881 * @retval PMINFO_R_OK success
3882 * @retval PMINFO_R_EINVAL invalid argument
3883 * @retval PMINFO_R_ERROR internal error
3884 * @pre pkgmgrinfo_appinfo_get_appinfo()
3885 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3886 * @see pkgmgrinfo_appinfo_get_appid()
3887 * @see pkgmgrinfo_appinfo_is_nodisplay()
3889 static int get_app_indicator_display(const char *appid)
3892 bool indicator_disp;
3893 pkgmgrinfo_appinfo_h handle;
3894 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3895 if (ret != PMINFO_R_OK)
3897 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3898 if (ret != PMINFO_R_OK){
3899 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3902 printf("app indicator disp : %d\n", indicator_disp);
3903 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3908 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3911 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3912 * @brief This API gets the application 'taskmanage' value from the app ID
3914 * @par This API is for package-manager client application
3915 * @par Sync (or) Async : Synchronous API
3917 * @param[in] handle pointer to application info handle
3918 * @param[out] taskmanage pointer to hold package taskmanage value
3919 * @return 0 if success, error code(<0) if fail
3920 * @retval PMINFO_R_OK success
3921 * @retval PMINFO_R_EINVAL invalid argument
3922 * @retval PMINFO_R_ERROR internal error
3923 * @pre pkgmgrinfo_appinfo_get_appinfo()
3924 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3925 * @see pkgmgrinfo_appinfo_get_appid()
3926 * @see pkgmgrinfo_appinfo_is_multiple()
3928 static int get_app_taskmanage(const char *appid)
3932 pkgmgrinfo_appinfo_h handle;
3933 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3934 if (ret != PMINFO_R_OK)
3936 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3937 if (ret != PMINFO_R_OK) {
3938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3941 printf("app taskmanage: %d\n", taskmanage);
3942 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3947 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3950 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3951 * @brief This API gets the application 'taskmanage' value from the app ID
3953 * @par This API is for package-manager client application
3954 * @par Sync (or) Async : Synchronous API
3956 * @param[in] handle pointer to application info handle
3957 * @param[out] enabled pointer to hold package enabled value
3958 * @return 0 if success, error code(<0) if fail
3959 * @retval PMINFO_R_OK success
3960 * @retval PMINFO_R_EINVAL invalid argument
3961 * @retval PMINFO_R_ERROR internal error
3962 * @pre pkgmgrinfo_appinfo_get_appinfo()
3963 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3964 * @see pkgmgrinfo_appinfo_get_appid()
3965 * @see pkgmgrinfo_appinfo_is_multiple()
3967 static int get_app_enabled(const char *appid)
3971 pkgmgrinfo_appinfo_h handle;
3972 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3973 if (ret != PMINFO_R_OK)
3975 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3976 if (ret != PMINFO_R_OK) {
3977 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3980 printf("app enabled: %d\n", enabled);
3981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3986 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3989 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3990 * @brief This API gets the application 'onboot' value from the app ID
3992 * @par This API is for package-manager client application
3993 * @par Sync (or) Async : Synchronous API
3995 * @param[in] handle pointer to application info handle
3996 * @param[out] onboot pointer to hold package onboot value
3997 * @return 0 if success, error code(<0) if fail
3998 * @retval PMINFO_R_OK success
3999 * @retval PMINFO_R_EINVAL invalid argument
4000 * @retval PMINFO_R_ERROR internal error
4001 * @pre pkgmgrinfo_appinfo_get_appinfo()
4002 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4003 * @see pkgmgrinfo_appinfo_get_appid()
4004 * @see pkgmgrinfo_appinfo_is_multiple()
4006 static int get_app_onboot(const char *appid)
4010 pkgmgrinfo_appinfo_h handle;
4011 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4012 if (ret != PMINFO_R_OK)
4014 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4015 if (ret != PMINFO_R_OK) {
4016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4019 printf("app onboot: %d\n", onboot);
4020 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4025 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4028 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4029 * @brief This API gets the application 'autorestart' value from the app ID
4031 * @par This API is for package-manager client application
4032 * @par Sync (or) Async : Synchronous API
4034 * @param[in] handle pointer to application info handle
4035 * @param[out] autorestart pointer to hold package autorestart value
4036 * @return 0 if success, error code(<0) if fail
4037 * @retval PMINFO_R_OK success
4038 * @retval PMINFO_R_EINVAL invalid argument
4039 * @retval PMINFO_R_ERROR internal error
4040 * @pre pkgmgrinfo_appinfo_get_appinfo()
4041 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4042 * @see pkgmgrinfo_appinfo_get_appid()
4043 * @see pkgmgrinfo_appinfo_is_multiple()
4045 static int get_app_autorestart(const char *appid)
4049 pkgmgrinfo_appinfo_h handle;
4050 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4051 if (ret != PMINFO_R_OK)
4053 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4054 if (ret != PMINFO_R_OK) {
4055 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4058 printf("app autorestart: %d\n", autorestart);
4059 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4064 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4067 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4068 * @brief This API gets the value for given application is main app or not from handle
4070 * @par This API is for package-manager client application
4071 * @par Sync (or) Async : Synchronous API
4073 * @param[in] handle pointer to application info handle
4074 * @param[out] mainapp pointer to hold package mainapp is or not
4075 * @return 0 if success, error code(<0) if fail
4076 * @retval PMINFO_R_OK success
4077 * @retval PMINFO_R_EINVAL invalid argument
4078 * @retval PMINFO_R_ERROR internal error
4079 * @pre pkgmgrinfo_appinfo_get_appinfo()
4080 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4081 * @see pkgmgrinfo_appinfo_get_appid()
4082 * @see pkgmgrinfo_appinfo_is_multiple()
4084 static int get_app_mainapp(const char *appid)
4088 pkgmgrinfo_appinfo_h handle;
4089 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4090 if (ret != PMINFO_R_OK)
4092 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4093 if (ret != PMINFO_R_OK) {
4094 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4097 printf("mainapp: %d\n", mainapp);
4098 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4103 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4107 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4108 * @brief This API gets the value for given application is preload or not from handle
4110 * @par This API is for package-manager client application
4111 * @par Sync (or) Async : Synchronous API
4113 * @param[in] handle pointer to application info handle
4114 * @param[out] preload pointer to hold preload is or not
4115 * @return 0 if success, error code(<0) if fail
4116 * @retval PMINFO_R_OK success
4117 * @retval PMINFO_R_EINVAL invalid argument
4118 * @retval PMINFO_R_ERROR internal error
4119 * @pre pkgmgrinfo_appinfo_get_appinfo()
4120 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4121 * @see pkgmgrinfo_appinfo_get_appid()
4122 * @see pkgmgrinfo_appinfo_is_multiple()
4124 static int get_app_preload(const char *appid)
4128 pkgmgrinfo_appinfo_h handle = NULL;
4129 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4130 if (ret != PMINFO_R_OK)
4132 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4133 if (ret != PMINFO_R_OK) {
4134 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4137 printf("preload: %d\n", preload);
4138 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4143 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4146 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4147 * @brief This API gets the value for given application is submode or not from handle
4149 * @par This API is for package-manager client application
4150 * @par Sync (or) Async : Synchronous API
4152 * @param[in] handle pointer to application info handle
4153 * @param[out] submode pointer to hold submode is or not
4154 * @return 0 if success, error code(<0) if fail
4155 * @retval PMINFO_R_OK success
4156 * @retval PMINFO_R_EINVAL invalid argument
4157 * @retval PMINFO_R_ERROR internal error
4158 * @pre pkgmgrinfo_appinfo_get_appinfo()
4159 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4160 * @see pkgmgrinfo_appinfo_get_appid()
4161 * @see pkgmgrinfo_appinfo_is_multiple()
4163 static int get_app_submode(const char *appid)
4167 pkgmgrinfo_appinfo_h handle = NULL;
4168 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4169 if (ret != PMINFO_R_OK)
4171 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4172 if (ret != PMINFO_R_OK) {
4173 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4176 printf("submode: %d\n", submode);
4177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4182 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4185 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4186 * @brief This API gets the value for given application is process_pool or not from handle
4188 * @par This API is for package-manager client application
4189 * @par Sync (or) Async : Synchronous API
4191 * @param[in] handle pointer to application info handle
4192 * @param[out] process_pool pointer to hold process_pool is or not
4193 * @return 0 if success, error code(<0) if fail
4194 * @retval PMINFO_R_OK success
4195 * @retval PMINFO_R_EINVAL invalid argument
4196 * @retval PMINFO_R_ERROR internal error
4197 * @pre pkgmgrinfo_appinfo_get_appinfo()
4198 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4199 * @see pkgmgrinfo_appinfo_get_appid()
4201 static int get_app_process_pool(const char *appid)
4204 bool process_pool = 0;
4205 pkgmgrinfo_appinfo_h handle = NULL;
4206 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4207 if (ret != PMINFO_R_OK)
4209 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4210 if (ret != PMINFO_R_OK) {
4211 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4214 printf("process_pool: %d\n", process_pool);
4215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4220 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4223 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4224 * @brief This API gets the installed storage location of the application
4226 * @par This API is for package-manager client application
4227 * @par Sync (or) Async : Synchronous API
4229 * @param[in] handle pointer to the application info handle.
4230 * @param[out] app_type pointer to hold installed storage location
4231 * @return 0 if success, error code(<0) if fail
4232 * @retval PMINFO_R_OK success
4233 * @retval PMINFO_R_EINVAL invalid argument
4234 * @retval PMINFO_R_ERROR internal error
4235 * @pre pkgmgrinfo_appinfo_get_appinfo()
4236 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4237 * @see pkgmgrinfo_appinfo_get_appid()
4239 static int get_app_installed_location(const char *appid)
4242 pkgmgrinfo_installed_storage storage;
4243 pkgmgrinfo_appinfo_h handle = NULL;
4244 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4245 if (ret != PMINFO_R_OK)
4247 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4248 if (ret != PMINFO_R_OK) {
4249 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4252 printf("Installed storage location : %d\n", storage);
4253 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4258 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4262 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4263 * @brief This API checks if the application has the given category
4265 * @par This API is for package-manager client application
4266 * @par Sync (or) Async : Synchronous API
4268 * @param[in] handle pointer to the application info handle
4269 * @param[in] category category
4270 * @param[out] exist value Gets whether the application has the given category
4271 * @return 0 if success, error code(<0) if fail
4272 * @retval PMINFO_R_OK success
4273 * @retval PMINFO_R_EINVAL invalid argument
4274 * @retval PMINFO_R_ERROR internal error
4276 static int is_category_exist(const char *appid, const char *category)
4279 pkgmgrinfo_appinfo_h handle;
4282 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4283 if (ret != PMINFO_R_OK)
4286 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4287 if (ret != PMINFO_R_OK) {
4288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4292 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4297 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4300 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4301 * @brief This API gets the application 'ui_gadget' value from the app ID
4303 * @par This API is for package-manager client application
4304 * @par Sync (or) Async : Synchronous API
4306 * @param[in] handle pointer to application info handle
4307 * @param[out] ui_gadget pointer to hold package ui_gadget value
4308 * @return 0 if success, error code(<0) if fail
4309 * @retval PMINFO_R_OK success
4310 * @retval PMINFO_R_EINVAL invalid argument
4311 * @pre pkgmgrinfo_appinfo_get_appinfo()
4312 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4314 static int get_app_ui_gadget(const char *appid)
4318 pkgmgrinfo_appinfo_h handle = NULL;
4319 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4320 if (ret != PMINFO_R_OK)
4322 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4323 if (ret != PMINFO_R_OK) {
4324 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4327 printf("app ui_gadget: %d\n", ui_gadget);
4328 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4333 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4336 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4337 * @brief This API gets the application 'support_disable' value from the app ID
4339 * @par This API is for package-manager client application
4340 * @par Sync (or) Async : Synchronous API
4342 * @param[in] handle pointer to application info handle
4343 * @param[out] support_disable pointer to hold package support_disable value
4344 * @return 0 if success, error code(<0) if fail
4345 * @retval PMINFO_R_OK success
4346 * @retval PMINFO_R_EINVAL invalid argument
4347 * @pre pkgmgrinfo_appinfo_get_appinfo()
4348 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4350 static int get_app_support_disable(const char *appid)
4353 bool support_disable;
4354 pkgmgrinfo_appinfo_h handle = NULL;
4355 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4356 if (ret != PMINFO_R_OK)
4358 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4359 if (ret != PMINFO_R_OK) {
4360 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4363 printf("app support_disable: %d\n", support_disable);
4364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4369 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4372 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4373 * @brief This API gets the application 'is_disable' value from the app ID
4375 * @par This API is for package-manager client application
4376 * @par Sync (or) Async : Synchronous API
4378 * @param[in] handle pointer to application info handle
4379 * @param[out] disabled pointer to hold application is_disabled value
4380 * @return 0 if success, error code(<0) if fail
4381 * @retval PMINFO_R_OK success
4382 * @retval PMINFO_R_EINVAL invalid argument
4383 * @pre pkgmgrinfo_appinfo_get_appinfo()
4384 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4386 static int get_app_is_disable(const char *appid)
4390 pkgmgrinfo_appinfo_h handle = NULL;
4391 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4392 if (ret != PMINFO_R_OK)
4394 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4395 if (ret != PMINFO_R_OK) {
4396 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4399 printf("app is_disable: %d\n", is_disable);
4400 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4405 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4408 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4409 * @brief This API gets whethere the given application is global application or user application
4411 * @par This API is for package-manager client application
4412 * @par Sync (or) Async : Synchronous API
4414 * @param[in] handle pointer to application info handle
4415 * @param[in] global pointer to hold application global value
4416 * @return 0 if success, error code(<0) if fail
4417 * @retval PMINFO_R_OK success
4418 * @retval PMINFO_R_EINVAL invalid argument
4419 * @retval PMINFO_R_ERROR internal error
4420 * @pre pkgmgrinfo_appinfo_get_appinfo()
4421 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4422 * @see pkgmgrinfo_appinfo_get_appid()
4423 static int get_app_is_global(const char *appid)
4427 pkgmgrinfo_appinfo_h handle = NULL;
4428 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4429 if (ret != PMINFO_R_OK)
4431 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4432 if (ret != PMINFO_R_OK) {
4433 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4436 printf("app is_global: %d\n", global);
4437 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4442 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4445 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4446 * @brief This API gets the application 'splash_screen_display' value from the app ID
4448 * @par This API is for package-manager client application
4449 * @par Sync (or) Async : Synchronous API
4451 * @param[in] handle pointer to application info handle
4452 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4453 * @return 0 if success, error code(<0) if fail
4454 * @retval PMINFO_R_OK success
4455 * @retval PMINFO_R_EINVAL invalid argument
4456 * @retval PMINFO_R_ERROR internal error
4458 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4461 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4462 * @brief This API destroys the application information handle freeing up all the resources
4464 * @par This API is for package-manager client application
4465 * @par Sync (or) Async : Synchronous API
4467 * @param[in] handle pointer to the application info handle.
4468 * @return 0 if success, error code(<0) if fail
4469 * @retval PMINFO_R_OK success
4470 * @retval PMINFO_R_EINVAL invalid argument
4471 * @retval PMINFO_R_ERROR internal error
4472 * @pre pkgmgrinfo_appinfo_get_appinfo()
4474 * @see pkgmgrinfo_appinfo_get_pkgid()
4475 * @see pkgmgrinfo_appinfo_is_multiple()
4477 static int get_app_type(const char *appid)
4481 pkgmgrinfo_appinfo_h handle;
4482 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4483 if (ret != PMINFO_R_OK)
4485 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4486 if (ret != PMINFO_R_OK) {
4487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4490 printf("apptype: %s\n", type);
4491 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4496 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4499 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4500 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4501 The query will search the entire application information collected from the manifest file of all the installed packages
4503 * @par This API is for package-manager client application
4504 * @par Sync (or) Async : Synchronous API
4506 * @param[out] handle pointer to the application info filter handle.
4507 * @return 0 if success, error code(<0) if fail
4508 * @retval PMINFO_R_OK success
4509 * @retval PMINFO_R_EINVAL invalid argument
4510 * @retval PMINFO_R_ERROR internal error
4512 * @post pkgmgrinfo_appinfo_filter_destroy()
4513 * @see pkgmgrinfo_appinfo_filter_count()
4514 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4516 static int get_capp_count()
4520 pkgmgrinfo_appinfo_filter_h handle;
4521 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4522 if (ret != PMINFO_R_OK)
4524 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4525 if (ret != PMINFO_R_OK) {
4526 pkgmgrinfo_appinfo_filter_destroy(handle);
4529 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4530 if (ret != PMINFO_R_OK) {
4531 pkgmgrinfo_appinfo_filter_destroy(handle);
4534 printf("No of capp: %d\n", count);
4535 pkgmgrinfo_appinfo_filter_destroy(handle);
4540 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4543 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4544 * @brief This API destroys the application information filter handle freeing up all the resources
4546 * @par This API is for package-manager client application
4547 * @par Sync (or) Async : Synchronous API
4549 * @param[in] handle pointer to the application info filter handle.
4550 * @return 0 if success, error code(<0) if fail
4551 * @retval PMINFO_R_OK success
4552 * @retval PMINFO_R_EINVAL invalid argument
4553 * @retval PMINFO_R_ERROR internal error
4554 * @pre pkgmgrinfo_appinfo_filter_create()
4556 * @see pkgmgrinfo_appinfo_filter_count()
4557 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4559 static int get_capp_count()
4563 pkgmgrinfo_appinfo_filter_h handle;
4564 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4565 if (ret != PMINFO_R_OK)
4567 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4568 if (ret != PMINFO_R_OK) {
4569 pkgmgrinfo_appinfo_filter_destroy(handle);
4572 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4573 if (ret != PMINFO_R_OK) {
4574 pkgmgrinfo_appinfo_filter_destroy(handle);
4577 printf("No of capp: %d\n", count);
4578 pkgmgrinfo_appinfo_filter_destroy(handle);
4583 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4586 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4587 * @brief This API adds a boolean filter property to the filter handle
4589 * @par This API is for package-manager client application
4590 * @par Sync (or) Async : Synchronous API
4592 * @param[in] handle pointer to the application info filter handle.
4593 * @param[in] property boolean property name.
4594 * @param[in] value value corresponding to the property.
4595 * @return 0 if success, error code(<0) if fail
4596 * @retval PMINFO_R_OK success
4597 * @retval PMINFO_R_EINVAL invalid argument
4598 * @retval PMINFO_R_ERROR internal error
4599 * @pre pkgmgrinfo_appinfo_filter_create()
4600 * @post pkgmgrinfo_appinfo_filter_destroy()
4601 * @see pkgmgrinfo_appinfo_filter_count()
4602 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4604 static int get_taskmanageable_app_count()
4608 pkgmgrinfo_appinfo_filter_h handle;
4609 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4610 if (ret != PMINFO_R_OK)
4612 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4613 if (ret != PMINFO_R_OK) {
4614 pkgmgrinfo_appinfo_filter_destroy(handle);
4617 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4618 if (ret != PMINFO_R_OK) {
4619 pkgmgrinfo_appinfo_filter_destroy(handle);
4622 printf("No of taskmanageable apps: %d\n", count);
4623 pkgmgrinfo_appinfo_filter_destroy(handle);
4628 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4629 const char *property, const bool value);
4632 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4633 * @brief This API adds an integer filter property to the filter handle
4635 * @par This API is for package-manager client application
4636 * @par Sync (or) Async : Synchronous API
4638 * @param[in] handle pointer to the application info filter handle.
4639 * @param[in] property integer property name.
4640 * @param[in] value value corresponding to the property.
4641 * @return 0 if success, error code(<0) if fail
4642 * @retval PMINFO_R_OK success
4643 * @retval PMINFO_R_EINVAL invalid argument
4644 * @retval PMINFO_R_ERROR internal error
4645 * @pre pkgmgrinfo_appinfo_filter_create()
4646 * @post pkgmgrinfo_appinfo_filter_destroy()
4647 * @see pkgmgrinfo_appinfo_filter_count()
4648 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4650 static int get_taskmanageable_app_count()
4654 pkgmgrinfo_appinfo_filter_h handle;
4655 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4656 if (ret != PMINFO_R_OK)
4658 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4659 if (ret != PMINFO_R_OK) {
4660 pkgmgrinfo_appinfo_filter_destroy(handle);
4663 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4664 if (ret != PMINFO_R_OK) {
4665 pkgmgrinfo_appinfo_filter_destroy(handle);
4668 printf("No of apps: %d\n", count);
4669 pkgmgrinfo_appinfo_filter_destroy(handle);
4674 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4675 const char *property, const int value);
4678 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4679 * @brief This API adds a string filter property to the filter handle
4681 * @par This API is for package-manager client application
4682 * @par Sync (or) Async : Synchronous API
4684 * @param[in] handle pointer to the application info filter handle.
4685 * @param[in] property string property name.
4686 * @param[in] value value corresponding to the property.
4687 * @return 0 if success, error code(<0) if fail
4688 * @retval PMINFO_R_OK success
4689 * @retval PMINFO_R_EINVAL invalid argument
4690 * @retval PMINFO_R_ERROR internal error
4691 * @pre pkgmgrinfo_appinfo_filter_create()
4692 * @post pkgmgrinfo_appinfo_filter_destroy()
4693 * @see pkgmgrinfo_appinfo_filter_count()
4694 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4696 static int get_capp_count()
4700 pkgmgrinfo_appinfo_filter_h handle;
4701 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4702 if (ret != PMINFO_R_OK)
4704 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4705 if (ret != PMINFO_R_OK) {
4706 pkgmgrinfo_appinfo_filter_destroy(handle);
4709 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4710 if (ret != PMINFO_R_OK) {
4711 pkgmgrinfo_appinfo_filter_destroy(handle);
4714 printf("No of capp: %d\n", count);
4715 pkgmgrinfo_appinfo_filter_destroy(handle);
4720 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4721 const char *property, const char *value);
4724 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4725 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4727 * @par This API is for package-manager client application
4728 * @par Sync (or) Async : Synchronous API
4730 * @param[in] handle pointer to the application info filter handle.
4731 * @param[in] app_cb callback function.
4732 * @param[in] user_data user data to be passed to the callback function
4733 * @return 0 if success, error code(<0) if fail
4734 * @retval PMINFO_R_OK success
4735 * @retval PMINFO_R_EINVAL invalid argument
4736 * @retval PMINFO_R_ERROR internal error
4737 * @pre pkgmgrinfo_appinfo_filter_create()
4738 * @post pkgmgrinfo_appinfo_filter_destroy()
4739 * @see pkgmgrinfo_appinfo_filter_count()
4741 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4744 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4745 printf("appid : %s\n", appid);
4749 static int get_capp_list()
4752 pkgmgrinfo_appinfo_filter_h handle;
4753 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4754 if (ret != PMINFO_R_OK)
4756 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4757 if (ret != PMINFO_R_OK) {
4758 pkgmgrinfo_appinfo_filter_destroy(handle);
4761 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4762 if (ret != PMINFO_R_OK) {
4763 pkgmgrinfo_appinfo_filter_destroy(handle);
4766 pkgmgrinfo_appinfo_filter_destroy(handle);
4771 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4772 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4773 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4774 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4777 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4778 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4779 * @brief This API counts the application that satisfy the filter conditions
4781 * @par This API is for package-manager client application
4782 * @par Sync (or) Async : Synchronous API
4784 * @param[in] handle pointer to the application info filter handle.
4785 * @param[in] count pointer to store count value
4786 * @param[in] uid the addressee user id of the instruction
4787 * @return 0 if success, error code(<0) if fail
4788 * @retval PMINFO_R_OK success
4789 * @retval PMINFO_R_EINVAL invalid argument
4790 * @retval PMINFO_R_ERROR internal error
4791 * @pre pkgmgrinfo_appinfo_filter_create()
4792 * @post pkgmgrinfo_appinfo_filter_destroy()
4793 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4795 static int get_capp_count()
4799 pkgmgrinfo_appinfo_filter_h handle;
4800 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4801 if (ret != PMINFO_R_OK)
4803 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4804 if (ret != PMINFO_R_OK) {
4805 pkgmgrinfo_appinfo_filter_destroy(handle);
4808 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4809 if (ret != PMINFO_R_OK) {
4810 pkgmgrinfo_appinfo_filter_destroy(handle);
4813 printf("No of capp: %d\n", count);
4814 pkgmgrinfo_appinfo_filter_destroy(handle);
4819 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4820 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4822 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4823 * @brief This API creates the application's metadata information filter handle from db.
4825 * @par This API is for package-manager client application
4826 * @par Sync (or) Async : Synchronous API
4828 * @param[out] handle pointer to the application metadata info filter handle.
4829 * @return 0 if success, error code(<0) if fail
4830 * @retval PMINFO_R_OK success
4831 * @retval PMINFO_R_EINVAL invalid argument
4832 * @retval PMINFO_R_ERROR internal error
4834 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4835 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4837 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4840 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4841 printf("appid : %s\n", appid);
4845 static int get_app_list(const char *mkey, const char *mvalue)
4848 pkgmgrinfo_appinfo_metadata_filter_h handle;
4849 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4850 if (ret != PMINFO_R_OK)
4852 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4853 if (ret != PMINFO_R_OK) {
4854 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4857 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4858 if (ret != PMINFO_R_OK) {
4859 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4862 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4867 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4870 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4871 * @brief This API destroys the application's metadata information filter handle.
4873 * @par This API is for package-manager client application
4874 * @par Sync (or) Async : Synchronous API
4876 * @param[in] handle pointer to the application metadata info filter handle.
4877 * @return 0 if success, error code(<0) if fail
4878 * @retval PMINFO_R_OK success
4879 * @retval PMINFO_R_EINVAL invalid argument
4880 * @retval PMINFO_R_ERROR internal error
4881 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4883 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4885 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4888 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4889 printf("appid : %s\n", appid);
4893 static int get_app_list(const char *mkey, const char *mvalue)
4896 pkgmgrinfo_appinfo_metadata_filter_h handle;
4897 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4898 if (ret != PMINFO_R_OK)
4900 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4901 if (ret != PMINFO_R_OK) {
4902 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4905 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4906 if (ret != PMINFO_R_OK) {
4907 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4910 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4915 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4918 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4919 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4920 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4922 * @par This API is for package-manager client application
4923 * @par Sync (or) Async : Synchronous API
4925 * @param[in] handle pointer to the application metadata info filter handle.
4926 * @param[in] key pointer to metadata key
4927 * @param[in] value pointer to metadata value
4928 * @return 0 if success, error code(<0) if fail
4929 * @retval PMINFO_R_OK success
4930 * @retval PMINFO_R_EINVAL invalid argument
4931 * @retval PMINFO_R_ERROR internal error
4932 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4933 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4934 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4936 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4939 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4940 printf("appid : %s\n", appid);
4944 static int get_app_list(const char *mkey, const char *mvalue)
4947 pkgmgrinfo_appinfo_metadata_filter_h handle;
4948 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4949 if (ret != PMINFO_R_OK)
4951 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4952 if (ret != PMINFO_R_OK) {
4953 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4956 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4957 if (ret != PMINFO_R_OK) {
4958 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4961 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4966 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4967 const char *key, const char *value);
4970 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4971 * @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)
4972 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4973 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4974 * negative value, no more callbacks will be called and API will return.
4976 * @par This API is for package-manager client application
4977 * @par Sync (or) Async : Synchronous API
4979 * @param[in] handle pointer to the application metadata info filter handle.
4980 * @param[in] app_cb function pointer to callback
4981 * @param[in] user_data pointer to user data
4982 * @param[in] uid the addressee user id of the instruction
4983 * @return 0 if success, error code(<0) if fail
4984 * @retval PMINFO_R_OK success
4985 * @retval PMINFO_R_EINVAL invalid argument
4986 * @retval PMINFO_R_ERROR internal error
4987 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4988 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4990 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4993 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4994 printf("appid : %s\n", appid);
4998 static int get_app_list(const char *mkey, const char *mvalue)
5001 pkgmgrinfo_appinfo_metadata_filter_h handle;
5002 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5003 if (ret != PMINFO_R_OK)
5005 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5006 if (ret != PMINFO_R_OK) {
5007 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5010 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5011 if (ret != PMINFO_R_OK) {
5012 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5015 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5020 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5021 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5022 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5023 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5025 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5026 * @brief This API creates the package cert information handle to get data from db.
5028 * @par This API is for package-manager client application
5029 * @par Sync (or) Async : Synchronous API
5031 * @param[out] handle pointer to the package cert handle.
5032 * @return 0 if success, error code(<0) if fail
5033 * @retval PMINFO_R_OK success
5034 * @retval PMINFO_R_EINVAL invalid argument
5035 * @retval PMINFO_R_ERROR internal error
5037 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5038 * @see pkgmgrinfo_pkginfo_get_cert_value()
5039 * @see pkgmgrinfo_pkginfo_load_certinfo()
5041 static int get_cert_info(const char *pkgid)
5044 pkgmgrinfo_certinfo_h handle;
5045 char *auth_cert = NULL;
5046 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5047 if (ret != PMINFO_R_OK)
5049 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5050 if (ret != PMINFO_R_OK) {
5051 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5054 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5055 if (ret != PMINFO_R_OK) {
5056 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5059 printf("Author root certificate: %s\n", auth_root);
5060 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5065 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5068 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5069 * @brief This API loads the package cert information handle with data from db.
5071 * @par This API is for package-manager client application
5072 * @par Sync (or) Async : Synchronous API
5074 * @param[in] pkgid pointer to the package ID.
5075 * @param[in] handle pointer to the package cert handle.
5076 * @return 0 if success, error code(<0) if fail
5077 * @retval PMINFO_R_OK success
5078 * @retval PMINFO_R_EINVAL invalid argument
5079 * @retval PMINFO_R_ERROR internal error
5080 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5081 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5082 * @see pkgmgrinfo_pkginfo_get_cert_value()
5084 static int get_cert_info(const char *pkgid)
5087 pkgmgrinfo_certinfo_h handle;
5088 char *auth_cert = NULL;
5089 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5090 if (ret != PMINFO_R_OK)
5092 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5093 if (ret != PMINFO_R_OK) {
5094 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5097 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5098 if (ret != PMINFO_R_OK) {
5099 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5102 printf("Author root certificate: %s\n", auth_root);
5103 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5108 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5111 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5112 * @brief This API gets the package cert information from the handle
5114 * @par This API is for package-manager client application
5115 * @par Sync (or) Async : Synchronous API
5117 * @param[in] handle pointer to the package cert handle.
5118 * @param[in] cert_type certificate type
5119 * @param[out] cert_value pointer to hold certificate value
5120 * @return 0 if success, error code(<0) if fail
5121 * @retval PMINFO_R_OK success
5122 * @retval PMINFO_R_EINVAL invalid argument
5123 * @retval PMINFO_R_ERROR internal error
5124 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5125 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5126 * @see pkgmgrinfo_pkginfo_load_certinfo()
5128 static int get_cert_info(const char *pkgid)
5131 pkgmgrinfo_certinfo_h handle;
5132 char *auth_cert = NULL;
5133 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5134 if (ret != PMINFO_R_OK)
5136 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5137 if (ret != PMINFO_R_OK) {
5138 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5141 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5142 if (ret != PMINFO_R_OK) {
5143 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5146 printf("Author root certificate: %s\n", auth_root);
5147 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5152 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5155 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5156 * @brief This API destroys the package cert information handle freeing up all the resources
5158 * @par This API is for package-manager client application
5159 * @par Sync (or) Async : Synchronous API
5161 * @param[in] handle pointer to the package cert handle.
5162 * @return 0 if success, error code(<0) if fail
5163 * @retval PMINFO_R_OK success
5164 * @retval PMINFO_R_EINVAL invalid argument
5165 * @retval PMINFO_R_ERROR internal error
5166 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5168 * @see pkgmgrinfo_pkginfo_load_certinfo()
5170 static int get_cert_info(const char *pkgid)
5173 pkgmgrinfo_certinfo_h handle;
5174 char *auth_cert = NULL;
5175 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5176 if (ret != PMINFO_R_OK)
5178 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5179 if (ret != PMINFO_R_OK) {
5180 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5183 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5184 if (ret != PMINFO_R_OK) {
5185 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5188 printf("Author root certificate: %s\n", auth_root);
5189 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5194 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5197 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5198 * @brief This API deletes the package cert information from DB
5200 * @par This API is for package-manager client application
5201 * @par Sync (or) Async : Synchronous API
5203 * @param[in] pkgid pointer to the package ID.
5204 * @return 0 if success, error code(<0) if fail
5205 * @retval PMINFO_R_OK success
5206 * @retval PMINFO_R_EINVAL invalid argument
5207 * @retval PMINFO_R_ERROR internal error
5211 static int delete_cert_info(const char *pkgid)
5214 ret = pkgmgrinfo_delete_certinfo(pkgid);
5215 if (ret != PMINFO_R_OK)
5221 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5222 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5225 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5226 * @brief This API creates the package cert information handle to set data in db.
5228 * @par This API is for package-manager client application
5229 * @par Sync (or) Async : Synchronous API
5231 * @param[out] handle pointer to the package cert handle.
5232 * @return 0 if success, error code(<0) if fail
5233 * @retval PMINFO_R_OK success
5234 * @retval PMINFO_R_EINVAL invalid argument
5235 * @retval PMINFO_R_ERROR internal error
5237 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5238 * @see pkgmgrinfo_set_cert_value()
5239 * @see pkgmgrinfo_save_certinfo()
5241 static int set_cert_in_db(const char *pkgid)
5244 pkgmgrinfo_instcertinfo_h handle;
5245 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5246 if (ret != PMINFO_R_OK)
5248 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5249 if (ret != PMINFO_R_OK) {
5250 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5253 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5254 if (ret != PMINFO_R_OK) {
5255 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5258 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5263 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5266 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5267 * @brief This API sets the package cert information in the handle.
5269 * @par This API is for package-manager client application
5270 * @par Sync (or) Async : Synchronous API
5272 * @param[in] handle pointer to the package cert handle.
5273 * @param[in] cert_type certificate type.
5274 * @param[in] cert_value certificate value.
5275 * @return 0 if success, error code(<0) if fail
5276 * @retval PMINFO_R_OK success
5277 * @retval PMINFO_R_EINVAL invalid argument
5278 * @retval PMINFO_R_ERROR internal error
5279 * @pre pkgmgrinfo_create_certinfo_set_handle()
5280 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5281 * @see pkgmgrinfo_save_certinfo()
5283 static int set_cert_in_db(const char *pkgid)
5286 pkgmgrinfo_instcertinfo_h handle;
5287 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5288 if (ret != PMINFO_R_OK)
5290 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5291 if (ret != PMINFO_R_OK) {
5292 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5295 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5296 if (ret != PMINFO_R_OK) {
5297 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5300 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5305 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5308 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5309 * @brief This API saves the package cert information in the DB.
5311 * @par This API is for package-manager client application
5312 * @par Sync (or) Async : Synchronous API
5314 * @param[in] pkgid pointer to the package ID.
5315 * @param[in] handle pointer to the package cert handle.
5316 * @return 0 if success, error code(<0) if fail
5317 * @retval PMINFO_R_OK success
5318 * @retval PMINFO_R_EINVAL invalid argument
5319 * @retval PMINFO_R_ERROR internal error
5320 * @pre pkgmgrinfo_create_certinfo_set_handle()
5321 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5322 * @see pkgmgrinfo_save_certinfo()
5324 static int set_cert_in_db(const char *pkgid)
5327 pkgmgrinfo_instcertinfo_h handle;
5328 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5329 if (ret != PMINFO_R_OK)
5331 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5332 if (ret != PMINFO_R_OK) {
5333 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5336 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5337 if (ret != PMINFO_R_OK) {
5338 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5341 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5346 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5349 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5350 * @brief This API destroys the package cert information handle freeing up all the resources.
5352 * @par This API is for package-manager client application
5353 * @par Sync (or) Async : Synchronous API
5355 * @param[in] handle pointer to the package cert handle.
5356 * @return 0 if success, error code(<0) if fail
5357 * @retval PMINFO_R_OK success
5358 * @retval PMINFO_R_EINVAL invalid argument
5359 * @retval PMINFO_R_ERROR internal error
5360 * @pre pkgmgrinfo_create_certinfo_set_handle()
5362 * @see pkgmgrinfo_save_certinfo()
5364 static int set_cert_in_db(const char *pkgid)
5367 pkgmgrinfo_instcertinfo_h handle;
5368 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5369 if (ret != PMINFO_R_OK)
5371 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5372 if (ret != PMINFO_R_OK) {
5373 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5376 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5377 if (ret != PMINFO_R_OK) {
5378 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5381 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5386 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5389 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5390 * @brief This API gets the datacontrol info
5392 * @par This API is for package-manager client application
5393 * @par Sync (or) Async : Synchronous API
5395 * @param[in] providerid pointer to the providerid of dataconltrol.
5396 * @param[in] type pointer to the type of dataconltrol.
5397 * @param[out] appid pointer to hold appid, need to free after using
5398 * @param[out] access pointer to hold access, need to free after using
5399 * @return 0 if success, error code(<0) if fail
5400 * @retval PMINFO_R_OK success
5401 * @retval PMINFO_R_EINVAL invalid argument
5402 * @retval PMINFO_R_ERROR internal error
5405 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5408 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5409 * @brief This API gets the application 'guest mode visibility' value from the DB
5411 * @par This API is for package-manager client application
5412 * @par Sync (or) Async : Synchronous API
5414 * @param[in] handle pointer to application info handle
5415 * @param[out] status pointer to hold app guest mode visibility value
5416 * @return 0 if success, error code(<0) if fail
5417 * @retval PMINFO_R_OK success
5418 * @retval PMINFO_R_EINVAL invalid argument
5419 * @retval PMINFO_R_ERROR internal error
5420 * @pre pkgmgrinfo_appinfo_get_appinfo()
5421 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5422 * @see pkgmgrinfo_appinfo_get_appid()
5423 * @see pkgmgrinfo_appinfo_is_multiple()
5425 static int get_app_guestmode_visibility(const char *appid)
5429 pkgmgrinfo_appinfo_h handle;
5430 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5431 if (ret != PMINFO_R_OK)
5433 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5434 if (ret != PMINFO_R_OK) {
5435 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5438 printf("app guest mode visibility: %d\n", status);
5439 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5444 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5447 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5448 * @brief This API sets the application 'guest mode visibility' value in the DB
5450 * @par This API is for package-manager client application
5451 * @par Sync (or) Async : Synchronous API
5453 * @param[in] handle pointer to application info handle
5454 * @param[out] status app guest mode visibility value
5455 * @return 0 if success, error code(<0) if fail
5456 * @retval PMINFO_R_OK success
5457 * @retval PMINFO_R_EINVAL invalid argument
5458 * @retval PMINFO_R_ERROR internal error
5459 * @pre pkgmgrinfo_appinfo_get_appinfo()
5460 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5461 * @see pkgmgrinfo_appinfo_get_appid()
5462 * @see pkgmgrinfo_appinfo_is_multiple()
5464 static int set_app_guestmode_visibility(const char *appid, bool value)
5467 pkgmgrinfo_appinfo_h handle;
5468 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5469 if (ret != PMINFO_R_OK)
5471 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5472 if (ret != PMINFO_R_OK) {
5473 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5476 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5481 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5482 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5485 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5486 * @brief This API sets the package 'installed_storage' value in db
5488 * @par This API is for package-manager client application
5489 * @par Sync (or) Async : Synchronous API
5491 * @param[in] pkgid pointer to the package ID.
5492 * @param[in] location package install location
5493 * @return 0 if success, error code(<0) if fail
5494 * @retval PMINFO_R_OK success
5495 * @retval PMINFO_R_EINVAL invalid argument
5496 * @retval PMINFO_R_ERROR internal error
5498 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5502 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5503 if (ret != PMINFO_R_OK) {
5510 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5511 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5514 * @pkgmgrinfo client API
5518 * @brief listening status type in pkgmgrinfo.
5520 #define PMINFO_CLIENT_STATUS_ALL 0x00
5521 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5522 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5523 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5524 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5525 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5526 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5529 * @brief This APIs provides pkgmgrinfo client listener
5531 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5532 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5533 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5534 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5541 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5542 int flag, void *user_data, uid_t uid);
5543 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5544 int flag, void *user_data);
5545 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5546 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5548 int pkgmgrinfo_appinfo_get_installed_list_full(
5549 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5552 * @pkgmgrinfo client API end
5560 #endif /* __PKG_INFO_H__ */