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_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
619 * @brief This API gets the installed package total size on the target.
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] size pointer to hold package total size
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
631 static int get_pkg_total_size(const char *pkgid)
635 pkgmgrinfo_pkginfo_h handle;
636 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
637 if (ret != PMINFO_R_OK)
639 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
640 if (ret != PMINFO_R_OK) {
641 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
644 printf("pkg total size: %d\n", size);
645 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
650 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
653 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
654 * @brief This API gets the installed package data size on the target.
656 * @par This API is for package-manager client application
657 * @par Sync (or) Async : Synchronous API
659 * @param[in] handle pointer to package info handle
660 * @param[out] size pointer to hold package data size
661 * @return 0 if success, error code(<0) if fail
662 * @retval PMINFO_R_OK success
663 * @retval PMINFO_R_EINVAL invalid argument
664 * @retval PMINFO_R_ERROR internal error
666 static int get_pkg_data_size(const char *pkgid)
670 pkgmgrinfo_pkginfo_h handle;
671 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
672 if (ret != PMINFO_R_OK)
674 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
675 if (ret != PMINFO_R_OK) {
676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
679 printf("pkg data size: %d\n", size);
680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
685 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
688 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
689 * @brief This API gets the package icon from the package ID
691 * @par This API is for package-manager client application
692 * @par Sync (or) Async : Synchronous API
694 * @param[in] handle pointer to package info handle
695 * @param[out] icon pointer to hold package icon
696 * @return 0 if success, error code(<0) if fail
697 * @retval PMINFO_R_OK success
698 * @retval PMINFO_R_EINVAL invalid argument
699 * @retval PMINFO_R_ERROR internal error
700 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
701 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
702 * @see pkgmgrinfo_pkginfo_get_pkgid()
703 * @see pkgmgrinfo_pkginfo_is_removable()
705 static int get_pkg_icon(const char *pkgid)
709 pkgmgrinfo_pkginfo_h handle;
710 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
711 if (ret != PMINFO_R_OK)
713 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
714 if (ret != PMINFO_R_OK) {
715 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
718 printf("pkg icon: %s\n", icon);
719 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
724 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
727 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
728 * @brief This API gets the package label from the package ID
730 * @par This API is for package-manager client application
731 * @par Sync (or) Async : Synchronous API
733 * @param[in] handle pointer to package info handle
734 * @param[out] label pointer to hold package label
735 * @return 0 if success, error code(<0) if fail
736 * @retval PMINFO_R_OK success
737 * @retval PMINFO_R_EINVAL invalid argument
738 * @retval PMINFO_R_ERROR internal error
739 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
740 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
741 * @see pkgmgrinfo_pkginfo_get_pkgid()
742 * @see pkgmgrinfo_pkginfo_is_removable()
744 static int get_pkg_label(const char *pkgid)
748 pkgmgrinfo_pkginfo_h handle;
749 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
750 if (ret != PMINFO_R_OK)
752 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
753 if (ret != PMINFO_R_OK) {
754 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
757 printf("pkg label: %s\n", label);
758 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
763 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
766 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
767 * @brief This API gets the package description from the package ID
769 * @par This API is for package-manager client application
770 * @par Sync (or) Async : Synchronous API
772 * @param[in] handle pointer to package info handle
773 * @param[out] description pointer to hold package description
774 * @return 0 if success, error code(<0) if fail
775 * @retval PMINFO_R_OK success
776 * @retval PMINFO_R_EINVAL invalid argument
777 * @retval PMINFO_R_ERROR internal error
778 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
779 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
780 * @see pkgmgrinfo_pkginfo_get_pkgid()
781 * @see pkgmgrinfo_pkginfo_is_removable()
783 static int get_pkg_description(const char *pkgid)
786 char *description = NULL;
787 pkgmgrinfo_pkginfo_h handle;
788 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
789 if (ret != PMINFO_R_OK)
791 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
792 if (ret != PMINFO_R_OK) {
793 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
796 printf("pkg description: %s\n", description);
797 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
802 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
805 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
806 * @brief This API gets the package's author name from the package ID
808 * @par This API is for package-manager client application
809 * @par Sync (or) Async : Synchronous API
811 * @param[in] handle pointer to package info handle
812 * @param[out] author_name pointer to hold package author name
813 * @return 0 if success, error code(<0) if fail
814 * @retval PMINFO_R_OK success
815 * @retval PMINFO_R_EINVAL invalid argument
816 * @retval PMINFO_R_ERROR internal error
817 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
818 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
819 * @see pkgmgrinfo_pkginfo_get_pkgid()
820 * @see pkgmgrinfo_pkginfo_is_removable()
822 static int get_pkg_author_name(const char *pkgid)
825 char *author_name = NULL;
826 pkgmgrinfo_pkginfo_h handle;
827 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
828 if (ret != PMINFO_R_OK)
830 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
831 if (ret != PMINFO_R_OK) {
832 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
835 printf("pkg author name: %s\n", author_name);
836 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
841 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
844 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
845 * @brief This API gets the package's author email from the package ID
847 * @par This API is for package-manager client application
848 * @par Sync (or) Async : Synchronous API
850 * @param[in] handle pointer to package info handle
851 * @param[out] author_email pointer to hold package author email
852 * @return 0 if success, error code(<0) if fail
853 * @retval PMINFO_R_OK success
854 * @retval PMINFO_R_EINVAL invalid argument
855 * @retval PMINFO_R_ERROR internal error
856 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
857 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
858 * @see pkgmgrinfo_pkginfo_get_pkgid()
859 * @see pkgmgrinfo_pkginfo_is_removable()
861 static int get_pkg_author_email(const char *pkgid)
864 char *author_email = NULL;
865 pkgmgrinfo_pkginfo_h handle;
866 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
867 if (ret != PMINFO_R_OK)
869 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
870 if (ret != PMINFO_R_OK) {
871 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
874 printf("pkg author email: %s\n", author_email);
875 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
880 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
883 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
884 * @brief This API gets the package's author href from the package ID
886 * @par This API is for package-manager client application
887 * @par Sync (or) Async : Synchronous API
889 * @param[in] handle pointer to package info handle
890 * @param[out] author_href pointer to hold package author href
891 * @return 0 if success, error code(<0) if fail
892 * @retval PMINFO_R_OK success
893 * @retval PMINFO_R_EINVAL invalid argument
894 * @retval PMINFO_R_ERROR internal error
895 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
896 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
897 * @see pkgmgrinfo_pkginfo_get_pkgid()
898 * @see pkgmgrinfo_pkginfo_is_removable()
900 static int get_pkg_author_href(const char *pkgid)
903 char *author_href = NULL;
904 pkgmgrinfo_pkginfo_h handle;
905 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
906 if (ret != PMINFO_R_OK)
908 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
909 if (ret != PMINFO_R_OK) {
910 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
913 printf("pkg author href: %s\n", author_href);
914 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
919 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
922 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
923 * @brief This API gets the package installed storagae value from the package ID
925 * @par This API is for package-manager client application
926 * @par Sync (or) Async : Synchronous API
928 * @param[in] handle pointer to package info handle
929 * @param[out] storage pointer to hold package installed storage
930 * @return 0 if success, error code(<0) if fail
931 * @retval PMINFO_R_OK success
932 * @retval PMINFO_R_EINVAL invalid argument
933 * @retval PMINFO_R_ERROR internal error
934 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
935 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
936 * @see pkgmgrinfo_pkginfo_get_pkgid()
937 * @see pkgmgrinfo_pkginfo_is_removable()
939 static int get_pkg_installed_storage(const char *pkgid)
942 pkgmgrinfo_installed_storage storage;
943 pkgmgrinfo_pkginfo_h handle;
944 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
945 if (ret != PMINFO_R_OK)
947 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
948 if (ret != PMINFO_R_OK) {
949 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
952 printf("pkg installed storage: %d\n", storage);
953 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
958 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
961 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
962 * @brief This API gets the installed time of package from the package ID
964 * @par This API is for package-manager client application
965 * @par Sync (or) Async : Synchronous API
967 * @param[in] handle pointer to package info handle
968 * @param[out] installed_time pointer to hold installed time of package
969 * @return 0 if success, error code(<0) if fail
970 * @retval PMINFO_R_OK success
971 * @retval PMINFO_R_EINVAL invalid argument
972 * @retval PMINFO_R_ERROR internal error
973 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
974 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
975 * @see pkgmgrinfo_pkginfo_get_pkgid()
976 * @see pkgmgrinfo_pkginfo_is_removable()
978 static int get_pkg_installed_time(const char *pkgid)
981 int installed_time = 0;
982 pkgmgrinfo_pkginfo_h handle;
983 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
984 if (ret != PMINFO_R_OK)
986 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
987 if (ret != PMINFO_R_OK) {
988 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
991 printf("installed_time: %d\n", installed_time);
992 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
997 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1000 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1001 * @brief This API gets the launch mode of package from the package ID
1003 * @par This API is for package-manager client application
1004 * @par Sync (or) Async : Synchronous API
1006 * @param[in] handle pointer to package info handle
1007 * @param[out] mode pointer to hold launch mode of package
1008 * @return 0 if success, error code(<0) if fail
1009 * @retval PMINFO_R_OK success
1010 * @retval PMINFO_R_EINVAL invalid argument
1011 * @retval PMINFO_R_ERROR internal error
1012 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1013 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1014 * @see pkgmgrinfo_pkginfo_get_pkgid()
1015 * @see pkgmgrinfo_pkginfo_is_removable()
1017 static int get_pkg_launch_mode(const char *pkgid)
1020 char *launch_mode = NULL;
1021 pkgmgrinfo_pkginfo_h handle;
1022 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1023 if (ret != PMINFO_R_OK)
1025 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1026 if (ret != PMINFO_R_OK) {
1027 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1030 printf("launch mode: %s\n", mode);
1031 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1036 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1039 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1040 * @brief This API gets the store client id of package from the package ID
1042 * @par This API is for package-manager client application
1043 * @par Sync (or) Async : Synchronous API
1045 * @param[in] handle pointer to package info handle
1046 * @param[out] storeclientid pointer to hold store client id of package
1047 * @return 0 if success, error code(<0) if fail
1048 * @retval PMINFO_R_OK success
1049 * @retval PMINFO_R_EINVAL invalid argument
1050 * @retval PMINFO_R_ERROR internal error
1051 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1052 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1053 * @see pkgmgrinfo_pkginfo_get_pkgid()
1054 * @see pkgmgrinfo_pkginfo_is_removable()
1056 static int get_pkg_storeclientid(const char *pkgid)
1059 char *storeclientid = 0;
1060 pkgmgrinfo_pkginfo_h handle;
1061 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1062 if (ret != PMINFO_R_OK)
1064 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1065 if (ret != PMINFO_R_OK) {
1066 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1069 printf(store client id: %s\n", storeclientid);
1070 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1075 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1078 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1079 * @brief This API gets the main app id of package from the package ID
1081 * @par This API is for package-manager client application
1082 * @par Sync (or) Async : Synchronous API
1084 * @param[in] handle pointer to package info handle
1085 * @param[out] mainappid pointer to hold main app id of package
1086 * @return 0 if success, error code(<0) if fail
1087 * @retval PMINFO_R_OK success
1088 * @retval PMINFO_R_EINVAL invalid argument
1089 * @retval PMINFO_R_ERROR internal error
1090 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1091 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1092 * @see pkgmgrinfo_pkginfo_get_pkgid()
1093 * @see pkgmgrinfo_pkginfo_is_removable()
1095 static int get_pkg_mainappid(const char *pkgid)
1098 char *mainappid = 0;
1099 pkgmgrinfo_pkginfo_h handle;
1100 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1101 if (ret != PMINFO_R_OK)
1103 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1104 if (ret != PMINFO_R_OK) {
1105 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1108 printf(main app id: %s\n", mainappid);
1109 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1114 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1117 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1118 * @brief This API gets the url of package from the package ID
1120 * @par This API is for package-manager client application
1121 * @par Sync (or) Async : Synchronous API
1123 * @param[in] handle pointer to package info handle
1124 * @param[out] url pointer to hold url of package
1125 * @return 0 if success, error code(<0) if fail
1126 * @retval PMINFO_R_OK success
1127 * @retval PMINFO_R_EINVAL invalid argument
1128 * @retval PMINFO_R_ERROR internal error
1129 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1130 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1131 * @see pkgmgrinfo_pkginfo_get_pkgid()
1132 * @see pkgmgrinfo_pkginfo_is_removable()
1134 static int get_pkg_url(const char *pkgid)
1138 pkgmgrinfo_pkginfo_h handle;
1139 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1140 if (ret != PMINFO_R_OK)
1142 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1143 if (ret != PMINFO_R_OK) {
1144 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1147 printf("url : %s\n", url);
1148 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1153 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1156 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1157 * @brief This API gets the root path of package
1159 * @par Sync (or) Async : Synchronous API
1161 * @param[in] handle pointer to package info handle
1162 * @param[out] path pointer to hold root path of package
1163 * @return 0 if success, error code(<0) if fail
1164 * @retval PMINFO_R_OK success
1165 * @retval PMINFO_R_EINVAL invalid argument
1166 * @retval PMINFO_R_ERROR internal error
1168 static int get_root_path(const char *pkgid)
1172 pkgmgrinfo_pkginfo_h handle;
1173 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1174 if (ret != PMINFO_R_OK)
1177 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1178 if (ret != PMINFO_R_OK) {
1179 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1182 printf("path : %s\n", path);
1183 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1189 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1193 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1194 * @brief This API gets the csc path of package
1196 * @par Sync (or) Async : Synchronous API
1198 * @param[in] handle pointer to package info handle
1199 * @param[out] path pointer to hold csc path of package
1200 * @return 0 if success, error code(<0) if fail
1201 * @retval PMINFO_R_OK success
1202 * @retval PMINFO_R_EINVAL invalid argument
1203 * @retval PMINFO_R_ERROR internal error
1205 static int get_csc_path(const char *pkgid)
1209 pkgmgrinfo_pkginfo_h handle;
1210 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1211 if (ret != PMINFO_R_OK)
1214 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1215 if (ret != PMINFO_R_OK) {
1216 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1219 printf("path : %s\n", path);
1220 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1226 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1229 * @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)
1230 * @brief This API compare the cert information from given package id
1232 * @par This API is for package-manager client application
1233 * @par Sync (or) Async : Synchronous API
1235 * @param[in] lhs_package_id pointer to first package ID
1236 * @param[in] rhs_package_id pointer to second package ID
1237 * @param[out] compare_result pointer to the compare result.
1238 * @return 0 if success, error code(<0) if fail
1239 * @retval PMINFO_R_OK success
1240 * @retval PMINFO_R_EINVAL invalid argument
1241 * @retval PMINFO_R_ERROR internal error
1243 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1244 * @see pkgmgrinfo_pkginfo_get_pkgid()
1245 * @see pkgmgrinfo_pkginfo_is_removable()
1247 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1250 pkgmgrinfo_cert_compare_result_type_e result;
1252 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1253 if (ret != PMINFO_R_OK) {
1256 printf("result: %d\n", result);
1261 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);
1262 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);
1264 * @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)
1265 * @brief This API compare the cert information from given app id
1267 * @par This API is for package-manager client application
1268 * @par Sync (or) Async : Synchronous API
1270 * @param[in] lhs_app_id pointer to first app ID
1271 * @param[in] rhs_app_id pointer to second app ID
1272 * @param[out] compare_result pointer to the compare result.
1273 * @return 0 if success, error code(<0) if fail
1274 * @retval PMINFO_R_OK success
1275 * @retval PMINFO_R_EINVAL invalid argument
1276 * @retval PMINFO_R_ERROR internal error
1278 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1279 * @see pkgmgrinfo_pkginfo_get_pkgid()
1280 * @see pkgmgrinfo_pkginfo_is_removable()
1282 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1285 pkgmgrinfo_cert_compare_result_type_e result;
1287 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1288 if (ret != PMINFO_R_OK) {
1291 printf("result: %d\n", result);
1296 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);
1297 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);
1299 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1300 * @brief This API gets the package 'removable' value from the package ID
1302 * @par This API is for package-manager client application
1303 * @par Sync (or) Async : Synchronous API
1305 * @param[in] handle pointer to package info handle
1306 * @param[out] removable pointer to hold package removable value
1307 * @return 0 if success, error code(<0) if fail
1308 * @retval PMINFO_R_OK success
1309 * @retval PMINFO_R_EINVAL invalid argument
1310 * @retval PMINFO_R_ERROR internal error
1311 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1312 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1313 * @see pkgmgrinfo_pkginfo_get_pkgid()
1314 * @see pkgmgrinfo_pkginfo_is_readonly()
1316 static int get_pkg_removable(const char *pkgid)
1320 pkgmgrinfo_pkginfo_h handle;
1321 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1322 if (ret != PMINFO_R_OK)
1324 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1325 if (ret != PMINFO_R_OK) {
1326 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1329 printf("pkg removable: %d\n", removable);
1330 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1335 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1338 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1339 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1341 * @par This API is for package-manager client application
1342 * @par Sync (or) Async : Synchronous API
1344 * @param[in] handle pointer to package info handle
1345 * @param[out] movable pointer to hold package movable state
1346 * @return 0 if success, error code(<0) if fail
1347 * @retval PMINFO_R_OK success
1348 * @retval PMINFO_R_EINVAL invalid argument
1349 * @retval PMINFO_R_ERROR internal error
1350 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1351 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1352 * @see pkgmgrinfo_pkginfo_get_pkgid()
1354 static int get_pkg_movable(const char *pkgid)
1358 pkgmgrinfo_pkginfo_h handle;
1359 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1360 if (ret != PMINFO_R_OK)
1362 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1363 if (ret != PMINFO_R_OK) {
1364 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1367 printf("pkg movable: %d\n", movable);
1368 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1373 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1376 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1377 * @brief This API gets the package 'preload' value from the package ID
1379 * @par This API is for package-manager client application
1380 * @par Sync (or) Async : Synchronous API
1382 * @param[in] handle pointer to package info handle
1383 * @param[out] preload pointer to hold package preload value
1384 * @return 0 if success, error code(<0) if fail
1385 * @retval PMINFO_R_OK success
1386 * @retval PMINFO_R_EINVAL invalid argument
1387 * @retval PMINFO_R_ERROR internal error
1388 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1389 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1390 * @see pkgmgrinfo_pkginfo_get_pkgid()
1391 * @see pkgmgrinfo_pkginfo_is_readonly()
1393 static int get_pkg_preload(const char *pkgid)
1397 pkgmgrinfo_pkginfo_h handle;
1398 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1399 if (ret != PMINFO_R_OK)
1401 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1402 if (ret != PMINFO_R_OK) {
1403 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1406 printf("pkg preload: %d\n", preload);
1407 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1412 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1415 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1416 * @brief This API gets the value for given handle is system or not
1418 * @par This API is for package-manager client application
1419 * @par Sync (or) Async : Synchronous API
1421 * @param[in] handle pointer to package info handle
1422 * @param[out] system pointer to hold system is or not
1423 * @return 0 if success, error code(<0) if fail
1424 * @retval PMINFO_R_OK success
1425 * @retval PMINFO_R_EINVAL invalid argument
1426 * @retval PMINFO_R_ERROR internal error
1427 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1428 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1429 * @see pkgmgrinfo_pkginfo_get_pkgid()
1430 * @see pkgmgrinfo_pkginfo_is_readonly()
1432 static int get_pkg_system(const char *pkgid)
1435 bool system = false;
1436 pkgmgrinfo_pkginfo_h handle = NULL;
1437 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1438 if (ret != PMINFO_R_OK)
1440 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1441 if (ret != PMINFO_R_OK) {
1442 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1445 printf("pkg system: %d\n", system);
1446 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1451 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1454 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1455 * @brief This API gets the package 'readonly' value from the package ID
1457 * @par This API is for package-manager client application
1458 * @par Sync (or) Async : Synchronous API
1460 * @param[in] handle pointer to package info handle
1461 * @param[out] readonly pointer to hold package readonly value
1462 * @return 0 if success, error code(<0) if fail
1463 * @retval PMINFO_R_OK success
1464 * @retval PMINFO_R_EINVAL invalid argument
1465 * @retval PMINFO_R_ERROR internal error
1466 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1467 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1468 * @see pkgmgrinfo_pkginfo_get_pkgid()
1469 * @see pkgmgrinfo_pkginfo_is_removable()
1471 static int get_pkg_readonly(const char *pkgid)
1475 pkgmgrinfo_pkginfo_h handle;
1476 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1477 if (ret != PMINFO_R_OK)
1479 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1480 if (ret != PMINFO_R_OK) {
1481 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1484 printf("pkg readonly: %d\n", readonly);
1485 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1490 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1494 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1495 * @brief This API gets the package 'upate' value from the package ID
1497 * @par This API is for package-manager client application
1498 * @par Sync (or) Async : Synchronous API
1500 * @param[in] handle pointer to package info handle
1501 * @param[out] update pointer to hold package update value
1502 * @return 0 if success, error code(<0) if fail
1503 * @retval PMINFO_R_OK success
1504 * @retval PMINFO_R_EINVAL invalid argument
1505 * @retval PMINFO_R_ERROR internal error
1506 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1507 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1508 * @see pkgmgrinfo_pkginfo_get_pkgid()
1510 static int get_pkg_update(const char *pkgid)
1514 pkgmgrinfo_pkginfo_h handle;
1515 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1516 if (ret != PMINFO_R_OK)
1518 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1519 if (ret != PMINFO_R_OK) {
1520 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1523 printf("pkg update: %d\n", update);
1524 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1529 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1532 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1533 * @brief This API gets the package 'support_disable' value from the package ID
1535 * @par This API is for package-manager client application
1536 * @par Sync (or) Async : Synchronous API
1538 * @param[in] handle pointer to package info handle
1539 * @param[out] support_disable pointer to hold package support_disable value
1540 * @return 0 if success, error code(<0) if fail
1541 * @retval PMINFO_R_OK success
1542 * @retval PMINFO_R_EINVAL invalid argument
1543 * @retval PMINFO_R_ERROR internal error
1544 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1545 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1546 * @see pkgmgrinfo_pkginfo_get_pkgid()
1548 static int get_pkg_support_disable(const char *pkgid)
1551 bool support_disable;
1552 pkgmgrinfo_pkginfo_h handle = NULL;
1553 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1554 if (ret != PMINFO_R_OK)
1556 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1557 if (ret != PMINFO_R_OK) {
1558 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1561 printf("pkg support_disable: %d\n", support_disable);
1562 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1567 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1570 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1571 * @brief This API gets whethere the given package is global package or user package
1573 * @par This API is for package-manager client application
1574 * @par Sync (or) Async : Synchronous API
1576 * @param[in] handle pointer to package info handle
1577 * @param[in] global pointer to hold package global value
1578 * @return 0 if success, error code(<0) if fail
1579 * @retval PMINFO_R_OK success
1580 * @retval PMINFO_R_EINVAL invalid argument
1581 * @retval PMINFO_R_ERROR internal error
1582 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1583 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1584 * @see pkgmgrinfo_pkginfo_get_pkgid()
1585 static int get_pkg_support_disable(const char *pkgid)
1589 pkgmgrinfo_pkginfo_h handle = NULL;
1590 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1591 if (ret != PMINFO_R_OK)
1593 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1594 if (ret != PMINFO_R_OK) {
1595 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1598 printf("pkg is_global: %d\n", global);
1599 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1604 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1607 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1608 * @brief This API gets the package 'accessible' value from the package ID
1610 * @par This API is for package-manager client application
1611 * @par Sync (or) Async : Synchronous API
1613 * @param[in] handle pointer to package info handle
1614 * @param[out] accessible pointer to hold package accessible value
1615 * @return 0 if success, error code(<0) if fail
1616 * @retval PMINFO_R_OK success
1617 * @retval PMINFO_R_EINVAL invalid argument
1618 * @retval PMINFO_R_ERROR internal error
1619 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1620 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1621 * @see pkgmgrinfo_pkginfo_get_pkgid()
1622 * @see pkgmgrinfo_pkginfo_is_readonly()
1624 static int get_pkg_accessible(const char *pkgid)
1628 pkgmgrinfo_pkginfo_h handle;
1629 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1630 if (ret != PMINFO_R_OK)
1632 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1633 if (ret != PMINFO_R_OK) {
1634 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1637 printf("pkg accessible: %d\n", accessible);
1638 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1643 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1646 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1647 * @brief This API destroys the package information handle freeing up all the resources
1649 * @par This API is for package-manager client application
1650 * @par Sync (or) Async : Synchronous API
1652 * @param[in] handle pointer to the package info handle
1653 * @return 0 if success, error code(<0) if fail
1654 * @retval PMINFO_R_OK success
1655 * @retval PMINFO_R_EINVAL invalid argument
1656 * @retval PMINFO_R_ERROR internal error
1657 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1659 * @see pkgmgrinfo_pkginfo_get_pkgid()
1660 * @see pkgmgrinfo_pkginfo_is_removable()
1662 static int get_pkg_type(const char *pkgid)
1666 pkgmgrinfo_pkginfo_h handle;
1667 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1668 if (ret != PMINFO_R_OK)
1670 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1671 if (ret != PMINFO_R_OK) {
1672 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1675 printf("pkgtype: %s\n", type);
1676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1681 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1684 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1685 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1686 The query will search the entire package information collected from the manifest file of all the installed packages
1688 * @par This API is for package-manager client application
1689 * @par Sync (or) Async : Synchronous API
1691 * @param[out] handle pointer to the package info filter handle.
1692 * @return 0 if success, error code(<0) if fail
1693 * @retval PMINFO_R_OK success
1694 * @retval PMINFO_R_EINVAL invalid argument
1695 * @retval PMINFO_R_ERROR internal error
1697 * @post pkgmgrinfo_pkginfo_filter_destroy()
1698 * @see pkgmgrinfo_pkginfo_filter_count()
1699 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1701 static int get_tpk_pkg_count()
1705 pkgmgrinfo_pkginfo_filter_h handle;
1706 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1707 if (ret != PMINFO_R_OK)
1709 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1710 if (ret != PMINFO_R_OK) {
1711 pkgmgrinfo_pkginfo_filter_destroy(handle);
1714 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1715 if (ret != PMINFO_R_OK) {
1716 pkgmgrinfo_pkginfo_filter_destroy(handle);
1719 printf("No of tpk pkgs: %d\n", count);
1720 pkgmgrinfo_pkginfo_filter_destroy(handle);
1725 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1728 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1729 * @brief This API destroys the package information filter handle freeing up all the resources
1731 * @par This API is for package-manager client application
1732 * @par Sync (or) Async : Synchronous API
1734 * @param[in] handle pointer to the package info filter handle.
1735 * @return 0 if success, error code(<0) if fail
1736 * @retval PMINFO_R_OK success
1737 * @retval PMINFO_R_EINVAL invalid argument
1738 * @retval PMINFO_R_ERROR internal error
1739 * @pre pkgmgrinfo_pkginfo_filter_create()
1741 * @see pkgmgrinfo_pkginfo_filter_count()
1742 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1744 static int get_tpk_pkg_count()
1748 pkgmgrinfo_pkginfo_filter_h handle;
1749 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1750 if (ret != PMINFO_R_OK)
1752 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1753 if (ret != PMINFO_R_OK) {
1754 pkgmgrinfo_pkginfo_filter_destroy(handle);
1757 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1758 if (ret != PMINFO_R_OK) {
1759 pkgmgrinfo_pkginfo_filter_destroy(handle);
1762 printf("No of tpk pkgs: %d\n", count);
1763 pkgmgrinfo_pkginfo_filter_destroy(handle);
1768 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1771 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1772 * @brief This API adds a boolean filter property to the filter handle
1774 * @par This API is for package-manager client application
1775 * @par Sync (or) Async : Synchronous API
1777 * @param[in] handle pointer to the package info filter handle.
1778 * @param[in] property boolean property name.
1779 * @param[in] value value corresponding to the property.
1780 * @return 0 if success, error code(<0) if fail
1781 * @retval PMINFO_R_OK success
1782 * @retval PMINFO_R_EINVAL invalid argument
1783 * @retval PMINFO_R_ERROR internal error
1784 * @pre pkgmgrinfo_pkginfo_filter_create()
1785 * @post pkgmgrinfo_pkginfo_filter_destroy()
1786 * @see pkgmgrinfo_pkginfo_filter_count()
1787 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1789 static int get_preload_pkg_count()
1793 pkgmgrinfo_pkginfo_filter_h handle;
1794 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1795 if (ret != PMINFO_R_OK)
1797 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1798 if (ret != PMINFO_R_OK) {
1799 pkgmgrinfo_pkginfo_filter_destroy(handle);
1802 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1803 if (ret != PMINFO_R_OK) {
1804 pkgmgrinfo_pkginfo_filter_destroy(handle);
1807 printf("No of preload pkgs: %d\n", count);
1808 pkgmgrinfo_pkginfo_filter_destroy(handle);
1813 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1814 const char *property, const bool value);
1817 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1818 * @brief This API adds an integer filter property to the filter handle
1820 * @par This API is for package-manager client application
1821 * @par Sync (or) Async : Synchronous API
1823 * @param[in] handle pointer to the package info filter handle.
1824 * @param[in] property integer property name.
1825 * @param[in] value value corresponding to the property.
1826 * @return 0 if success, error code(<0) if fail
1827 * @retval PMINFO_R_OK success
1828 * @retval PMINFO_R_EINVAL invalid argument
1829 * @retval PMINFO_R_ERROR internal error
1830 * @pre pkgmgrinfo_pkginfo_filter_create()
1831 * @post pkgmgrinfo_pkginfo_filter_destroy()
1832 * @see pkgmgrinfo_pkginfo_filter_count()
1833 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1835 static int get_pkg_count()
1839 pkgmgrinfo_pkginfo_filter_h handle;
1840 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1841 if (ret != PMINFO_R_OK)
1843 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1844 if (ret != PMINFO_R_OK) {
1845 pkgmgrinfo_pkginfo_filter_destroy(handle);
1848 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1849 if (ret != PMINFO_R_OK) {
1850 pkgmgrinfo_pkginfo_filter_destroy(handle);
1853 printf("No of preload pkgs: %d\n", count);
1854 pkgmgrinfo_pkginfo_filter_destroy(handle);
1859 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1860 const char *property, const int value);
1863 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1864 * @brief This API adds a string filter property to the filter handle
1866 * @par This API is for package-manager client application
1867 * @par Sync (or) Async : Synchronous API
1869 * @param[in] handle pointer to the package info filter handle.
1870 * @param[in] property string property name.
1871 * @param[in] value value corresponding to the property.
1872 * @return 0 if success, error code(<0) if fail
1873 * @retval PMINFO_R_OK success
1874 * @retval PMINFO_R_EINVAL invalid argument
1875 * @retval PMINFO_R_ERROR internal error
1876 * @pre pkgmgrinfo_pkginfo_filter_create()
1877 * @post pkgmgrinfo_pkginfo_filter_destroy()
1878 * @see pkgmgrinfo_pkginfo_filter_count()
1879 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1881 static int get_tpk_pkg_count()
1885 pkgmgrinfo_pkginfo_filter_h handle;
1886 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1887 if (ret != PMINFO_R_OK)
1889 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1890 if (ret != PMINFO_R_OK) {
1891 pkgmgrinfo_pkginfo_filter_destroy(handle);
1894 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1895 if (ret != PMINFO_R_OK) {
1896 pkgmgrinfo_pkginfo_filter_destroy(handle);
1899 printf("No of tpk pkgs: %d\n", count);
1900 pkgmgrinfo_pkginfo_filter_destroy(handle);
1905 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1906 const char *property, const char *value);
1909 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1910 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1912 * @par This API is for package-manager client application
1913 * @par Sync (or) Async : Synchronous API
1915 * @param[in] handle pointer to the package info filter handle.
1916 * @param[in] pkg_cb callback function.
1917 * @param[in] user_data user data to be passed to the callback function
1918 * @return 0 if success, error code(<0) if fail
1919 * @retval PMINFO_R_OK success
1920 * @retval PMINFO_R_EINVAL invalid argument
1921 * @retval PMINFO_R_ERROR internal error
1922 * @pre pkgmgrinfo_pkginfo_filter_create()
1923 * @post pkgmgrinfo_pkginfo_filter_destroy()
1924 * @see pkgmgrinfo_pkginfo_filter_count()
1926 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1929 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1930 printf("pkg id : %s\n", pkgid);
1934 static int get_tpk_pkg_list()
1937 pkgmgrinfo_pkginfo_filter_h handle;
1938 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1939 if (ret != PMINFO_R_OK)
1941 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1942 if (ret != PMINFO_R_OK) {
1943 pkgmgrinfo_pkginfo_filter_destroy(handle);
1946 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1947 if (ret != PMINFO_R_OK) {
1948 pkgmgrinfo_pkginfo_filter_destroy(handle);
1951 pkgmgrinfo_pkginfo_filter_destroy(handle);
1956 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1957 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1958 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1959 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1962 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1963 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1964 * @brief This API counts the package that satisfy the filter conditions
1966 * @par This API is for package-manager client application
1967 * @par Sync (or) Async : Synchronous API
1969 * @param[in] handle pointer to the package info filter handle.
1970 * @param[in] count pointer to store the count value.
1971 * @param[in] uid the addressee user id of the instruction
1972 * @return 0 if success, error code(<0) if fail
1973 * @retval PMINFO_R_OK success
1974 * @retval PMINFO_R_EINVAL invalid argument
1975 * @retval PMINFO_R_ERROR internal error
1976 * @pre pkgmgrinfo_pkginfo_filter_create()
1977 * @post pkgmgrinfo_pkginfo_filter_destroy()
1978 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1980 static int get_tpk_pkg_count()
1984 pkgmgrinfo_pkginfo_filter_h handle;
1985 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1986 if (ret != PMINFO_R_OK)
1988 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1989 if (ret != PMINFO_R_OK) {
1990 pkgmgrinfo_pkginfo_filter_destroy(handle);
1993 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1994 if (ret != PMINFO_R_OK) {
1995 pkgmgrinfo_pkginfo_filter_destroy(handle);
1998 printf("No of tpk pkgs: %d\n", count);
1999 pkgmgrinfo_pkginfo_filter_destroy(handle);
2004 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2005 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2007 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2008 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2009 * @brief This API gets the list of privilege for a particular package
2011 * @par This API is for package-manager client application
2012 * @par Sync (or) Async : Synchronous API
2013 * @param[in] handle pointer to the package info handle.
2014 * @param[in] privilege_func callback function for list
2015 * @param[in] user_data user data to be passed to callback function
2016 * @return 0 if success, error code(<0) if fail
2017 * @retval PMINFO_R_OK success
2018 * @retval PMINFO_R_EINVAL invalid argument
2019 * @retval PMINFO_R_ERROR internal error
2020 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2021 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2023 int privilege_func(const char *name, void *user_data)
2025 if (strcmp(name, (char *)user_data) == 0)
2031 static int list_privilege(const char *package, char *privilege)
2034 pkgmgrinfo_pkginfo_h handle;
2035 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2036 if (ret != PMINFO_R_OK)
2038 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2039 if (ret != PMINFO_R_OK) {
2040 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2043 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2048 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2049 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2051 /* TODO: add doxygen comment here */
2052 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2053 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2054 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2055 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2056 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2057 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2058 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2061 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2062 * @brief This API copy the application information handle
2064 * @par This API is for package-manager client application
2065 * @par Sync (or) Async : Synchronous API
2067 * @param[in] handle pointer to the package info handle.
2068 * @param[out] handle pointer to the package info handle.
2069 * @return 0 if success, error code(<0) if fail
2070 * @retval PMINFO_R_OK success
2071 * @retval PMINFO_R_EINVAL invalid argument
2072 * @retval PMINFO_R_ERROR internal error
2074 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2076 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2080 pkgmgrinfo_pkginfo_h clone;
2082 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2083 if (ret != PMINFO_R_OK)
2087 printf("package: %s\n", clone->package);
2088 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2093 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2097 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2098 pkgmgrinfo_app_list_cb app_func, void *user_data)
2099 * @brief This API gets list of installed applications for a particular package
2101 * @par This API is for package-manager client application
2102 * @par Sync (or) Async : Synchronous API
2103 * @param[in] handle package info handle
2104 * @param[in] component application component
2105 * @param[in] app_func iteration function for list
2106 * @param[in] user_data user data to be passed to callback function
2107 * @return 0 if success, error code(<0) if fail
2108 * @retval PMINFO_R_OK success
2109 * @retval PMINFO_R_EINVAL invalid argument
2110 * @retval PMINFO_R_ERROR internal error
2111 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2112 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2114 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2117 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2118 printf("appid : %s\n", appid);
2122 static int list_apps(const char *pkgid)
2125 pkgmgrinfo_pkginfo_h handle;
2126 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2127 if (ret != PMINFO_R_OK)
2129 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2130 if (ret != PMINFO_R_OK) {
2131 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2134 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2139 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2140 pkgmgrinfo_app_list_cb app_func, void *user_data);
2141 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2142 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2145 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2146 * @brief This API gets list of installed applications from all packages with minimum informaion.
2148 * @par This API is for package-manager client application
2149 * @par Sync (or) Async : Synchronous API
2150 * @param[in] app_func iteration function for list
2151 * @param[in] user_data user data to be passed to callback function
2152 * @return 0 if success, error code(<0) if fail
2153 * @retval PMINFO_R_OK success
2154 * @retval PMINFO_R_EINVAL invalid argument
2155 * @retval PMINFO_R_ERROR internal error
2159 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2161 char *pkgid1 = NULL;
2162 char *pkgid2 = NULL;
2163 pkgid1 = (char *)user_data;
2164 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2165 if (strcmp(pkgid1, pkgid2) == 0) {
2172 static int list_apps()
2175 char *name = "helloworld";
2176 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2177 if (ret != PMINFO_R_OK) {
2184 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2185 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2188 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2189 * @brief This API gets list of installed applications from all packages.
2191 * @par This API is for package-manager client application
2192 * @par Sync (or) Async : Synchronous API
2193 * @param[in] app_func iteration function for list
2194 * @param[in] user_data user data to be passed to callback function
2195 * @return 0 if success, error code(<0) if fail
2196 * @retval PMINFO_R_OK success
2197 * @retval PMINFO_R_EINVAL invalid argument
2198 * @retval PMINFO_R_ERROR internal error
2202 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2204 char *pkgid1 = NULL;
2205 char *pkgid2 = NULL;
2206 pkgid1 = (char *)user_data;
2207 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2208 if (strcmp(pkgid1, pkgid2) == 0) {
2215 static int list_apps()
2218 char *name = "helloworld";
2219 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2220 if (ret != PMINFO_R_OK) {
2227 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2228 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2231 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2232 * @brief This API creates the disabled application information handle from db
2234 * @par This API is for package-manager client application
2235 * @par Sync (or) Async : Synchronous API
2237 * @param[in] appid pointer to appid
2238 * @param[out] handle pointer to the application info handle.
2239 * @return 0 if success, error code(<0) if fail
2240 * @retval PMINFO_R_OK success
2241 * @retval PMINFO_R_EINVAL invalid argument
2242 * @retval PMINFO_R_ERROR internal error
2244 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2245 * @see pkgmgrinfo_appinfo_get_pkgid()
2246 * @see pkgmgrinfo_appinfo_is_multiple()
2248 static int get_disabled_app_type(const char *appid)
2252 pkgmgrinfo_appinfo_h handle;
2253 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2254 if (ret != PMINFO_R_OK)
2256 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2257 if (ret != PMINFO_R_OK) {
2258 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2261 printf("apptype: %s\n", type);
2262 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2267 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2268 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2271 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2272 * @brief This API creates the application information handle from db
2274 * @par This API is for package-manager client application
2275 * @par Sync (or) Async : Synchronous API
2277 * @param[in] appid pointer to appid
2278 * @param[out] handle pointer to the application info handle.
2279 * @return 0 if success, error code(<0) if fail
2280 * @retval PMINFO_R_OK success
2281 * @retval PMINFO_R_EINVAL invalid argument
2282 * @retval PMINFO_R_ERROR internal error
2284 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2285 * @see pkgmgrinfo_appinfo_get_pkgid()
2286 * @see pkgmgrinfo_appinfo_is_multiple()
2288 static int get_app_type(const char *appid)
2292 pkgmgrinfo_appinfo_h handle;
2293 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2294 if (ret != PMINFO_R_OK)
2296 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2297 if (ret != PMINFO_R_OK) {
2298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2301 printf("apptype: %s\n", type);
2302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2307 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2308 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2311 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2312 * @brief This API gets the application ID
2314 * @par This API is for package-manager client application
2315 * @par Sync (or) Async : Synchronous API
2317 * @param[in] handle pointer to the application info handle.
2318 * @param[out] appid pointer to hold appid
2319 * @return 0 if success, error code(<0) if fail
2320 * @retval PMINFO_R_OK success
2321 * @retval PMINFO_R_EINVAL invalid argument
2322 * @retval PMINFO_R_ERROR internal error
2323 * @pre pkgmgrinfo_appinfo_get_appinfo()
2324 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2325 * @see pkgmgrinfo_appinfo_get_pkgid()
2326 * @see pkgmgrinfo_appinfo_is_multiple()
2328 static int get_app_id(const char *appid)
2331 char *app_id = NULL;
2332 pkgmgrinfo_appinfo_h handle;
2333 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2334 if (ret != PMINFO_R_OK)
2336 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2337 if (ret != PMINFO_R_OK) {
2338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2341 printf("app id: %s\n", app_id);
2342 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2347 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2350 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2351 * @brief This API gets the package name of the application
2353 * @par This API is for package-manager client application
2354 * @par Sync (or) Async : Synchronous API
2356 * @param[in] handle pointer to the application info handle.
2357 * @param[out] pkg_name pointer to hold package name
2358 * @return 0 if success, error code(<0) if fail
2359 * @retval PMINFO_R_OK success
2360 * @retval PMINFO_R_EINVAL invalid argument
2361 * @retval PMINFO_R_ERROR internal error
2362 * @pre pkgmgrinfo_appinfo_get_appinfo()
2363 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2364 * @see pkgmgrinfo_appinfo_get_appid()
2365 * @see pkgmgrinfo_appinfo_is_multiple()
2367 static int get_app_pkgname(const char *appid)
2370 char *pkgname = NULL;
2371 pkgmgrinfo_appinfo_h handle;
2372 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2373 if (ret != PMINFO_R_OK)
2375 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2376 if (ret != PMINFO_R_OK) {
2377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2380 printf("pkg name: %s\n", pkgname);
2381 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2386 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2389 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2390 * @brief This API gets the package id of the application
2392 * @par This API is for package-manager client application
2393 * @par Sync (or) Async : Synchronous API
2395 * @param[in] handle pointer to the application info handle.
2396 * @param[out] pkgid pointer to hold package id
2397 * @return 0 if success, error code(<0) if fail
2398 * @retval PMINFO_R_OK success
2399 * @retval PMINFO_R_EINVAL invalid argument
2400 * @retval PMINFO_R_ERROR internal error
2401 * @pre pkgmgrinfo_appinfo_get_appinfo()
2402 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2403 * @see pkgmgrinfo_appinfo_get_appid()
2404 * @see pkgmgrinfo_appinfo_is_multiple()
2406 static int get_app_pkgid(const char *appid)
2410 pkgmgrinfo_appinfo_h handle;
2411 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2412 if (ret != PMINFO_R_OK)
2414 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2415 if (ret != PMINFO_R_OK) {
2416 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2419 printf("pkg id: %s\n", pkgid);
2420 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2425 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2428 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2429 * @brief This API gets the package type of the application
2431 * @par This API is for package-manager client application
2432 * @par Sync (or) Async : Synchronous API
2434 * @param[in] handle pointer to the application info handle.
2435 * @param[out] pkgtype pointer to hold package type
2436 * @return 0 if success, error code(<0) if fail
2437 * @retval PMINFO_R_OK success
2438 * @retval PMINFO_R_EINVAL invalid argument
2439 * @retval PMINFO_R_ERROR internal error
2440 * @pre pkgmgrinfo_appinfo_get_appinfo()
2441 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2442 * @see pkgmgrinfo_appinfo_get_appid()
2443 * @see pkgmgrinfo_appinfo_is_multiple()
2445 static int get_app_pkgtype(const char *appid)
2448 char *pkgtype = NULL;
2449 pkgmgrinfo_appinfo_h handle = NULL;
2450 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2451 if (ret != PMINFO_R_OK)
2453 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2454 if (ret != PMINFO_R_OK) {
2455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2458 printf("pkgtype: %s\n", pkgtype);
2459 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2464 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2467 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2468 * @brief This API gets the executable name of the application
2470 * @par This API is for package-manager client application
2471 * @par Sync (or) Async : Synchronous API
2473 * @param[in] handle pointer to the application info handle.
2474 * @param[out] exec pointer to hold app exec name
2475 * @return 0 if success, error code(<0) if fail
2476 * @retval PMINFO_R_OK success
2477 * @retval PMINFO_R_EINVAL invalid argument
2478 * @retval PMINFO_R_ERROR internal error
2479 * @pre pkgmgrinfo_appinfo_get_appinfo()
2480 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2481 * @see pkgmgrinfo_appinfo_get_appid()
2482 * @see pkgmgrinfo_appinfo_is_multiple()
2484 static int get_app_exec(const char *appid)
2488 pkgmgrinfo_appinfo_h handle;
2489 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2490 if (ret != PMINFO_R_OK)
2492 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2493 if (ret != PMINFO_R_OK) {
2494 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2497 printf("exec name: %s\n", exec);
2498 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2503 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2506 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2507 * @brief This API gets the icon name of the application
2509 * @par This API is for package-manager client application
2510 * @par Sync (or) Async : Synchronous API
2512 * @param[in] handle pointer to the application info handle.
2513 * @param[out] icon pointer to hold app icon name
2514 * @return 0 if success, error code(<0) if fail
2515 * @retval PMINFO_R_OK success
2516 * @retval PMINFO_R_EINVAL invalid argument
2517 * @retval PMINFO_R_ERROR internal error
2518 * @pre pkgmgrinfo_appinfo_get_appinfo()
2519 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2520 * @see pkgmgrinfo_appinfo_get_appid()
2521 * @see pkgmgrinfo_appinfo_is_multiple()
2523 static int get_app_icon(const char *appid)
2527 pkgmgrinfo_appinfo_h handle;
2528 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2529 if (ret != PMINFO_R_OK)
2531 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2532 if (ret != PMINFO_R_OK) {
2533 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2536 printf("icon name: %s\n", icon);
2537 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2542 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2545 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2546 * @brief This API gets the label of the application
2548 * @par This API is for package-manager client application
2549 * @par Sync (or) Async : Synchronous API
2551 * @param[in] handle pointer to the application info handle.
2552 * @param[out] label pointer to hold app label
2553 * @return 0 if success, error code(<0) if fail
2554 * @retval PMINFO_R_OK success
2555 * @retval PMINFO_R_EINVAL invalid argument
2556 * @retval PMINFO_R_ERROR internal error
2557 * @pre pkgmgrinfo_appinfo_get_appinfo()
2558 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2559 * @see pkgmgrinfo_appinfo_get_appid()
2560 * @see pkgmgrinfo_appinfo_is_multiple()
2562 static int get_app_label(const char *appid)
2566 pkgmgrinfo_appinfo_h handle;
2567 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2568 if (ret != PMINFO_R_OK)
2570 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2571 if (ret != PMINFO_R_OK) {
2572 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2575 printf("label : %s\n", label);
2576 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2581 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2584 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2585 * @brief This API gets exactly matched label by given appid and locale
2587 * @par This API is for package-manager client application
2588 * @par Sync (or) Async : Synchronous API
2590 * @param[in] appid pointer to appid
2591 * @param[in] locale pointer to locale
2592 * @param[out] label pointer to hold app label
2593 * @return 0 if success, error code(<0) if fail
2594 * @retval PMINFO_R_OK success
2595 * @retval PMINFO_R_EINVAL invalid argument
2596 * @retval PMINFO_R_ERROR internal error
2598 static int get_localed_label(const char *appid, const char *locale)
2603 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2604 if (ret != PMINFO_R_OK)
2607 printf("localed label: %s\n", label);
2615 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2616 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2619 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2620 * @brief This API gets metadata value by given metadata key
2622 * @par This API is for package-manager client application
2623 * @par Sync (or) Async : Synchronous API
2625 * @param[in] handle pointer to the application info handle
2626 * @param[in] metadata_key metadata key
2627 * @param[out] metadata_value pointer to hold metadata value
2628 * @return 0 if success, error code(<0) if fail
2629 * @retval PMINFO_R_OK success
2630 * @retval PMINFO_R_EINVAL invalid argument
2632 static int get_metadata_value(const char *appid, const char *metadata_key)
2635 pkgmgrinfo_appinfo_h handle = NULL;
2636 char *metadata_value = NULL;
2638 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2639 if (ret != PMINFO_R_OK)
2642 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2643 if (ret != PMINFO_R_OK) {
2644 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2648 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2653 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2656 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2657 * @brief This API gets the component of the application
2659 * @par This API is for package-manager client application
2660 * @par Sync (or) Async : Synchronous API
2662 * @param[in] handle pointer to the application info handle.
2663 * @param[out] component pointer to hold app component
2664 * @return 0 if success, error code(<0) if fail
2665 * @retval PMINFO_R_OK success
2666 * @retval PMINFO_R_EINVAL invalid argument
2667 * @retval PMINFO_R_ERROR internal error
2668 * @pre pkgmgrinfo_appinfo_get_appinfo()
2669 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2670 * @see pkgmgrinfo_appinfo_get_appid()
2671 * @see pkgmgrinfo_appinfo_is_multiple()
2673 static int get_app_component(const char *appid)
2676 pkgmgrinfo_app_component component;
2677 pkgmgrinfo_appinfo_h handle;
2678 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2679 if (ret != PMINFO_R_OK)
2681 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2682 if (ret != PMINFO_R_OK) {
2683 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2686 printf("component : %s\n", component);
2687 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2692 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2695 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2696 * @brief This API gets the apptype of the application
2698 * @par This API is for package-manager client application
2699 * @par Sync (or) Async : Synchronous API
2701 * @param[in] handle pointer to the application info handle.
2702 * @param[out] app_type pointer to hold apptype
2703 * @return 0 if success, error code(<0) if fail
2704 * @retval PMINFO_R_OK success
2705 * @retval PMINFO_R_EINVAL invalid argument
2706 * @retval PMINFO_R_ERROR internal error
2707 * @pre pkgmgrinfo_appinfo_get_appinfo()
2708 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2709 * @see pkgmgrinfo_appinfo_get_appid()
2710 * @see pkgmgrinfo_appinfo_is_multiple()
2712 static int get_app_type(const char *appid)
2715 char *apptype = NULL;
2716 pkgmgrinfo_appinfo_h handle;
2717 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2718 if (ret != PMINFO_R_OK)
2720 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2721 if (ret != PMINFO_R_OK) {
2722 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2725 printf("apptype : %s\n", apptype);
2726 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2731 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2734 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2735 int *operation_count, char ***operation)
2736 * @brief This API gets the list of operation of the application
2738 * @par This API is for package-manager client application
2739 * @par Sync (or) Async : Synchronous API
2741 * @param[in] handle pointer to the appcontrol handle.
2742 * @param[out] operation_count pointer to hold number of operations
2743 * @param[out] operation pointer to hold list of operations
2744 * @return 0 if success, error code(<0) if fail
2745 * @retval PMINFO_R_OK success
2746 * @retval PMINFO_R_EINVAL invalid argument
2747 * @retval PMINFO_R_ERROR internal error
2748 * @pre pkgmgrinfo_appinfo_get_appinfo()
2749 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2750 * @see pkgmgrinfo_appinfo_get_uri()
2751 * @see pkgmgrinfo_appinfo_get_mime()
2753 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2758 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2759 for (i = 0; i < oc; i++) {
2760 if (strcmp(operation[i], (char *)user_data) == 0)
2767 static int check_operation(const char *appid, char *operation)
2770 pkgmgrinfo_appinfo_h handle;
2771 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2772 if (ret != PMINFO_R_OK)
2774 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2775 if (ret != PMINFO_R_OK) {
2776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2779 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2784 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2785 int *operation_count, char ***operation);
2788 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2789 int *uri_count, char ***uri)
2790 * @brief This API gets the list of uri of the application
2792 * @par This API is for package-manager client application
2793 * @par Sync (or) Async : Synchronous API
2795 * @param[in] handle pointer to the appcontrol handle.
2796 * @param[out] uri_count pointer to hold number of uris
2797 * @param[out] uri pointer to hold list of uris
2798 * @return 0 if success, error code(<0) if fail
2799 * @retval PMINFO_R_OK success
2800 * @retval PMINFO_R_EINVAL invalid argument
2801 * @retval PMINFO_R_ERROR internal error
2802 * @pre pkgmgrinfo_appinfo_get_appinfo()
2803 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2804 * @see pkgmgrinfo_appinfo_get_operation()
2805 * @see pkgmgrinfo_appinfo_get_mime()
2807 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2812 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2813 for (i = 0; i < uc; i++) {
2814 if (strcmp(uri[i], (char *)user_data) == 0)
2821 static int check_uri(const char *appid, char *uri)
2824 pkgmgrinfo_appinfo_h handle;
2825 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2826 if (ret != PMINFO_R_OK)
2828 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2829 if (ret != PMINFO_R_OK) {
2830 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2833 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2838 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2839 int *uri_count, char ***uri);
2842 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2843 int *mime_count, char ***mime)
2844 * @brief This API gets the list of mime of the application
2846 * @par This API is for package-manager client application
2847 * @par Sync (or) Async : Synchronous API
2849 * @param[in] handle pointer to the appcontrol handle.
2850 * @param[out] mime_count pointer to hold number of mimes
2851 * @param[out] mime pointer to hold list of mimes
2852 * @return 0 if success, error code(<0) if fail
2853 * @retval PMINFO_R_OK success
2854 * @retval PMINFO_R_EINVAL invalid argument
2855 * @retval PMINFO_R_ERROR internal error
2856 * @pre pkgmgrinfo_appinfo_get_appinfo()
2857 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2858 * @see pkgmgrinfo_appinfo_get_uri()
2859 * @see pkgmgrinfo_appinfo_get_operation()
2861 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2866 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2867 for (i = 0; i < mc; i++) {
2868 if (strcmp(mime[i], (char *)user_data) == 0)
2875 static int check_mime(const char *appid, char *mime)
2878 pkgmgrinfo_appinfo_h handle;
2879 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2880 if (ret != PMINFO_R_OK)
2882 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2883 if (ret != PMINFO_R_OK) {
2884 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2887 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2892 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2893 int *mime_count, char ***mime);
2896 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2897 int *subapp_count, char ***subapp)
2898 * @brief This API gets the list of subapp of the application
2900 * @par This API is for package-manager client application
2901 * @par Sync (or) Async : Synchronous API
2903 * @param[in] handle pointer to the appcontrol handle.
2904 * @param[out] subapp_count pointer to hold number of subapp
2905 * @param[out] subapp pointer to hold list of subapp
2906 * @return 0 if success, error code(<0) if fail
2907 * @retval PMINFO_R_OK success
2908 * @retval PMINFO_R_EINVAL invalid argument
2909 * @retval PMINFO_R_ERROR internal error
2910 * @pre pkgmgrinfo_appinfo_get_appinfo()
2911 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2912 * @see pkgmgrinfo_appinfo_get_uri()
2913 * @see pkgmgrinfo_appinfo_get_operation()
2915 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2919 char **subapp = NULL;
2920 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2921 for (i = 0; i < sc; i++) {
2922 if (strcmp(subapp[i], (char *)user_data) == 0)
2929 static int check_subapp(const char *appid, char *subapp)
2932 pkgmgrinfo_appinfo_h handle = NULL;
2933 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2934 if (ret != PMINFO_R_OK)
2936 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2937 if (ret != PMINFO_R_OK) {
2938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2941 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2946 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2947 int *subapp_count, char ***subapp);
2950 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2951 * @brief This API gets the notification icon of the application
2953 * @par This API is for package-manager client application
2954 * @par Sync (or) Async : Synchronous API
2956 * @param[in] handle pointer to the application info handle.
2957 * @param[out] path pointer to hold notification icon
2958 * @return 0 if success, error code(<0) if fail
2959 * @retval PMINFO_R_OK success
2960 * @retval PMINFO_R_EINVAL invalid argument
2961 * @retval PMINFO_R_ERROR internal error
2962 * @pre pkgmgrinfo_appinfo_get_appinfo()
2963 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2964 * @see pkgmgrinfo_appinfo_get_appid()
2965 * @see pkgmgrinfo_appinfo_is_multiple()
2967 static int get_app_notification_icon(const char *appid)
2970 char *notification_icon = NULL;
2971 pkgmgrinfo_appinfo_h handle;
2972 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2973 if (ret != PMINFO_R_OK)
2975 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2976 if (ret != PMINFO_R_OK) {
2977 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2980 printf("notification icon : %s\n", notification_icon);
2981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2986 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2989 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2990 * @brief This API gets the setting icon of the application
2992 * @par This API is for package-manager client application
2993 * @par Sync (or) Async : Synchronous API
2995 * @param[in] handle pointer to the application info handle.
2996 * @param[out] path pointer to hold setting icon
2997 * @return 0 if success, error code(<0) if fail
2998 * @retval PMINFO_R_OK success
2999 * @retval PMINFO_R_EINVAL invalid argument
3000 * @retval PMINFO_R_ERROR internal error
3001 * @pre pkgmgrinfo_appinfo_get_appinfo()
3002 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3003 * @see pkgmgrinfo_appinfo_get_appid()
3004 * @see pkgmgrinfo_appinfo_is_multiple()
3006 static int get_app_setting_icon(const char *appid)
3009 char *setting_icon = NULL;
3010 pkgmgrinfo_appinfo_h handle;
3011 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3012 if (ret != PMINFO_R_OK)
3014 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3015 if (ret != PMINFO_R_OK) {
3016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3019 printf("setting icon : %s\n", setting_icon);
3020 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3025 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3028 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3029 * @brief This API gets the type of recent image on app-tray
3031 * @par This API is for package-manager client application
3032 * @par Sync (or) Async : Synchronous API
3034 * @param[in] handle pointer to the application info handle.
3035 * @param[out] type pointer to hold image type
3036 * @return 0 if success, error code(<0) if fail
3037 * @retval PMINFO_R_OK success
3038 * @retval PMINFO_R_EINVAL invalid argument
3039 * @retval PMINFO_R_ERROR internal error
3040 * @pre pkgmgrinfo_appinfo_get_appinfo()
3041 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3042 * @see pkgmgrinfo_appinfo_get_appid()
3043 * @see pkgmgrinfo_appinfo_is_multiple()
3045 static int get_app_recent_image_type(const char *appid)
3048 pkgmgrinfo_app_recentimage type;
3049 pkgmgrinfo_appinfo_h handle;
3050 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3051 if (ret != PMINFO_R_OK)
3053 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3054 if (ret != PMINFO_R_OK) {
3055 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3058 printf("recent image type: %d\n", type);
3059 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3064 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3068 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3069 * @brief This API gets the preview image of application
3071 * @par Sync (or) Async : Synchronous API
3073 * @param[in] handle pointer to the application info handle.
3074 * @param[out] preview_img pointer to hold preview image path
3075 * @return 0 if success, error code(<0) if fail
3076 * @retval PMINFO_R_OK success
3077 * @retval PMINFO_R_EINVAL invalid argument
3078 * @retval PMINFO_R_ERROR internal error
3079 * @pre pkgmgrinfo_appinfo_get_appinfo()
3080 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3081 * @see pkgmgrinfo_appinfo_get_appid()
3083 static int get_app_previewimage(const char *appid)
3086 char *preview = NULL;
3087 pkgmgrinfo_appinfo_h handle = NULL;
3088 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3089 if (ret != PMINFO_R_OK)
3091 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3092 if (ret != PMINFO_R_OK) {
3093 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3096 printf("preview image path : %s\n", preview);
3097 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3102 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3106 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3107 * @brief This API gets the package permission type of the application
3109 * @par This API is for package-manager client application
3110 * @par Sync (or) Async : Synchronous API
3112 * @param[in] handle pointer to the application info handle.
3113 * @param[out] permission pointer to hold package permission
3114 * @return 0 if success, error code(<0) if fail
3115 * @retval PMINFO_R_OK success
3116 * @retval PMINFO_R_EINVAL invalid argument
3117 * @retval PMINFO_R_ERROR internal error
3118 * @pre pkgmgrinfo_appinfo_get_appinfo()
3119 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3120 * @see pkgmgrinfo_appinfo_get_appid()
3122 static int get_app_permission(const char *appid)
3125 pkgmgrinfo_permission_type permission = 0;
3126 pkgmgrinfo_appinfo_h handle;
3128 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3129 if (ret != PMINFO_R_OK)
3131 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3132 if (ret != PMINFO_R_OK) {
3133 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3136 printf("permission type: %d\n", permission);
3137 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3142 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3145 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3146 * @brief This API gets the component_type
3148 * @par This API is for package-manager client application
3149 * @par Sync (or) Async : Synchronous API
3151 * @param[in] handle pointer to the application info handle.
3152 * @param[out] component_type pointer to hold component_type
3153 * @return 0 if success, error code(<0) if fail
3154 * @retval PMINFO_R_OK success
3155 * @retval PMINFO_R_EINVAL invalid argument
3156 * @retval PMINFO_R_ERROR internal error
3157 * @pre pkgmgrinfo_appinfo_get_appinfo()
3158 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3159 * @see pkgmgrinfo_appinfo_get_pkgid()
3160 * @see pkgmgrinfo_appinfo_is_multiple()
3162 static int get_component_type(const char *appid)
3165 char *component_type = NULL;
3166 pkgmgrinfo_appinfo_h handle;
3167 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3168 if (ret != PMINFO_R_OK)
3170 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3171 if (ret != PMINFO_R_OK) {
3172 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3175 printf("component_type: %s\n", component_type);
3176 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3181 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3184 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3185 * @brief This API gets the application 'hwacceleration' value from the app ID
3187 * @par This API is for package-manager client application
3188 * @par Sync (or) Async : Synchronous API
3190 * @param[in] handle pointer to application info handle
3191 * @param[out] hwacceleration pointer to hold package hwacceleration value
3192 * @return 0 if success, error code(<0) if fail
3193 * @retval PMINFO_R_OK success
3194 * @retval PMINFO_R_EINVAL invalid argument
3195 * @retval PMINFO_R_ERROR internal error
3196 * @pre pkgmgrinfo_appinfo_get_appinfo()
3197 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3198 * @see pkgmgrinfo_appinfo_get_appid()
3199 * @see pkgmgrinfo_appinfo_is_multiple()
3201 static int get_app_hwacceleration(const char *appid)
3204 pkgmgrinfo_app_hwacceleration hwacceleration;
3205 pkgmgrinfo_appinfo_h handle;
3206 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3207 if (ret != PMINFO_R_OK)
3209 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3210 if (ret != PMINFO_R_OK) {
3211 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3214 printf("app hwacceleration: %d\n", hwacceleration);
3215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3220 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3223 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3224 * @brief This API gets the application 'screenreader' value from the app ID
3226 * @par This API is for package-manager client application
3227 * @par Sync (or) Async : Synchronous API
3229 * @param[in] handle pointer to application info handle
3230 * @param[out] screenreader pointer to hold package accessibility value
3231 * @return 0 if success, error code(<0) if fail
3232 * @retval PMINFO_R_OK success
3233 * @retval PMINFO_R_EINVAL invalid argument
3234 * @retval PMINFO_R_ERROR internal error
3235 * @pre pkgmgrinfo_appinfo_get_appinfo()
3236 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3237 * @see pkgmgrinfo_appinfo_get_appid()
3238 * @see pkgmgrinfo_appinfo_is_multiple()
3240 static int get_app_screenreader(const char *appid)
3243 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3244 pkgmgrinfo_appinfo_h handle = NULL;
3245 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3246 if (ret != PMINFO_R_OK)
3248 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3249 if (ret != PMINFO_R_OK) {
3250 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3253 printf("app screenreader: %d\n", screenreader);
3254 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3259 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3262 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3263 * @brief This API gets the application's landscape & portrait effect images
3265 * @par This API is for package-manager client application
3266 * @par Sync (or) Async : Synchronous API
3268 * @param[in] handle pointer to application info handle
3269 * @param[out] portrait_img contains portrait mode effect image
3270 * @param[out] landscape_img contains landscape mode effect image
3271 * @return 0 if success, error code(<0) if fail
3272 * @retval PMINFO_R_OK success
3273 * @retval PMINFO_R_EINVAL invalid argument
3274 * @retval PMINFO_R_ERROR internal error
3275 * @pre pkgmgrinfo_appinfo_get_appinfo()
3276 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3277 * @see pkgmgrinfo_appinfo_get_appid()
3278 * @see pkgmgrinfo_appinfo_is_nodisplay()
3280 static int get_app_effectimages(const char *appid)
3283 char *portraitimg = NULL;
3284 char *landscapeimg = NULL;
3285 pkgmgrinfo_appinfo_h handle;
3286 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3287 if (ret != PMINFO_R_OK)
3289 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3290 if (ret != PMINFO_R_OK) {
3291 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3294 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3295 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3300 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3303 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3304 * @brief This API gets the application's effect image type
3306 * @par This API is for package-manager client application
3307 * @par Sync (or) Async : Synchronous API
3309 * @param[in] handle pointer to application info handle
3310 * @param[out] effectimg_type contains effect image type
3311 * @return 0 if success, error code(<0) if fail
3312 * @retval PMINFO_R_OK success
3313 * @retval PMINFO_R_EINVAL invalid argument
3314 * @retval PMINFO_R_ERROR internal error
3315 * @pre pkgmgrinfo_appinfo_get_appinfo()
3316 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3317 * @see pkgmgrinfo_appinfo_get_appid()
3318 * @see pkgmgrinfo_appinfo_is_nodisplay()
3320 static int get_app_effectimage_type(const char *appid)
3323 char *effectimg_type = NULL;
3324 pkgmgrinfo_appinfo_h handle = NULL;
3325 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3326 if (ret != PMINFO_R_OK)
3328 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3329 if (ret != PMINFO_R_OK) {
3330 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3333 printf("app effect image type: %s\n", effectimg_type);
3334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3339 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3342 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3343 * @brief This API gets the submode_mainid of the application
3345 * @par This API is for package-manager client application
3346 * @par Sync (or) Async : Synchronous API
3348 * @param[in] handle pointer to the application info handle.
3349 * @param[out] submode_mainid pointer to hold package name
3350 * @return 0 if success, error code(<0) if fail
3351 * @retval PMINFO_R_OK success
3352 * @retval PMINFO_R_EINVAL invalid argument
3353 * @retval PMINFO_R_ERROR internal error
3354 * @pre pkgmgrinfo_appinfo_get_appinfo()
3355 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3356 * @see pkgmgrinfo_appinfo_get_appid()
3357 * @see pkgmgrinfo_appinfo_is_multiple()
3359 static int get_app_submode_mainid(const char *appid)
3362 char *submode_mainid = NULL;
3363 pkgmgrinfo_appinfo_h handle = NULL;
3364 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3365 if (ret != PMINFO_R_OK)
3367 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3368 if (ret != PMINFO_R_OK) {
3369 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3372 printf("submode_mainid: %s\n", submode_mainid);
3373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3378 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3381 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3382 * @brief This API gets the datacontrol info
3384 * @par This API is for package-manager client application
3385 * @par Sync (or) Async : Synchronous API
3387 * @param[in] providerid pointer to the providerid of dataconltrol.
3388 * @param[in] type pointer to the type of dataconltrol.
3389 * @param[out] appid pointer to hold appid, need to free after using
3390 * @param[out] access pointer to hold access, need to free after using
3391 * @return 0 if success, error code(<0) if fail
3392 * @retval PMINFO_R_OK success
3393 * @retval PMINFO_R_EINVAL invalid argument
3394 * @retval PMINFO_R_ERROR internal error
3397 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3398 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3401 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3402 * @brief This API gets the appid of datacontrol
3404 * @par This API is for package-manager client application
3405 * @par Sync (or) Async : Synchronous API
3407 * @param[in] providerid pointer to the providerid of dataconltrol.
3408 * @param[out] appid pointer to hold appid, need to free after using
3409 * @return 0 if success, error code(<0) if fail
3410 * @retval PMINFO_R_OK success
3411 * @retval PMINFO_R_EINVAL invalid argument
3412 * @retval PMINFO_R_ERROR internal error
3415 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3416 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3419 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3420 * @brief This API gets the alias_appid of the application
3422 * @par This API is for package-manager client application
3423 * @par Sync (or) Async : Synchronous API
3425 * @param[in] handle pointer to the application info handle.
3426 * @param[out] alias_appid pointer to hold app alias_appid
3427 * @return 0 if success, error code(<0) if fail
3428 * @retval PMINFO_R_OK success
3429 * @retval PMINFO_R_EINVAL invalid argument
3430 * @retval PMINFO_R_ERROR internal error
3431 * @pre pkgmgrinfo_appinfo_get_appinfo()
3432 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3433 * @see pkgmgrinfo_appinfo_get_appid()
3435 static int get_alias_appid(const char *appid)
3438 char *alias_appid= 0;
3439 pkgmgrinfo_appinfo_h handle = NULL;
3440 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3441 if (ret != PMINFO_R_OK)
3443 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3444 if (ret != PMINFO_R_OK) {
3445 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3448 printf("alias_appid: %s\n", alias_appid);
3449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3454 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3457 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3458 * @brief This API gets the effective_appid of the application
3460 * @par This API is for package-manager client application
3461 * @par Sync (or) Async : Synchronous API
3463 * @param[in] handle pointer to the application info handle.
3464 * @param[out] effective_appid pointer to hold app effective_appid
3465 * @return 0 if success, error code(<0) if fail
3466 * @retval PMINFO_R_OK success
3467 * @retval PMINFO_R_EINVAL invalid argument
3468 * @retval PMINFO_R_ERROR internal error
3469 * @pre pkgmgrinfo_appinfo_get_appinfo()
3470 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3471 * @see pkgmgrinfo_appinfo_get_appid()
3473 static int get_effective_appid(const char *appid)
3476 char *effective_appid= 0;
3477 pkgmgrinfo_appinfo_h handle = NULL;
3478 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3479 if (ret != PMINFO_R_OK)
3481 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3482 if (ret != PMINFO_R_OK) {
3483 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3486 printf("effective_appid: %s\n", effective_appid);
3487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3492 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3495 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3496 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3498 * @par This API is for package-manager client application
3499 * @par Sync (or) Async : Synchronous API
3501 * @param[in] handle pointer to the appinfo handle.
3502 * @param[out] tep_name pointer to hold tep name
3503 * @return 0 if success, error code(<0) if fail
3504 * @retval PMINFO_R_OK success
3505 * @retval PMINFO_R_EINVAL invalid argument
3506 * @retval PMINFO_R_ERROR internal error
3507 * @pre pkgmgrinfo_appinfo_get_appinfo()
3508 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3509 * @see pkgmgrinfo_appinfo_get_appid()
3511 static int get_tep_name(const char *appid)
3514 char *tep_name = NULL;
3515 pkgmgrinfo_appinfo_h handle = NULL;
3516 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3517 if (ret != PMINFO_R_OK)
3519 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3520 if (ret != PMINFO_R_OK) {
3521 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3524 printf("TEP name is: %s\n", tep_name);
3525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3530 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3533 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3534 * @brief This API gets zip mount file name associated with the package which contain given application
3535 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3537 * @par This API is for package-manager client application
3538 * @par Sync (or) Async : Synchronous API
3540 * @param[in] handle pointer to the appinfo handle.
3541 * @param[out] zip_mount_file pointer to hold zip mount file name
3542 * @return 0 if success, error code(<0) if fail
3543 * @retval PMINFO_R_OK success
3544 * @retval PMINFO_R_EINVAL invalid argument
3545 * @retval PMINFO_R_ERROR internal error
3546 * @pre pkgmgrinfo_appinfo_get_appinfo()
3547 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3548 * @see pkgmgrinfo_appinfo_get_appid()
3550 static int get_zip_mount_file(const char *appid)
3553 char *zip_mount_file = NULL;
3554 pkgmgrinfo_appinfo_h handle = NULL;
3555 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3556 if (ret != PMINFO_R_OK)
3558 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3559 if (ret != PMINFO_R_OK) {
3560 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3563 printf("Mount file name is: %s\n", zip_mount_file);
3564 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3569 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3572 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3573 * @brief This API gets the root path of application
3575 * @par Sync (or) Async : Synchronous API
3577 * @param[in] handle pointer to appinfo handle
3578 * @param[out] path pointer to hold root path of application
3579 * @return 0 if success, error code(<0) if fail
3580 * @retval PMINFO_R_OK success
3581 * @retval PMINFO_R_EINVAL invalid argument
3582 * @retval PMINFO_R_ERROR internal error
3584 static int get_root_path(const char *appid)
3588 pkgmgrinfo_appinfo_h handle;
3589 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3590 if (ret != PMINFO_R_OK)
3593 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3594 if (ret != PMINFO_R_OK) {
3595 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3598 printf("path : %s\n", path);
3599 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3605 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3608 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3609 * @brief This API gets the application api_version from the application ID
3611 * @par This API is for package-manager client application
3612 * @par Sync (or) Async : Synchronous API
3614 * @param[in] handle pointer to appinfo handle
3615 * @param[out] api_version pointer to hold application api_version
3616 * @return 0 if success, error code(<0) if fail
3617 * @retval PMINFO_R_OK success
3618 * @retval PMINFO_R_EINVAL invalid argument
3619 * @retval PMINFO_R_ERROR internal error
3620 * @pre pkgmgrinfo_appinfo_get_appinfo()
3621 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3622 * @see pkgmgrinfo_appinfo_get_appid()
3624 static int get_app_api_version(const char *appid)
3627 char *api_version = NULL;
3628 pkgmgrinfo_appinfo_h handle = NULL;
3629 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3630 if (ret != PMINFO_R_OK)
3632 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3633 if (ret != PMINFO_R_OK) {
3634 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3637 printf("app api_version: %s\n", api_version);
3638 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3643 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3646 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3647 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3648 * @brief This API gets the list of permission for a particular application
3650 * @par This API is for package-manager client application
3651 * @par Sync (or) Async : Synchronous API
3652 * @param[in] handle pointer to the application info handle.
3653 * @param[in] permission_func callback function for list
3654 * @param[in] user_data user data to be passed to callback function
3655 * @return 0 if success, error code(<0) if fail
3656 * @retval PMINFO_R_OK success
3657 * @retval PMINFO_R_EINVAL invalid argument
3658 * @retval PMINFO_R_ERROR internal error
3659 * @pre pkgmgrinfo_appinfo_get_appinfo()
3660 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3662 int permission_func(const char *name, void *user_data)
3664 if (strcmp(name, (char *)user_data) == 0)
3670 static int list_permission(const char *appid, char *permission)
3673 pkgmgrinfo_appinfo_h handle;
3674 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3675 if (ret != PMINFO_R_OK)
3677 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3678 if (ret != PMINFO_R_OK) {
3679 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3682 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3687 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3688 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3691 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3692 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3693 * @brief This API gets the list of category for a particular application
3695 * @par This API is for package-manager client application
3696 * @par Sync (or) Async : Synchronous API
3697 * @param[in] handle pointer to the application info handle.
3698 * @param[in] category_func callback function for list
3699 * @param[in] user_data user data to be passed to callback function
3700 * @return 0 if success, error code(<0) if fail
3701 * @retval PMINFO_R_OK success
3702 * @retval PMINFO_R_EINVAL invalid argument
3703 * @retval PMINFO_R_ERROR internal error
3704 * @pre pkgmgrinfo_appinfo_get_appinfo()
3705 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3707 int category_func(const char *name, void *user_data)
3709 if (strcmp(name, (char *)user_data) == 0)
3715 static int list_category(const char *appid, char *category)
3718 pkgmgrinfo_appinfo_h handle;
3719 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3720 if (ret != PMINFO_R_OK)
3722 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3723 if (ret != PMINFO_R_OK) {
3724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3727 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3732 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3733 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3736 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3737 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3738 * @brief This API gets the list of metadata for a particular application
3740 * @par This API is for package-manager client application
3741 * @par Sync (or) Async : Synchronous API
3742 * @param[in] handle pointer to the application info handle.
3743 * @param[in] metadata_func callback function for list
3744 * @param[in] user_data user data to be passed to callback function
3745 * @return 0 if success, error code(<0) if fail
3746 * @retval PMINFO_R_OK success
3747 * @retval PMINFO_R_EINVAL invalid argument
3748 * @retval PMINFO_R_ERROR internal error
3749 * @pre pkgmgrinfo_appinfo_get_appinfo()
3750 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3752 int metadata_func(const char *key, const char *value, void *user_data)
3754 if (strcmp(key, (char *)user_data) == 0) {
3755 printf("Value is %s\n", value);
3762 static int list_metadata(const char *appid, char *key)
3765 pkgmgrinfo_appinfo_h handle;
3766 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3767 if (ret != PMINFO_R_OK)
3769 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3770 if (ret != PMINFO_R_OK) {
3771 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3779 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3780 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3784 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3785 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3786 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3787 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3788 * @brief This API gets the list of app-control for a particular application
3790 * @par This API is for package-manager client application
3791 * @par Sync (or) Async : Synchronous API
3792 * @param[in] handle pointer to the application info handle.
3793 * @param[in] appcontrol_func callback function for list
3794 * @param[in] user_data user data to be passed to callback function
3795 * @param[in] uid the addressee user id of the instruction
3796 * @return 0 if success, error code(<0) if fail
3797 * @retval PMINFO_R_OK success
3798 * @retval PMINFO_R_EINVAL invalid argument
3799 * @retval PMINFO_R_ERROR internal error
3800 * @pre pkgmgrinfo_appinfo_get_appinfo()
3801 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3803 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3808 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3809 for (i = 0; i < oc; i++) {
3810 if (strcmp(operation[i], (char *)user_data) == 0)
3817 static int check_operation(const char *appid, char *operation)
3820 pkgmgrinfo_appinfo_h handle;
3821 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3822 if (ret != PMINFO_R_OK)
3824 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3825 if (ret != PMINFO_R_OK) {
3826 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3829 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3834 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3835 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3840 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3841 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3844 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3845 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3846 * @brief This API gets the list of splashscreen for a particular application
3848 * @par This API is for package-manager client application
3849 * @par Sync (or) Async : Synchronous API
3850 * @param[in] handle pointer to the application info handle.
3851 * @param[in] splash_screen_func callback function for list
3852 * @param[in] user_data user data to be passed to callback function
3853 * @return 0 if success, error code(<0) if fail
3854 * @retval PMINFO_R_OK success
3855 * @retval PMINFO_R_EINVAL invalid argument
3856 * @retval PMINFO_R_ERROR internal error
3857 * @pre pkgmgrinfo_appinfo_get_appinfo()
3858 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3861 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3862 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3865 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3866 * @brief This API gets the application 'nodisplay' value from the app ID
3868 * @par This API is for package-manager client application
3869 * @par Sync (or) Async : Synchronous API
3871 * @param[in] handle pointer to application info handle
3872 * @param[out] nodisplay pointer to hold package nodisplay value
3873 * @return 0 if success, error code(<0) if fail
3874 * @retval PMINFO_R_OK success
3875 * @retval PMINFO_R_EINVAL invalid argument
3876 * @retval PMINFO_R_ERROR internal error
3877 * @pre pkgmgrinfo_appinfo_get_appinfo()
3878 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3879 * @see pkgmgrinfo_appinfo_get_appid()
3880 * @see pkgmgrinfo_appinfo_is_multiple()
3882 static int get_app_nodisplay(const char *appid)
3886 pkgmgrinfo_appinfo_h handle;
3887 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3888 if (ret != PMINFO_R_OK)
3890 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3891 if (ret != PMINFO_R_OK) {
3892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3895 printf("app nodisplay: %d\n", nodisplay);
3896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3901 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3904 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3905 * @brief This API gets the application 'multiple' value from the app ID
3907 * @par This API is for package-manager client application
3908 * @par Sync (or) Async : Synchronous API
3910 * @param[in] handle pointer to application info handle
3911 * @param[out] multiple pointer to hold package multiple value
3912 * @return 0 if success, error code(<0) if fail
3913 * @retval PMINFO_R_OK success
3914 * @retval PMINFO_R_EINVAL invalid argument
3915 * @retval PMINFO_R_ERROR internal error
3916 * @pre pkgmgrinfo_appinfo_get_appinfo()
3917 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3918 * @see pkgmgrinfo_appinfo_get_appid()
3919 * @see pkgmgrinfo_appinfo_is_nodisplay()
3921 static int get_app_multiple(const char *appid)
3925 pkgmgrinfo_appinfo_h handle;
3926 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3927 if (ret != PMINFO_R_OK)
3929 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3930 if (ret != PMINFO_R_OK) {
3931 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3934 printf("app multiple: %d\n", multiple);
3935 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3940 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3943 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3944 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3945 * application launching effect. If fales, indicator will be hidden during application launching effect
3947 * @par This API is for package-manager client application
3948 * @par Sync (or) Async : Synchronous API
3950 * @param[in] handle pointer to application info handle
3951 * @param[out] indicator_disp contains indicator display status for application launching effect
3952 * @return 0 if success, error code(<0) if fail
3953 * @retval PMINFO_R_OK success
3954 * @retval PMINFO_R_EINVAL invalid argument
3955 * @retval PMINFO_R_ERROR internal error
3956 * @pre pkgmgrinfo_appinfo_get_appinfo()
3957 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3958 * @see pkgmgrinfo_appinfo_get_appid()
3959 * @see pkgmgrinfo_appinfo_is_nodisplay()
3961 static int get_app_indicator_display(const char *appid)
3964 bool indicator_disp;
3965 pkgmgrinfo_appinfo_h handle;
3966 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3967 if (ret != PMINFO_R_OK)
3969 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3970 if (ret != PMINFO_R_OK){
3971 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3974 printf("app indicator disp : %d\n", indicator_disp);
3975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3980 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3983 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3984 * @brief This API gets the application 'taskmanage' value from the app ID
3986 * @par This API is for package-manager client application
3987 * @par Sync (or) Async : Synchronous API
3989 * @param[in] handle pointer to application info handle
3990 * @param[out] taskmanage pointer to hold package taskmanage value
3991 * @return 0 if success, error code(<0) if fail
3992 * @retval PMINFO_R_OK success
3993 * @retval PMINFO_R_EINVAL invalid argument
3994 * @retval PMINFO_R_ERROR internal error
3995 * @pre pkgmgrinfo_appinfo_get_appinfo()
3996 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3997 * @see pkgmgrinfo_appinfo_get_appid()
3998 * @see pkgmgrinfo_appinfo_is_multiple()
4000 static int get_app_taskmanage(const char *appid)
4004 pkgmgrinfo_appinfo_h handle;
4005 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4006 if (ret != PMINFO_R_OK)
4008 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4009 if (ret != PMINFO_R_OK) {
4010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4013 printf("app taskmanage: %d\n", taskmanage);
4014 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4019 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4022 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4023 * @brief This API gets the application 'taskmanage' value from the app ID
4025 * @par This API is for package-manager client application
4026 * @par Sync (or) Async : Synchronous API
4028 * @param[in] handle pointer to application info handle
4029 * @param[out] enabled pointer to hold package enabled value
4030 * @return 0 if success, error code(<0) if fail
4031 * @retval PMINFO_R_OK success
4032 * @retval PMINFO_R_EINVAL invalid argument
4033 * @retval PMINFO_R_ERROR internal error
4034 * @pre pkgmgrinfo_appinfo_get_appinfo()
4035 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4036 * @see pkgmgrinfo_appinfo_get_appid()
4037 * @see pkgmgrinfo_appinfo_is_multiple()
4039 static int get_app_enabled(const char *appid)
4043 pkgmgrinfo_appinfo_h handle;
4044 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4045 if (ret != PMINFO_R_OK)
4047 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4048 if (ret != PMINFO_R_OK) {
4049 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4052 printf("app enabled: %d\n", enabled);
4053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4058 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4061 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4062 * @brief This API gets the application 'onboot' value from the app ID
4064 * @par This API is for package-manager client application
4065 * @par Sync (or) Async : Synchronous API
4067 * @param[in] handle pointer to application info handle
4068 * @param[out] onboot pointer to hold package onboot value
4069 * @return 0 if success, error code(<0) if fail
4070 * @retval PMINFO_R_OK success
4071 * @retval PMINFO_R_EINVAL invalid argument
4072 * @retval PMINFO_R_ERROR internal error
4073 * @pre pkgmgrinfo_appinfo_get_appinfo()
4074 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4075 * @see pkgmgrinfo_appinfo_get_appid()
4076 * @see pkgmgrinfo_appinfo_is_multiple()
4078 static int get_app_onboot(const char *appid)
4082 pkgmgrinfo_appinfo_h handle;
4083 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4084 if (ret != PMINFO_R_OK)
4086 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4087 if (ret != PMINFO_R_OK) {
4088 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4091 printf("app onboot: %d\n", onboot);
4092 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4097 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4100 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4101 * @brief This API gets the application 'autorestart' value from the app ID
4103 * @par This API is for package-manager client application
4104 * @par Sync (or) Async : Synchronous API
4106 * @param[in] handle pointer to application info handle
4107 * @param[out] autorestart pointer to hold package autorestart value
4108 * @return 0 if success, error code(<0) if fail
4109 * @retval PMINFO_R_OK success
4110 * @retval PMINFO_R_EINVAL invalid argument
4111 * @retval PMINFO_R_ERROR internal error
4112 * @pre pkgmgrinfo_appinfo_get_appinfo()
4113 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4114 * @see pkgmgrinfo_appinfo_get_appid()
4115 * @see pkgmgrinfo_appinfo_is_multiple()
4117 static int get_app_autorestart(const char *appid)
4121 pkgmgrinfo_appinfo_h handle;
4122 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4123 if (ret != PMINFO_R_OK)
4125 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4126 if (ret != PMINFO_R_OK) {
4127 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4130 printf("app autorestart: %d\n", autorestart);
4131 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4136 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4139 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4140 * @brief This API gets the value for given application is main app or not from handle
4142 * @par This API is for package-manager client application
4143 * @par Sync (or) Async : Synchronous API
4145 * @param[in] handle pointer to application info handle
4146 * @param[out] mainapp pointer to hold package mainapp is or not
4147 * @return 0 if success, error code(<0) if fail
4148 * @retval PMINFO_R_OK success
4149 * @retval PMINFO_R_EINVAL invalid argument
4150 * @retval PMINFO_R_ERROR internal error
4151 * @pre pkgmgrinfo_appinfo_get_appinfo()
4152 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4153 * @see pkgmgrinfo_appinfo_get_appid()
4154 * @see pkgmgrinfo_appinfo_is_multiple()
4156 static int get_app_mainapp(const char *appid)
4160 pkgmgrinfo_appinfo_h handle;
4161 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4162 if (ret != PMINFO_R_OK)
4164 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4165 if (ret != PMINFO_R_OK) {
4166 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4169 printf("mainapp: %d\n", mainapp);
4170 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4175 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4179 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4180 * @brief This API gets the value for given application is preload or not from handle
4182 * @par This API is for package-manager client application
4183 * @par Sync (or) Async : Synchronous API
4185 * @param[in] handle pointer to application info handle
4186 * @param[out] preload pointer to hold preload is or not
4187 * @return 0 if success, error code(<0) if fail
4188 * @retval PMINFO_R_OK success
4189 * @retval PMINFO_R_EINVAL invalid argument
4190 * @retval PMINFO_R_ERROR internal error
4191 * @pre pkgmgrinfo_appinfo_get_appinfo()
4192 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4193 * @see pkgmgrinfo_appinfo_get_appid()
4194 * @see pkgmgrinfo_appinfo_is_multiple()
4196 static int get_app_preload(const char *appid)
4200 pkgmgrinfo_appinfo_h handle = NULL;
4201 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4202 if (ret != PMINFO_R_OK)
4204 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4205 if (ret != PMINFO_R_OK) {
4206 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4209 printf("preload: %d\n", preload);
4210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4215 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4218 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4219 * @brief This API gets the value for given application is submode or not from handle
4221 * @par This API is for package-manager client application
4222 * @par Sync (or) Async : Synchronous API
4224 * @param[in] handle pointer to application info handle
4225 * @param[out] submode pointer to hold submode is or not
4226 * @return 0 if success, error code(<0) if fail
4227 * @retval PMINFO_R_OK success
4228 * @retval PMINFO_R_EINVAL invalid argument
4229 * @retval PMINFO_R_ERROR internal error
4230 * @pre pkgmgrinfo_appinfo_get_appinfo()
4231 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4232 * @see pkgmgrinfo_appinfo_get_appid()
4233 * @see pkgmgrinfo_appinfo_is_multiple()
4235 static int get_app_submode(const char *appid)
4239 pkgmgrinfo_appinfo_h handle = NULL;
4240 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4241 if (ret != PMINFO_R_OK)
4243 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4244 if (ret != PMINFO_R_OK) {
4245 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4248 printf("submode: %d\n", submode);
4249 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4254 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4257 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4258 * @brief This API gets the value for given application is process_pool or not from handle
4260 * @par This API is for package-manager client application
4261 * @par Sync (or) Async : Synchronous API
4263 * @param[in] handle pointer to application info handle
4264 * @param[out] process_pool pointer to hold process_pool is or not
4265 * @return 0 if success, error code(<0) if fail
4266 * @retval PMINFO_R_OK success
4267 * @retval PMINFO_R_EINVAL invalid argument
4268 * @retval PMINFO_R_ERROR internal error
4269 * @pre pkgmgrinfo_appinfo_get_appinfo()
4270 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4271 * @see pkgmgrinfo_appinfo_get_appid()
4273 static int get_app_process_pool(const char *appid)
4276 bool process_pool = 0;
4277 pkgmgrinfo_appinfo_h handle = NULL;
4278 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4279 if (ret != PMINFO_R_OK)
4281 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4282 if (ret != PMINFO_R_OK) {
4283 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4286 printf("process_pool: %d\n", process_pool);
4287 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4292 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4295 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4296 * @brief This API gets the installed storage location of the application
4298 * @par This API is for package-manager client application
4299 * @par Sync (or) Async : Synchronous API
4301 * @param[in] handle pointer to the application info handle.
4302 * @param[out] app_type pointer to hold installed storage location
4303 * @return 0 if success, error code(<0) if fail
4304 * @retval PMINFO_R_OK success
4305 * @retval PMINFO_R_EINVAL invalid argument
4306 * @retval PMINFO_R_ERROR internal error
4307 * @pre pkgmgrinfo_appinfo_get_appinfo()
4308 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4309 * @see pkgmgrinfo_appinfo_get_appid()
4311 static int get_app_installed_location(const char *appid)
4314 pkgmgrinfo_installed_storage storage;
4315 pkgmgrinfo_appinfo_h handle = NULL;
4316 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4317 if (ret != PMINFO_R_OK)
4319 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4320 if (ret != PMINFO_R_OK) {
4321 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4324 printf("Installed storage location : %d\n", storage);
4325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4330 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4334 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4335 * @brief This API checks if the application has the given category
4337 * @par This API is for package-manager client application
4338 * @par Sync (or) Async : Synchronous API
4340 * @param[in] handle pointer to the application info handle
4341 * @param[in] category category
4342 * @param[out] exist value Gets whether the application has the given category
4343 * @return 0 if success, error code(<0) if fail
4344 * @retval PMINFO_R_OK success
4345 * @retval PMINFO_R_EINVAL invalid argument
4346 * @retval PMINFO_R_ERROR internal error
4348 static int is_category_exist(const char *appid, const char *category)
4351 pkgmgrinfo_appinfo_h handle;
4354 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4355 if (ret != PMINFO_R_OK)
4358 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4359 if (ret != PMINFO_R_OK) {
4360 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4369 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4372 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4373 * @brief This API gets the application 'ui_gadget' 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] ui_gadget pointer to hold package ui_gadget 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_ui_gadget(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_ui_gadget(handle, &ui_gadget);
4395 if (ret != PMINFO_R_OK) {
4396 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4399 printf("app ui_gadget: %d\n", ui_gadget);
4400 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4405 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4408 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4409 * @brief This API gets the application 'support_disable' value from the app ID
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[out] support_disable pointer to hold package support_disable 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 * @pre pkgmgrinfo_appinfo_get_appinfo()
4420 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4422 static int get_app_support_disable(const char *appid)
4425 bool support_disable;
4426 pkgmgrinfo_appinfo_h handle = NULL;
4427 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4428 if (ret != PMINFO_R_OK)
4430 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4431 if (ret != PMINFO_R_OK) {
4432 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4435 printf("app support_disable: %d\n", support_disable);
4436 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4441 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4444 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4445 * @brief This API gets the application 'is_disable' value from the app ID
4447 * @par This API is for package-manager client application
4448 * @par Sync (or) Async : Synchronous API
4450 * @param[in] handle pointer to application info handle
4451 * @param[out] disabled pointer to hold application is_disabled value
4452 * @return 0 if success, error code(<0) if fail
4453 * @retval PMINFO_R_OK success
4454 * @retval PMINFO_R_EINVAL invalid argument
4455 * @pre pkgmgrinfo_appinfo_get_appinfo()
4456 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4458 static int get_app_is_disable(const char *appid)
4462 pkgmgrinfo_appinfo_h handle = NULL;
4463 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4464 if (ret != PMINFO_R_OK)
4466 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4467 if (ret != PMINFO_R_OK) {
4468 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4471 printf("app is_disable: %d\n", is_disable);
4472 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4477 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4480 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4481 * @brief This API gets whethere the given application is global application or user application
4483 * @par This API is for package-manager client application
4484 * @par Sync (or) Async : Synchronous API
4486 * @param[in] handle pointer to application info handle
4487 * @param[in] global pointer to hold application global value
4488 * @return 0 if success, error code(<0) if fail
4489 * @retval PMINFO_R_OK success
4490 * @retval PMINFO_R_EINVAL invalid argument
4491 * @retval PMINFO_R_ERROR internal error
4492 * @pre pkgmgrinfo_appinfo_get_appinfo()
4493 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4494 * @see pkgmgrinfo_appinfo_get_appid()
4495 static int get_app_is_global(const char *appid)
4499 pkgmgrinfo_appinfo_h handle = NULL;
4500 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4501 if (ret != PMINFO_R_OK)
4503 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4504 if (ret != PMINFO_R_OK) {
4505 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4508 printf("app is_global: %d\n", global);
4509 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4514 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4517 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4518 * @brief This API gets the application 'splash_screen_display' value from the app ID
4520 * @par This API is for package-manager client application
4521 * @par Sync (or) Async : Synchronous API
4523 * @param[in] handle pointer to application info handle
4524 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4525 * @return 0 if success, error code(<0) if fail
4526 * @retval PMINFO_R_OK success
4527 * @retval PMINFO_R_EINVAL invalid argument
4528 * @retval PMINFO_R_ERROR internal error
4530 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4533 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4534 * @brief This API destroys the application information handle freeing up all the resources
4536 * @par This API is for package-manager client application
4537 * @par Sync (or) Async : Synchronous API
4539 * @param[in] handle pointer to the application info handle.
4540 * @return 0 if success, error code(<0) if fail
4541 * @retval PMINFO_R_OK success
4542 * @retval PMINFO_R_EINVAL invalid argument
4543 * @retval PMINFO_R_ERROR internal error
4544 * @pre pkgmgrinfo_appinfo_get_appinfo()
4546 * @see pkgmgrinfo_appinfo_get_pkgid()
4547 * @see pkgmgrinfo_appinfo_is_multiple()
4549 static int get_app_type(const char *appid)
4553 pkgmgrinfo_appinfo_h handle;
4554 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4555 if (ret != PMINFO_R_OK)
4557 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4558 if (ret != PMINFO_R_OK) {
4559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4562 printf("apptype: %s\n", type);
4563 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4568 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4571 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4572 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4573 The query will search the entire application information collected from the manifest file of all the installed packages
4575 * @par This API is for package-manager client application
4576 * @par Sync (or) Async : Synchronous API
4578 * @param[out] handle pointer to the application info filter handle.
4579 * @return 0 if success, error code(<0) if fail
4580 * @retval PMINFO_R_OK success
4581 * @retval PMINFO_R_EINVAL invalid argument
4582 * @retval PMINFO_R_ERROR internal error
4584 * @post pkgmgrinfo_appinfo_filter_destroy()
4585 * @see pkgmgrinfo_appinfo_filter_count()
4586 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4588 static int get_capp_count()
4592 pkgmgrinfo_appinfo_filter_h handle;
4593 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4594 if (ret != PMINFO_R_OK)
4596 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4597 if (ret != PMINFO_R_OK) {
4598 pkgmgrinfo_appinfo_filter_destroy(handle);
4601 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4602 if (ret != PMINFO_R_OK) {
4603 pkgmgrinfo_appinfo_filter_destroy(handle);
4606 printf("No of capp: %d\n", count);
4607 pkgmgrinfo_appinfo_filter_destroy(handle);
4612 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4615 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4616 * @brief This API destroys the application information filter handle freeing up all the resources
4618 * @par This API is for package-manager client application
4619 * @par Sync (or) Async : Synchronous API
4621 * @param[in] handle pointer to the application info filter handle.
4622 * @return 0 if success, error code(<0) if fail
4623 * @retval PMINFO_R_OK success
4624 * @retval PMINFO_R_EINVAL invalid argument
4625 * @retval PMINFO_R_ERROR internal error
4626 * @pre pkgmgrinfo_appinfo_filter_create()
4628 * @see pkgmgrinfo_appinfo_filter_count()
4629 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4631 static int get_capp_count()
4635 pkgmgrinfo_appinfo_filter_h handle;
4636 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4637 if (ret != PMINFO_R_OK)
4639 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4640 if (ret != PMINFO_R_OK) {
4641 pkgmgrinfo_appinfo_filter_destroy(handle);
4644 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4645 if (ret != PMINFO_R_OK) {
4646 pkgmgrinfo_appinfo_filter_destroy(handle);
4649 printf("No of capp: %d\n", count);
4650 pkgmgrinfo_appinfo_filter_destroy(handle);
4655 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4658 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4659 * @brief This API adds a boolean filter property to the filter handle
4661 * @par This API is for package-manager client application
4662 * @par Sync (or) Async : Synchronous API
4664 * @param[in] handle pointer to the application info filter handle.
4665 * @param[in] property boolean property name.
4666 * @param[in] value value corresponding to the property.
4667 * @return 0 if success, error code(<0) if fail
4668 * @retval PMINFO_R_OK success
4669 * @retval PMINFO_R_EINVAL invalid argument
4670 * @retval PMINFO_R_ERROR internal error
4671 * @pre pkgmgrinfo_appinfo_filter_create()
4672 * @post pkgmgrinfo_appinfo_filter_destroy()
4673 * @see pkgmgrinfo_appinfo_filter_count()
4674 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4676 static int get_taskmanageable_app_count()
4680 pkgmgrinfo_appinfo_filter_h handle;
4681 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4682 if (ret != PMINFO_R_OK)
4684 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4685 if (ret != PMINFO_R_OK) {
4686 pkgmgrinfo_appinfo_filter_destroy(handle);
4689 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4690 if (ret != PMINFO_R_OK) {
4691 pkgmgrinfo_appinfo_filter_destroy(handle);
4694 printf("No of taskmanageable apps: %d\n", count);
4695 pkgmgrinfo_appinfo_filter_destroy(handle);
4700 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4701 const char *property, const bool value);
4704 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4705 * @brief This API adds an integer filter property to the filter handle
4707 * @par This API is for package-manager client application
4708 * @par Sync (or) Async : Synchronous API
4710 * @param[in] handle pointer to the application info filter handle.
4711 * @param[in] property integer property name.
4712 * @param[in] value value corresponding to the property.
4713 * @return 0 if success, error code(<0) if fail
4714 * @retval PMINFO_R_OK success
4715 * @retval PMINFO_R_EINVAL invalid argument
4716 * @retval PMINFO_R_ERROR internal error
4717 * @pre pkgmgrinfo_appinfo_filter_create()
4718 * @post pkgmgrinfo_appinfo_filter_destroy()
4719 * @see pkgmgrinfo_appinfo_filter_count()
4720 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4722 static int get_taskmanageable_app_count()
4726 pkgmgrinfo_appinfo_filter_h handle;
4727 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4728 if (ret != PMINFO_R_OK)
4730 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4731 if (ret != PMINFO_R_OK) {
4732 pkgmgrinfo_appinfo_filter_destroy(handle);
4735 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4736 if (ret != PMINFO_R_OK) {
4737 pkgmgrinfo_appinfo_filter_destroy(handle);
4740 printf("No of apps: %d\n", count);
4741 pkgmgrinfo_appinfo_filter_destroy(handle);
4746 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4747 const char *property, const int value);
4750 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4751 * @brief This API adds a string filter property to the filter handle
4753 * @par This API is for package-manager client application
4754 * @par Sync (or) Async : Synchronous API
4756 * @param[in] handle pointer to the application info filter handle.
4757 * @param[in] property string property name.
4758 * @param[in] value value corresponding to the property.
4759 * @return 0 if success, error code(<0) if fail
4760 * @retval PMINFO_R_OK success
4761 * @retval PMINFO_R_EINVAL invalid argument
4762 * @retval PMINFO_R_ERROR internal error
4763 * @pre pkgmgrinfo_appinfo_filter_create()
4764 * @post pkgmgrinfo_appinfo_filter_destroy()
4765 * @see pkgmgrinfo_appinfo_filter_count()
4766 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4768 static int get_capp_count()
4772 pkgmgrinfo_appinfo_filter_h handle;
4773 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4774 if (ret != PMINFO_R_OK)
4776 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4777 if (ret != PMINFO_R_OK) {
4778 pkgmgrinfo_appinfo_filter_destroy(handle);
4781 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4782 if (ret != PMINFO_R_OK) {
4783 pkgmgrinfo_appinfo_filter_destroy(handle);
4786 printf("No of capp: %d\n", count);
4787 pkgmgrinfo_appinfo_filter_destroy(handle);
4792 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4793 const char *property, const char *value);
4796 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4797 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4799 * @par This API is for package-manager client application
4800 * @par Sync (or) Async : Synchronous API
4802 * @param[in] handle pointer to the application info filter handle.
4803 * @param[in] app_cb callback function.
4804 * @param[in] user_data user data to be passed to the callback function
4805 * @return 0 if success, error code(<0) if fail
4806 * @retval PMINFO_R_OK success
4807 * @retval PMINFO_R_EINVAL invalid argument
4808 * @retval PMINFO_R_ERROR internal error
4809 * @pre pkgmgrinfo_appinfo_filter_create()
4810 * @post pkgmgrinfo_appinfo_filter_destroy()
4811 * @see pkgmgrinfo_appinfo_filter_count()
4813 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4816 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4817 printf("appid : %s\n", appid);
4821 static int get_capp_list()
4824 pkgmgrinfo_appinfo_filter_h handle;
4825 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4826 if (ret != PMINFO_R_OK)
4828 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4829 if (ret != PMINFO_R_OK) {
4830 pkgmgrinfo_appinfo_filter_destroy(handle);
4833 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4834 if (ret != PMINFO_R_OK) {
4835 pkgmgrinfo_appinfo_filter_destroy(handle);
4838 pkgmgrinfo_appinfo_filter_destroy(handle);
4843 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4844 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4845 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4846 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4849 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4850 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4851 * @brief This API counts the application that satisfy the filter conditions
4853 * @par This API is for package-manager client application
4854 * @par Sync (or) Async : Synchronous API
4856 * @param[in] handle pointer to the application info filter handle.
4857 * @param[in] count pointer to store count value
4858 * @param[in] uid the addressee user id of the instruction
4859 * @return 0 if success, error code(<0) if fail
4860 * @retval PMINFO_R_OK success
4861 * @retval PMINFO_R_EINVAL invalid argument
4862 * @retval PMINFO_R_ERROR internal error
4863 * @pre pkgmgrinfo_appinfo_filter_create()
4864 * @post pkgmgrinfo_appinfo_filter_destroy()
4865 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4867 static int get_capp_count()
4871 pkgmgrinfo_appinfo_filter_h handle;
4872 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4873 if (ret != PMINFO_R_OK)
4875 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4876 if (ret != PMINFO_R_OK) {
4877 pkgmgrinfo_appinfo_filter_destroy(handle);
4880 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4881 if (ret != PMINFO_R_OK) {
4882 pkgmgrinfo_appinfo_filter_destroy(handle);
4885 printf("No of capp: %d\n", count);
4886 pkgmgrinfo_appinfo_filter_destroy(handle);
4891 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4892 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4894 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4895 * @brief This API creates the application's metadata information filter handle from db.
4897 * @par This API is for package-manager client application
4898 * @par Sync (or) Async : Synchronous API
4900 * @param[out] handle pointer to the application metadata info filter handle.
4901 * @return 0 if success, error code(<0) if fail
4902 * @retval PMINFO_R_OK success
4903 * @retval PMINFO_R_EINVAL invalid argument
4904 * @retval PMINFO_R_ERROR internal error
4906 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4907 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4909 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4912 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4913 printf("appid : %s\n", appid);
4917 static int get_app_list(const char *mkey, const char *mvalue)
4920 pkgmgrinfo_appinfo_metadata_filter_h handle;
4921 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4922 if (ret != PMINFO_R_OK)
4924 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4925 if (ret != PMINFO_R_OK) {
4926 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4929 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4930 if (ret != PMINFO_R_OK) {
4931 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4934 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4939 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4942 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4943 * @brief This API destroys the application's metadata information filter handle.
4945 * @par This API is for package-manager client application
4946 * @par Sync (or) Async : Synchronous API
4948 * @param[in] handle pointer to the application metadata info filter handle.
4949 * @return 0 if success, error code(<0) if fail
4950 * @retval PMINFO_R_OK success
4951 * @retval PMINFO_R_EINVAL invalid argument
4952 * @retval PMINFO_R_ERROR internal error
4953 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4955 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4957 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4960 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4961 printf("appid : %s\n", appid);
4965 static int get_app_list(const char *mkey, const char *mvalue)
4968 pkgmgrinfo_appinfo_metadata_filter_h handle;
4969 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4970 if (ret != PMINFO_R_OK)
4972 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4973 if (ret != PMINFO_R_OK) {
4974 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4977 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4978 if (ret != PMINFO_R_OK) {
4979 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4982 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4987 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4990 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4991 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4992 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4994 * @par This API is for package-manager client application
4995 * @par Sync (or) Async : Synchronous API
4997 * @param[in] handle pointer to the application metadata info filter handle.
4998 * @param[in] key pointer to metadata key
4999 * @param[in] value pointer to metadata value
5000 * @return 0 if success, error code(<0) if fail
5001 * @retval PMINFO_R_OK success
5002 * @retval PMINFO_R_EINVAL invalid argument
5003 * @retval PMINFO_R_ERROR internal error
5004 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5005 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5006 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5008 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5011 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5012 printf("appid : %s\n", appid);
5016 static int get_app_list(const char *mkey, const char *mvalue)
5019 pkgmgrinfo_appinfo_metadata_filter_h handle;
5020 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5021 if (ret != PMINFO_R_OK)
5023 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5024 if (ret != PMINFO_R_OK) {
5025 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5028 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5029 if (ret != PMINFO_R_OK) {
5030 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5033 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5038 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5039 const char *key, const char *value);
5042 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5043 * @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)
5044 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5045 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5046 * negative value, no more callbacks will be called and API will return.
5048 * @par This API is for package-manager client application
5049 * @par Sync (or) Async : Synchronous API
5051 * @param[in] handle pointer to the application metadata info filter handle.
5052 * @param[in] app_cb function pointer to callback
5053 * @param[in] user_data pointer to user data
5054 * @param[in] uid the addressee user id of the instruction
5055 * @return 0 if success, error code(<0) if fail
5056 * @retval PMINFO_R_OK success
5057 * @retval PMINFO_R_EINVAL invalid argument
5058 * @retval PMINFO_R_ERROR internal error
5059 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5060 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5062 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5065 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5066 printf("appid : %s\n", appid);
5070 static int get_app_list(const char *mkey, const char *mvalue)
5073 pkgmgrinfo_appinfo_metadata_filter_h handle;
5074 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5075 if (ret != PMINFO_R_OK)
5077 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5078 if (ret != PMINFO_R_OK) {
5079 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5082 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5083 if (ret != PMINFO_R_OK) {
5084 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5087 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5092 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5093 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5094 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5095 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5097 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5098 * @brief This API creates the package cert information handle to get data from db.
5100 * @par This API is for package-manager client application
5101 * @par Sync (or) Async : Synchronous API
5103 * @param[out] handle pointer to the package cert handle.
5104 * @return 0 if success, error code(<0) if fail
5105 * @retval PMINFO_R_OK success
5106 * @retval PMINFO_R_EINVAL invalid argument
5107 * @retval PMINFO_R_ERROR internal error
5109 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5110 * @see pkgmgrinfo_pkginfo_get_cert_value()
5111 * @see pkgmgrinfo_pkginfo_load_certinfo()
5113 static int get_cert_info(const char *pkgid)
5116 pkgmgrinfo_certinfo_h handle;
5117 char *auth_cert = NULL;
5118 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5119 if (ret != PMINFO_R_OK)
5121 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5122 if (ret != PMINFO_R_OK) {
5123 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5126 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5127 if (ret != PMINFO_R_OK) {
5128 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5131 printf("Author root certificate: %s\n", auth_root);
5132 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5137 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5140 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5141 * @brief This API loads the package cert information handle with data from db.
5143 * @par This API is for package-manager client application
5144 * @par Sync (or) Async : Synchronous API
5146 * @param[in] pkgid pointer to the package ID.
5147 * @param[in] handle pointer to the package cert handle.
5148 * @return 0 if success, error code(<0) if fail
5149 * @retval PMINFO_R_OK success
5150 * @retval PMINFO_R_EINVAL invalid argument
5151 * @retval PMINFO_R_ERROR internal error
5152 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5153 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5154 * @see pkgmgrinfo_pkginfo_get_cert_value()
5156 static int get_cert_info(const char *pkgid)
5159 pkgmgrinfo_certinfo_h handle;
5160 char *auth_cert = NULL;
5161 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5162 if (ret != PMINFO_R_OK)
5164 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5165 if (ret != PMINFO_R_OK) {
5166 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5169 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5170 if (ret != PMINFO_R_OK) {
5171 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5174 printf("Author root certificate: %s\n", auth_root);
5175 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5180 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5183 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5184 * @brief This API gets the package cert information from the handle
5186 * @par This API is for package-manager client application
5187 * @par Sync (or) Async : Synchronous API
5189 * @param[in] handle pointer to the package cert handle.
5190 * @param[in] cert_type certificate type
5191 * @param[out] cert_value pointer to hold certificate value
5192 * @return 0 if success, error code(<0) if fail
5193 * @retval PMINFO_R_OK success
5194 * @retval PMINFO_R_EINVAL invalid argument
5195 * @retval PMINFO_R_ERROR internal error
5196 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5197 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5198 * @see pkgmgrinfo_pkginfo_load_certinfo()
5200 static int get_cert_info(const char *pkgid)
5203 pkgmgrinfo_certinfo_h handle;
5204 char *auth_cert = NULL;
5205 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5206 if (ret != PMINFO_R_OK)
5208 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5209 if (ret != PMINFO_R_OK) {
5210 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5213 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5214 if (ret != PMINFO_R_OK) {
5215 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5218 printf("Author root certificate: %s\n", auth_root);
5219 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5224 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5227 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5228 * @brief This API destroys the package cert information handle freeing up all the resources
5230 * @par This API is for package-manager client application
5231 * @par Sync (or) Async : Synchronous API
5233 * @param[in] handle pointer to the package cert handle.
5234 * @return 0 if success, error code(<0) if fail
5235 * @retval PMINFO_R_OK success
5236 * @retval PMINFO_R_EINVAL invalid argument
5237 * @retval PMINFO_R_ERROR internal error
5238 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5240 * @see pkgmgrinfo_pkginfo_load_certinfo()
5242 static int get_cert_info(const char *pkgid)
5245 pkgmgrinfo_certinfo_h handle;
5246 char *auth_cert = NULL;
5247 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5248 if (ret != PMINFO_R_OK)
5250 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5251 if (ret != PMINFO_R_OK) {
5252 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5255 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5256 if (ret != PMINFO_R_OK) {
5257 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5260 printf("Author root certificate: %s\n", auth_root);
5261 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5266 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5269 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5270 * @brief This API deletes the package cert information from DB
5272 * @par This API is for package-manager client application
5273 * @par Sync (or) Async : Synchronous API
5275 * @param[in] pkgid pointer to the package ID.
5276 * @return 0 if success, error code(<0) if fail
5277 * @retval PMINFO_R_OK success
5278 * @retval PMINFO_R_EINVAL invalid argument
5279 * @retval PMINFO_R_ERROR internal error
5283 static int delete_cert_info(const char *pkgid)
5286 ret = pkgmgrinfo_delete_certinfo(pkgid);
5287 if (ret != PMINFO_R_OK)
5293 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5294 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5297 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5298 * @brief This API creates the package cert information handle to set data in db.
5300 * @par This API is for package-manager client application
5301 * @par Sync (or) Async : Synchronous API
5303 * @param[out] handle pointer to the package cert handle.
5304 * @return 0 if success, error code(<0) if fail
5305 * @retval PMINFO_R_OK success
5306 * @retval PMINFO_R_EINVAL invalid argument
5307 * @retval PMINFO_R_ERROR internal error
5309 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5310 * @see pkgmgrinfo_set_cert_value()
5311 * @see pkgmgrinfo_save_certinfo()
5313 static int set_cert_in_db(const char *pkgid)
5316 pkgmgrinfo_instcertinfo_h handle;
5317 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5318 if (ret != PMINFO_R_OK)
5320 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5321 if (ret != PMINFO_R_OK) {
5322 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5325 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5326 if (ret != PMINFO_R_OK) {
5327 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5330 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5335 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5338 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5339 * @brief This API sets the package cert information in the handle.
5341 * @par This API is for package-manager client application
5342 * @par Sync (or) Async : Synchronous API
5344 * @param[in] handle pointer to the package cert handle.
5345 * @param[in] cert_type certificate type.
5346 * @param[in] cert_value certificate value.
5347 * @return 0 if success, error code(<0) if fail
5348 * @retval PMINFO_R_OK success
5349 * @retval PMINFO_R_EINVAL invalid argument
5350 * @retval PMINFO_R_ERROR internal error
5351 * @pre pkgmgrinfo_create_certinfo_set_handle()
5352 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5353 * @see pkgmgrinfo_save_certinfo()
5355 static int set_cert_in_db(const char *pkgid)
5358 pkgmgrinfo_instcertinfo_h handle;
5359 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5360 if (ret != PMINFO_R_OK)
5362 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5363 if (ret != PMINFO_R_OK) {
5364 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5367 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5368 if (ret != PMINFO_R_OK) {
5369 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5372 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5377 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5380 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5381 * @brief This API saves the package cert information in the DB.
5383 * @par This API is for package-manager client application
5384 * @par Sync (or) Async : Synchronous API
5386 * @param[in] pkgid pointer to the package ID.
5387 * @param[in] handle pointer to the package cert handle.
5388 * @return 0 if success, error code(<0) if fail
5389 * @retval PMINFO_R_OK success
5390 * @retval PMINFO_R_EINVAL invalid argument
5391 * @retval PMINFO_R_ERROR internal error
5392 * @pre pkgmgrinfo_create_certinfo_set_handle()
5393 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5394 * @see pkgmgrinfo_save_certinfo()
5396 static int set_cert_in_db(const char *pkgid)
5399 pkgmgrinfo_instcertinfo_h handle;
5400 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5401 if (ret != PMINFO_R_OK)
5403 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5404 if (ret != PMINFO_R_OK) {
5405 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5408 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5409 if (ret != PMINFO_R_OK) {
5410 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5413 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5418 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5421 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5422 * @brief This API destroys the package cert information handle freeing up all the resources.
5424 * @par This API is for package-manager client application
5425 * @par Sync (or) Async : Synchronous API
5427 * @param[in] handle pointer to the package cert handle.
5428 * @return 0 if success, error code(<0) if fail
5429 * @retval PMINFO_R_OK success
5430 * @retval PMINFO_R_EINVAL invalid argument
5431 * @retval PMINFO_R_ERROR internal error
5432 * @pre pkgmgrinfo_create_certinfo_set_handle()
5434 * @see pkgmgrinfo_save_certinfo()
5436 static int set_cert_in_db(const char *pkgid)
5439 pkgmgrinfo_instcertinfo_h handle;
5440 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5441 if (ret != PMINFO_R_OK)
5443 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5444 if (ret != PMINFO_R_OK) {
5445 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5448 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5449 if (ret != PMINFO_R_OK) {
5450 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5453 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5458 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5461 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5462 * @brief This API gets the datacontrol info
5464 * @par This API is for package-manager client application
5465 * @par Sync (or) Async : Synchronous API
5467 * @param[in] providerid pointer to the providerid of dataconltrol.
5468 * @param[in] type pointer to the type of dataconltrol.
5469 * @param[out] appid pointer to hold appid, need to free after using
5470 * @param[out] access pointer to hold access, need to free after using
5471 * @return 0 if success, error code(<0) if fail
5472 * @retval PMINFO_R_OK success
5473 * @retval PMINFO_R_EINVAL invalid argument
5474 * @retval PMINFO_R_ERROR internal error
5477 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5480 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5481 * @brief This API gets the application 'guest mode visibility' value from the DB
5483 * @par This API is for package-manager client application
5484 * @par Sync (or) Async : Synchronous API
5486 * @param[in] handle pointer to application info handle
5487 * @param[out] status pointer to hold app guest mode visibility value
5488 * @return 0 if success, error code(<0) if fail
5489 * @retval PMINFO_R_OK success
5490 * @retval PMINFO_R_EINVAL invalid argument
5491 * @retval PMINFO_R_ERROR internal error
5492 * @pre pkgmgrinfo_appinfo_get_appinfo()
5493 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5494 * @see pkgmgrinfo_appinfo_get_appid()
5495 * @see pkgmgrinfo_appinfo_is_multiple()
5497 static int get_app_guestmode_visibility(const char *appid)
5501 pkgmgrinfo_appinfo_h handle;
5502 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5503 if (ret != PMINFO_R_OK)
5505 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5506 if (ret != PMINFO_R_OK) {
5507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5510 printf("app guest mode visibility: %d\n", status);
5511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5516 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5519 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5520 * @brief This API sets the application 'guest mode visibility' value in the DB
5522 * @par This API is for package-manager client application
5523 * @par Sync (or) Async : Synchronous API
5525 * @param[in] handle pointer to application info handle
5526 * @param[out] status app guest mode visibility value
5527 * @return 0 if success, error code(<0) if fail
5528 * @retval PMINFO_R_OK success
5529 * @retval PMINFO_R_EINVAL invalid argument
5530 * @retval PMINFO_R_ERROR internal error
5531 * @pre pkgmgrinfo_appinfo_get_appinfo()
5532 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5533 * @see pkgmgrinfo_appinfo_get_appid()
5534 * @see pkgmgrinfo_appinfo_is_multiple()
5536 static int set_app_guestmode_visibility(const char *appid, bool value)
5539 pkgmgrinfo_appinfo_h handle;
5540 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5541 if (ret != PMINFO_R_OK)
5543 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5544 if (ret != PMINFO_R_OK) {
5545 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5548 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5553 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5554 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5557 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5558 * @brief This API sets the package 'installed_storage' value in db
5560 * @par This API is for package-manager client application
5561 * @par Sync (or) Async : Synchronous API
5563 * @param[in] pkgid pointer to the package ID.
5564 * @param[in] location package install location
5565 * @return 0 if success, error code(<0) if fail
5566 * @retval PMINFO_R_OK success
5567 * @retval PMINFO_R_EINVAL invalid argument
5568 * @retval PMINFO_R_ERROR internal error
5570 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5574 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5575 if (ret != PMINFO_R_OK) {
5582 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5583 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5586 * @pkgmgrinfo client API
5590 * @brief listening status type in pkgmgrinfo.
5592 #define PMINFO_CLIENT_STATUS_ALL 0x00
5593 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5594 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5595 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5596 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5597 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5598 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5601 * @brief This APIs provides pkgmgrinfo client listener
5603 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5604 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5605 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5606 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5613 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5614 int flag, void *user_data, uid_t uid);
5615 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5616 int flag, void *user_data);
5617 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5618 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5620 int pkgmgrinfo_appinfo_get_installed_list_full(
5621 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5624 * @pkgmgrinfo client API end
5632 #endif /* __PKG_INFO_H__ */