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_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE"
147 /** Integer property for filtering app disabled by user*/
148 #define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
169 /** will be updated*/
170 /** string property for filtering based on pkg info*/
171 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
173 /* For multiuser support */
174 const char *getIconPath(uid_t uid, bool readonly);
175 char *getUserPkgParserDBPath(void);
176 char *getUserPkgParserDBPathUID(uid_t uid);
177 char *getUserPkgCertDBPath(void);
178 char *getUserPkgCertDBPathUID(uid_t uid);
179 const char *getUserManifestPath(uid_t uid, bool readonly);
182 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
183 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
184 * @brief This API gets list of installed packages
186 * @par This API is for package-manager client application
187 * @par Sync (or) Async : Synchronous API
188 * @param[in] pkg_list_cb iteration function for list
189 * @param[in] user_data user data to be passed to callback function
190 * @param[in] uid the addressee user id of the instruction
191 * @return 0 if success, error code(<0) if fail
192 * @retval PMINFO_R_OK success
193 * @retval PMINFO_R_EINVAL invalid argument
194 * @retval PMINFO_R_ERROR internal error
198 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
202 pkgid1 = (char *)user_data;
203 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
204 if (strcmp(pkgid1, pkgid2) == 0) {
211 static int list_pkgs()
214 char *name = "helloworld";
215 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
216 if (ret != PMINFO_R_OK) {
223 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
224 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
226 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
227 * @brief This API creates the package information handle from db
229 * @par This API is for package-manager client application
230 * @par Sync (or) Async : Synchronous API
232 * @param[in] pkgid pointer to package ID
233 * @param[in] uid the addressee user id of the instruction
234 * @param[out] handle pointer to the package info handle.
235 * @return 0 if success, error code(<0) if fail
236 * @retval PMINFO_R_OK success
237 * @retval PMINFO_R_EINVAL invalid argument
238 * @retval PMINFO_R_ERROR internal error
240 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
241 * @see pkgmgrinfo_pkginfo_get_pkgid()
242 * @see pkgmgrinfo_pkginfo_is_removable()
244 static int get_pkg_type(const char *pkgid)
248 pkgmgrinfo_pkginfo_h handle;
249 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
250 if (ret != PMINFO_R_OK)
252 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
253 if (ret != PMINFO_R_OK) {
254 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
257 printf("pkgtype: %s\n", type);
258 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
263 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
264 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
267 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
268 * @brief This API gets the package name from the package ID
270 * @par This API is for package-manager client application
271 * @par Sync (or) Async : Synchronous API
273 * @param[in] handle pointer to package info handle
274 * @param[out] pkg_name pointer to hold package name
275 * @return 0 if success, error code(<0) if fail
276 * @retval PMINFO_R_OK success
277 * @retval PMINFO_R_EINVAL invalid argument
278 * @retval PMINFO_R_ERROR internal error
279 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
280 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
281 * @see pkgmgrinfo_pkginfo_get_type()
282 * @see pkgmgrinfo_pkginfo_is_removable()
284 static int get_pkg_name(const char *pkgid)
287 char *pkgname = NULL;
288 pkgmgrinfo_pkginfo_h handle;
289 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
290 if (ret != PMINFO_R_OK)
292 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
293 if (ret != PMINFO_R_OK) {
294 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
297 printf("pkgname: %s\n", pkgname);
298 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
303 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
306 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
307 * @brief This API gets the package id from the package ID
309 * @par This API is for package-manager client application
310 * @par Sync (or) Async : Synchronous API
312 * @param[in] handle pointer to package info handle
313 * @param[out] pkgid pointer to hold package id
314 * @return 0 if success, error code(<0) if fail
315 * @retval PMINFO_R_OK success
316 * @retval PMINFO_R_EINVAL invalid argument
317 * @retval PMINFO_R_ERROR internal error
318 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
319 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
320 * @see pkgmgrinfo_pkginfo_get_type()
321 * @see pkgmgrinfo_pkginfo_is_removable()
323 static int get_pkgid(const char *pkgid)
327 pkgmgrinfo_pkginfo_h handle;
328 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
329 if (ret != PMINFO_R_OK)
331 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
332 if (ret != PMINFO_R_OK) {
333 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
336 printf("pkg id: %s\n", pkg_id);
337 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
342 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
345 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
346 * @brief This API gets the package type from the package ID
348 * @par This API is for package-manager client application
349 * @par Sync (or) Async : Synchronous API
351 * @param[in] handle pointer to package info handle
352 * @param[out] type pointer to hold package type
353 * @return 0 if success, error code(<0) if fail
354 * @retval PMINFO_R_OK success
355 * @retval PMINFO_R_EINVAL invalid argument
356 * @retval PMINFO_R_ERROR internal error
357 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
358 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
359 * @see pkgmgrinfo_pkginfo_get_pkgid()
360 * @see pkgmgrinfo_pkginfo_is_removable()
362 static int get_pkg_type(const char *pkgid)
366 pkgmgrinfo_pkginfo_h handle;
367 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
368 if (ret != PMINFO_R_OK)
370 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
371 if (ret != PMINFO_R_OK) {
372 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
375 printf("pkgtype: %s\n", type);
376 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
381 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
384 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
385 * @brief This API gets the package version from the package ID
387 * @par This API is for package-manager client application
388 * @par Sync (or) Async : Synchronous API
390 * @param[in] handle pointer to package info handle
391 * @param[out] version pointer to hold package version
392 * @return 0 if success, error code(<0) if fail
393 * @retval PMINFO_R_OK success
394 * @retval PMINFO_R_EINVAL invalid argument
395 * @retval PMINFO_R_ERROR internal error
396 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
397 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
398 * @see pkgmgrinfo_pkginfo_get_pkgid()
399 * @see pkgmgrinfo_pkginfo_is_removable()
401 static int get_pkg_version(const char *pkgid)
404 char *version = NULL;
405 pkgmgrinfo_pkginfo_h handle;
406 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
407 if (ret != PMINFO_R_OK)
409 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
410 if (ret != PMINFO_R_OK) {
411 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
414 printf("pkg version: %s\n", version);
415 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
420 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
423 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
424 * @brief This API gets the package api_version from the package ID
426 * @par This API is for package-manager client application
427 * @par Sync (or) Async : Synchronous API
429 * @param[in] handle pointer to package info handle
430 * @param[out] api_version pointer to hold package api_version
431 * @return 0 if success, error code(<0) if fail
432 * @retval PMINFO_R_OK success
433 * @retval PMINFO_R_EINVAL invalid argument
434 * @retval PMINFO_R_ERROR internal error
435 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
436 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
437 * @see pkgmgrinfo_pkginfo_get_pkgid()
438 * @see pkgmgrinfo_pkginfo_is_removable()
440 static int get_pkg_api_version(const char *pkgid)
443 char *api_version = NULL;
444 pkgmgrinfo_pkginfo_h handle = NULL;
445 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
446 if (ret != PMINFO_R_OK)
448 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
449 if (ret != PMINFO_R_OK) {
450 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
453 printf("pkg api_version: %s\n", api_version);
454 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
459 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
462 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
463 * @brief This API gets tep(tizen expansion package) file name associated with the package
465 * @par This API is for package-manager client application
466 * @par Sync (or) Async : Synchronous API
468 * @param[in] handle pointer to the pkginfo handle.
469 * @param[out] tep_name pointer to hold tep name
470 * @return 0 if success, error code(<0) if fail
471 * @retval PMINFO_R_OK success
472 * @retval PMINFO_R_EINVAL invalid argument
473 * @retval PMINFO_R_ERROR internal error
474 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
475 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
476 * @see pkgmgrinfo_pkginfo_get_pkgid()
478 static int get_tep_name(const char *pkgid)
481 char *tep_name = NULL;
482 pkgmgrinfo_pkginfo_h handle = NULL;
483 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
484 if (ret != PMINFO_R_OK)
486 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
487 if (ret != PMINFO_R_OK) {
488 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
491 printf("TEP name is: %s\n", tep_name);
492 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
497 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
500 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
501 * @brief This API gets package mount point path associated with the package
502 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
504 * @par This API is for package-manager client application
505 * @par Sync (or) Async : Synchronous API
507 * @param[in] handle pointer to the pkginfo handle.
508 * @param[out] zip_mount_file pointer to hold zip mount file
509 * @return 0 if success, error code(<0) if fail
510 * @retval PMINFO_R_OK success
511 * @retval PMINFO_R_EINVAL invalid argument
512 * @retval PMINFO_R_ERROR internal error
513 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
514 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
515 * @see pkgmgrinfo_pkginfo_get_pkgid()
517 static int get_zip_mount_file(const char *pkgid)
520 char *zip_mount_file = NULL;
521 pkgmgrinfo_pkginfo_h handle = NULL;
522 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
523 if (ret != PMINFO_R_OK)
525 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
526 if (ret != PMINFO_R_OK) {
527 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
530 if (zip_mount_file != NULL)
531 printf("Zip mount path is: %s\n", zip_mount_file);
532 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
537 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
540 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
541 * @brief This API gets the package install location from the package ID
543 * @par This API is for package-manager client application
544 * @par Sync (or) Async : Synchronous API
546 * @param[in] handle pointer to package info handle
547 * @param[out] location pointer to hold package install location
548 * @return 0 if success, error code(<0) if fail
549 * @retval PMINFO_R_OK success
550 * @retval PMINFO_R_EINVAL invalid argument
551 * @retval PMINFO_R_ERROR internal error
552 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
553 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
554 * @see pkgmgrinfo_pkginfo_get_pkgid()
555 * @see pkgmgrinfo_pkginfo_is_removable()
557 static int get_pkg_install_location(const char *pkgid)
560 pkgmgrinfo_install_location location;
561 pkgmgrinfo_pkginfo_h handle;
562 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
563 if (ret != PMINFO_R_OK)
565 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
566 if (ret != PMINFO_R_OK) {
567 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
570 printf("pkg install location: %d\n", location);
571 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
576 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
579 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
580 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
581 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
582 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
584 * @par This API is for package-manager client application
585 * @par Sync (or) Async : Synchronous API
587 * @param[in] handle pointer to package info handle
588 * @param[out] size pointer to hold package size
589 * @return 0 if success, error code(<0) if fail
590 * @retval PMINFO_R_OK success
591 * @retval PMINFO_R_EINVAL invalid argument
592 * @retval PMINFO_R_ERROR internal error
593 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
594 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
595 * @see pkgmgrinfo_pkginfo_get_pkgid()
596 * @see pkgmgrinfo_pkginfo_is_removable()
598 static int get_pkg_size(const char *pkgid)
602 pkgmgrinfo_pkginfo_h handle;
603 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
604 if (ret != PMINFO_R_OK)
606 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
607 if (ret != PMINFO_R_OK) {
608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
611 printf("pkgsize: %d\n", size);
612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
617 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
620 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
621 * @brief This API gets the package icon from the package ID
623 * @par This API is for package-manager client application
624 * @par Sync (or) Async : Synchronous API
626 * @param[in] handle pointer to package info handle
627 * @param[out] icon pointer to hold package icon
628 * @return 0 if success, error code(<0) if fail
629 * @retval PMINFO_R_OK success
630 * @retval PMINFO_R_EINVAL invalid argument
631 * @retval PMINFO_R_ERROR internal error
632 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
633 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
634 * @see pkgmgrinfo_pkginfo_get_pkgid()
635 * @see pkgmgrinfo_pkginfo_is_removable()
637 static int get_pkg_icon(const char *pkgid)
641 pkgmgrinfo_pkginfo_h handle;
642 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
643 if (ret != PMINFO_R_OK)
645 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
646 if (ret != PMINFO_R_OK) {
647 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
650 printf("pkg icon: %s\n", icon);
651 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
656 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
659 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
660 * @brief This API gets the package label from the package ID
662 * @par This API is for package-manager client application
663 * @par Sync (or) Async : Synchronous API
665 * @param[in] handle pointer to package info handle
666 * @param[out] label pointer to hold package label
667 * @return 0 if success, error code(<0) if fail
668 * @retval PMINFO_R_OK success
669 * @retval PMINFO_R_EINVAL invalid argument
670 * @retval PMINFO_R_ERROR internal error
671 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
672 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
673 * @see pkgmgrinfo_pkginfo_get_pkgid()
674 * @see pkgmgrinfo_pkginfo_is_removable()
676 static int get_pkg_label(const char *pkgid)
680 pkgmgrinfo_pkginfo_h handle;
681 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
682 if (ret != PMINFO_R_OK)
684 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
685 if (ret != PMINFO_R_OK) {
686 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
689 printf("pkg label: %s\n", label);
690 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
695 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
698 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
699 * @brief This API gets the package description from the package ID
701 * @par This API is for package-manager client application
702 * @par Sync (or) Async : Synchronous API
704 * @param[in] handle pointer to package info handle
705 * @param[out] description pointer to hold package description
706 * @return 0 if success, error code(<0) if fail
707 * @retval PMINFO_R_OK success
708 * @retval PMINFO_R_EINVAL invalid argument
709 * @retval PMINFO_R_ERROR internal error
710 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
711 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
712 * @see pkgmgrinfo_pkginfo_get_pkgid()
713 * @see pkgmgrinfo_pkginfo_is_removable()
715 static int get_pkg_description(const char *pkgid)
718 char *description = NULL;
719 pkgmgrinfo_pkginfo_h handle;
720 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
721 if (ret != PMINFO_R_OK)
723 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
724 if (ret != PMINFO_R_OK) {
725 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
728 printf("pkg description: %s\n", description);
729 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
734 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
737 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
738 * @brief This API gets the package's author name from the package ID
740 * @par This API is for package-manager client application
741 * @par Sync (or) Async : Synchronous API
743 * @param[in] handle pointer to package info handle
744 * @param[out] author_name pointer to hold package author name
745 * @return 0 if success, error code(<0) if fail
746 * @retval PMINFO_R_OK success
747 * @retval PMINFO_R_EINVAL invalid argument
748 * @retval PMINFO_R_ERROR internal error
749 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
750 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
751 * @see pkgmgrinfo_pkginfo_get_pkgid()
752 * @see pkgmgrinfo_pkginfo_is_removable()
754 static int get_pkg_author_name(const char *pkgid)
757 char *author_name = NULL;
758 pkgmgrinfo_pkginfo_h handle;
759 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
760 if (ret != PMINFO_R_OK)
762 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
763 if (ret != PMINFO_R_OK) {
764 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
767 printf("pkg author name: %s\n", author_name);
768 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
773 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
776 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
777 * @brief This API gets the package's author email from the package ID
779 * @par This API is for package-manager client application
780 * @par Sync (or) Async : Synchronous API
782 * @param[in] handle pointer to package info handle
783 * @param[out] author_email pointer to hold package author email
784 * @return 0 if success, error code(<0) if fail
785 * @retval PMINFO_R_OK success
786 * @retval PMINFO_R_EINVAL invalid argument
787 * @retval PMINFO_R_ERROR internal error
788 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
789 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
790 * @see pkgmgrinfo_pkginfo_get_pkgid()
791 * @see pkgmgrinfo_pkginfo_is_removable()
793 static int get_pkg_author_email(const char *pkgid)
796 char *author_email = NULL;
797 pkgmgrinfo_pkginfo_h handle;
798 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
799 if (ret != PMINFO_R_OK)
801 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
802 if (ret != PMINFO_R_OK) {
803 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
806 printf("pkg author email: %s\n", author_email);
807 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
812 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
815 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
816 * @brief This API gets the package's author href from the package ID
818 * @par This API is for package-manager client application
819 * @par Sync (or) Async : Synchronous API
821 * @param[in] handle pointer to package info handle
822 * @param[out] author_href pointer to hold package author href
823 * @return 0 if success, error code(<0) if fail
824 * @retval PMINFO_R_OK success
825 * @retval PMINFO_R_EINVAL invalid argument
826 * @retval PMINFO_R_ERROR internal error
827 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
828 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
829 * @see pkgmgrinfo_pkginfo_get_pkgid()
830 * @see pkgmgrinfo_pkginfo_is_removable()
832 static int get_pkg_author_href(const char *pkgid)
835 char *author_href = NULL;
836 pkgmgrinfo_pkginfo_h handle;
837 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
838 if (ret != PMINFO_R_OK)
840 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
841 if (ret != PMINFO_R_OK) {
842 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
845 printf("pkg author href: %s\n", author_href);
846 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
851 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
854 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
855 * @brief This API gets the package installed storagae value from the package ID
857 * @par This API is for package-manager client application
858 * @par Sync (or) Async : Synchronous API
860 * @param[in] handle pointer to package info handle
861 * @param[out] storage pointer to hold package installed storage
862 * @return 0 if success, error code(<0) if fail
863 * @retval PMINFO_R_OK success
864 * @retval PMINFO_R_EINVAL invalid argument
865 * @retval PMINFO_R_ERROR internal error
866 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
867 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
868 * @see pkgmgrinfo_pkginfo_get_pkgid()
869 * @see pkgmgrinfo_pkginfo_is_removable()
871 static int get_pkg_installed_storage(const char *pkgid)
874 pkgmgrinfo_installed_storage storage;
875 pkgmgrinfo_pkginfo_h handle;
876 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
877 if (ret != PMINFO_R_OK)
879 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
880 if (ret != PMINFO_R_OK) {
881 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
884 printf("pkg installed storage: %d\n", storage);
885 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
890 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
893 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
894 * @brief This API gets the installed time of package from the package ID
896 * @par This API is for package-manager client application
897 * @par Sync (or) Async : Synchronous API
899 * @param[in] handle pointer to package info handle
900 * @param[out] installed_time pointer to hold installed time of package
901 * @return 0 if success, error code(<0) if fail
902 * @retval PMINFO_R_OK success
903 * @retval PMINFO_R_EINVAL invalid argument
904 * @retval PMINFO_R_ERROR internal error
905 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
906 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
907 * @see pkgmgrinfo_pkginfo_get_pkgid()
908 * @see pkgmgrinfo_pkginfo_is_removable()
910 static int get_pkg_installed_time(const char *pkgid)
913 int installed_time = 0;
914 pkgmgrinfo_pkginfo_h handle;
915 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
916 if (ret != PMINFO_R_OK)
918 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
919 if (ret != PMINFO_R_OK) {
920 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
923 printf("installed_time: %d\n", installed_time);
924 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
929 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
932 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
933 * @brief This API gets the launch mode of package from the package ID
935 * @par This API is for package-manager client application
936 * @par Sync (or) Async : Synchronous API
938 * @param[in] handle pointer to package info handle
939 * @param[out] mode pointer to hold launch mode of package
940 * @return 0 if success, error code(<0) if fail
941 * @retval PMINFO_R_OK success
942 * @retval PMINFO_R_EINVAL invalid argument
943 * @retval PMINFO_R_ERROR internal error
944 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
945 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
946 * @see pkgmgrinfo_pkginfo_get_pkgid()
947 * @see pkgmgrinfo_pkginfo_is_removable()
949 static int get_pkg_launch_mode(const char *pkgid)
952 char *launch_mode = NULL;
953 pkgmgrinfo_pkginfo_h handle;
954 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
955 if (ret != PMINFO_R_OK)
957 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
958 if (ret != PMINFO_R_OK) {
959 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
962 printf("launch mode: %s\n", mode);
963 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
968 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
971 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
972 * @brief This API gets the store client id of package from the package ID
974 * @par This API is for package-manager client application
975 * @par Sync (or) Async : Synchronous API
977 * @param[in] handle pointer to package info handle
978 * @param[out] storeclientid pointer to hold store client id of package
979 * @return 0 if success, error code(<0) if fail
980 * @retval PMINFO_R_OK success
981 * @retval PMINFO_R_EINVAL invalid argument
982 * @retval PMINFO_R_ERROR internal error
983 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
984 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
985 * @see pkgmgrinfo_pkginfo_get_pkgid()
986 * @see pkgmgrinfo_pkginfo_is_removable()
988 static int get_pkg_storeclientid(const char *pkgid)
991 char *storeclientid = 0;
992 pkgmgrinfo_pkginfo_h handle;
993 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
994 if (ret != PMINFO_R_OK)
996 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
997 if (ret != PMINFO_R_OK) {
998 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1001 printf(store client id: %s\n", storeclientid);
1002 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1007 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1010 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1011 * @brief This API gets the main app id of package from the package ID
1013 * @par This API is for package-manager client application
1014 * @par Sync (or) Async : Synchronous API
1016 * @param[in] handle pointer to package info handle
1017 * @param[out] mainappid pointer to hold main app id of package
1018 * @return 0 if success, error code(<0) if fail
1019 * @retval PMINFO_R_OK success
1020 * @retval PMINFO_R_EINVAL invalid argument
1021 * @retval PMINFO_R_ERROR internal error
1022 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1023 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1024 * @see pkgmgrinfo_pkginfo_get_pkgid()
1025 * @see pkgmgrinfo_pkginfo_is_removable()
1027 static int get_pkg_mainappid(const char *pkgid)
1030 char *mainappid = 0;
1031 pkgmgrinfo_pkginfo_h handle;
1032 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1033 if (ret != PMINFO_R_OK)
1035 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1036 if (ret != PMINFO_R_OK) {
1037 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1040 printf(main app id: %s\n", mainappid);
1041 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1046 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1049 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1050 * @brief This API gets the url of package from the package ID
1052 * @par This API is for package-manager client application
1053 * @par Sync (or) Async : Synchronous API
1055 * @param[in] handle pointer to package info handle
1056 * @param[out] url pointer to hold url of package
1057 * @return 0 if success, error code(<0) if fail
1058 * @retval PMINFO_R_OK success
1059 * @retval PMINFO_R_EINVAL invalid argument
1060 * @retval PMINFO_R_ERROR internal error
1061 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1062 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1063 * @see pkgmgrinfo_pkginfo_get_pkgid()
1064 * @see pkgmgrinfo_pkginfo_is_removable()
1066 static int get_pkg_url(const char *pkgid)
1070 pkgmgrinfo_pkginfo_h handle;
1071 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1072 if (ret != PMINFO_R_OK)
1074 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1075 if (ret != PMINFO_R_OK) {
1076 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1079 printf("url : %s\n", url);
1080 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1085 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1088 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1089 * @brief This API gets the root path of package
1091 * @par Sync (or) Async : Synchronous API
1093 * @param[in] handle pointer to package info handle
1094 * @param[out] path pointer to hold root path of package
1095 * @return 0 if success, error code(<0) if fail
1096 * @retval PMINFO_R_OK success
1097 * @retval PMINFO_R_EINVAL invalid argument
1098 * @retval PMINFO_R_ERROR internal error
1100 static int get_root_path(const char *pkgid)
1104 pkgmgrinfo_pkginfo_h handle;
1105 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1106 if (ret != PMINFO_R_OK)
1109 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1110 if (ret != PMINFO_R_OK) {
1111 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1114 printf("path : %s\n", path);
1115 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1121 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1125 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1126 * @brief This API gets the csc path of package
1128 * @par Sync (or) Async : Synchronous API
1130 * @param[in] handle pointer to package info handle
1131 * @param[out] path pointer to hold csc path of package
1132 * @return 0 if success, error code(<0) if fail
1133 * @retval PMINFO_R_OK success
1134 * @retval PMINFO_R_EINVAL invalid argument
1135 * @retval PMINFO_R_ERROR internal error
1137 static int get_csc_path(const char *pkgid)
1141 pkgmgrinfo_pkginfo_h handle;
1142 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1143 if (ret != PMINFO_R_OK)
1146 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1147 if (ret != PMINFO_R_OK) {
1148 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1151 printf("path : %s\n", path);
1152 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1158 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1161 * @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)
1162 * @brief This API compare the cert information from given package id
1164 * @par This API is for package-manager client application
1165 * @par Sync (or) Async : Synchronous API
1167 * @param[in] lhs_package_id pointer to first package ID
1168 * @param[in] rhs_package_id pointer to second package ID
1169 * @param[out] compare_result pointer to the compare result.
1170 * @return 0 if success, error code(<0) if fail
1171 * @retval PMINFO_R_OK success
1172 * @retval PMINFO_R_EINVAL invalid argument
1173 * @retval PMINFO_R_ERROR internal error
1175 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1176 * @see pkgmgrinfo_pkginfo_get_pkgid()
1177 * @see pkgmgrinfo_pkginfo_is_removable()
1179 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1182 pkgmgrinfo_cert_compare_result_type_e result;
1184 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1185 if (ret != PMINFO_R_OK) {
1188 printf("result: %d\n", result);
1193 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);
1194 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);
1196 * @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)
1197 * @brief This API compare the cert information from given app id
1199 * @par This API is for package-manager client application
1200 * @par Sync (or) Async : Synchronous API
1202 * @param[in] lhs_app_id pointer to first app ID
1203 * @param[in] rhs_app_id pointer to second app ID
1204 * @param[out] compare_result pointer to the compare result.
1205 * @return 0 if success, error code(<0) if fail
1206 * @retval PMINFO_R_OK success
1207 * @retval PMINFO_R_EINVAL invalid argument
1208 * @retval PMINFO_R_ERROR internal error
1210 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1211 * @see pkgmgrinfo_pkginfo_get_pkgid()
1212 * @see pkgmgrinfo_pkginfo_is_removable()
1214 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1217 pkgmgrinfo_cert_compare_result_type_e result;
1219 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1220 if (ret != PMINFO_R_OK) {
1223 printf("result: %d\n", result);
1228 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);
1229 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);
1231 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1232 * @brief This API gets the package 'removable' value from the package ID
1234 * @par This API is for package-manager client application
1235 * @par Sync (or) Async : Synchronous API
1237 * @param[in] handle pointer to package info handle
1238 * @param[out] removable pointer to hold package removable value
1239 * @return 0 if success, error code(<0) if fail
1240 * @retval PMINFO_R_OK success
1241 * @retval PMINFO_R_EINVAL invalid argument
1242 * @retval PMINFO_R_ERROR internal error
1243 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1244 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1245 * @see pkgmgrinfo_pkginfo_get_pkgid()
1246 * @see pkgmgrinfo_pkginfo_is_readonly()
1248 static int get_pkg_removable(const char *pkgid)
1252 pkgmgrinfo_pkginfo_h handle;
1253 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1254 if (ret != PMINFO_R_OK)
1256 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1257 if (ret != PMINFO_R_OK) {
1258 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1261 printf("pkg removable: %d\n", removable);
1262 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1267 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1270 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1271 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1273 * @par This API is for package-manager client application
1274 * @par Sync (or) Async : Synchronous API
1276 * @param[in] handle pointer to package info handle
1277 * @param[out] movable pointer to hold package movable state
1278 * @return 0 if success, error code(<0) if fail
1279 * @retval PMINFO_R_OK success
1280 * @retval PMINFO_R_EINVAL invalid argument
1281 * @retval PMINFO_R_ERROR internal error
1282 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1283 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1284 * @see pkgmgrinfo_pkginfo_get_pkgid()
1286 static int get_pkg_movable(const char *pkgid)
1290 pkgmgrinfo_pkginfo_h handle;
1291 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1292 if (ret != PMINFO_R_OK)
1294 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1295 if (ret != PMINFO_R_OK) {
1296 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1299 printf("pkg movable: %d\n", movable);
1300 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1305 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1308 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1309 * @brief This API gets the package 'preload' value from the package ID
1311 * @par This API is for package-manager client application
1312 * @par Sync (or) Async : Synchronous API
1314 * @param[in] handle pointer to package info handle
1315 * @param[out] preload pointer to hold package preload value
1316 * @return 0 if success, error code(<0) if fail
1317 * @retval PMINFO_R_OK success
1318 * @retval PMINFO_R_EINVAL invalid argument
1319 * @retval PMINFO_R_ERROR internal error
1320 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1321 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1322 * @see pkgmgrinfo_pkginfo_get_pkgid()
1323 * @see pkgmgrinfo_pkginfo_is_readonly()
1325 static int get_pkg_preload(const char *pkgid)
1329 pkgmgrinfo_pkginfo_h handle;
1330 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1331 if (ret != PMINFO_R_OK)
1333 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1334 if (ret != PMINFO_R_OK) {
1335 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1338 printf("pkg preload: %d\n", preload);
1339 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1344 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1347 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1348 * @brief This API gets the value for given handle is system or not
1350 * @par This API is for package-manager client application
1351 * @par Sync (or) Async : Synchronous API
1353 * @param[in] handle pointer to package info handle
1354 * @param[out] system pointer to hold system is or not
1355 * @return 0 if success, error code(<0) if fail
1356 * @retval PMINFO_R_OK success
1357 * @retval PMINFO_R_EINVAL invalid argument
1358 * @retval PMINFO_R_ERROR internal error
1359 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1360 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1361 * @see pkgmgrinfo_pkginfo_get_pkgid()
1362 * @see pkgmgrinfo_pkginfo_is_readonly()
1364 static int get_pkg_system(const char *pkgid)
1367 bool system = false;
1368 pkgmgrinfo_pkginfo_h handle = NULL;
1369 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1370 if (ret != PMINFO_R_OK)
1372 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1373 if (ret != PMINFO_R_OK) {
1374 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1377 printf("pkg system: %d\n", system);
1378 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1383 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1386 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1387 * @brief This API gets the package 'readonly' value from the package ID
1389 * @par This API is for package-manager client application
1390 * @par Sync (or) Async : Synchronous API
1392 * @param[in] handle pointer to package info handle
1393 * @param[out] readonly pointer to hold package readonly value
1394 * @return 0 if success, error code(<0) if fail
1395 * @retval PMINFO_R_OK success
1396 * @retval PMINFO_R_EINVAL invalid argument
1397 * @retval PMINFO_R_ERROR internal error
1398 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1399 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1400 * @see pkgmgrinfo_pkginfo_get_pkgid()
1401 * @see pkgmgrinfo_pkginfo_is_removable()
1403 static int get_pkg_readonly(const char *pkgid)
1407 pkgmgrinfo_pkginfo_h handle;
1408 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1409 if (ret != PMINFO_R_OK)
1411 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1412 if (ret != PMINFO_R_OK) {
1413 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1416 printf("pkg readonly: %d\n", readonly);
1417 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1422 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1426 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1427 * @brief This API gets the package 'upate' value from the package ID
1429 * @par This API is for package-manager client application
1430 * @par Sync (or) Async : Synchronous API
1432 * @param[in] handle pointer to package info handle
1433 * @param[out] update pointer to hold package update value
1434 * @return 0 if success, error code(<0) if fail
1435 * @retval PMINFO_R_OK success
1436 * @retval PMINFO_R_EINVAL invalid argument
1437 * @retval PMINFO_R_ERROR internal error
1438 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1439 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1440 * @see pkgmgrinfo_pkginfo_get_pkgid()
1442 static int get_pkg_update(const char *pkgid)
1446 pkgmgrinfo_pkginfo_h handle;
1447 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1448 if (ret != PMINFO_R_OK)
1450 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1451 if (ret != PMINFO_R_OK) {
1452 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1455 printf("pkg update: %d\n", update);
1456 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1461 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1464 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1465 * @brief This API gets the package 'support_disable' value from the package ID
1467 * @par This API is for package-manager client application
1468 * @par Sync (or) Async : Synchronous API
1470 * @param[in] handle pointer to package info handle
1471 * @param[out] support_disable pointer to hold package support_disable value
1472 * @return 0 if success, error code(<0) if fail
1473 * @retval PMINFO_R_OK success
1474 * @retval PMINFO_R_EINVAL invalid argument
1475 * @retval PMINFO_R_ERROR internal error
1476 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1477 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1478 * @see pkgmgrinfo_pkginfo_get_pkgid()
1480 static int get_pkg_support_disable(const char *pkgid)
1483 bool support_disable;
1484 pkgmgrinfo_pkginfo_h handle = NULL;
1485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1486 if (ret != PMINFO_R_OK)
1488 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1489 if (ret != PMINFO_R_OK) {
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493 printf("pkg support_disable: %d\n", support_disable);
1494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1499 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1502 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1503 * @brief This API gets whethere the given package is global package or user package
1505 * @par This API is for package-manager client application
1506 * @par Sync (or) Async : Synchronous API
1508 * @param[in] handle pointer to package info handle
1509 * @param[in] global pointer to hold package global value
1510 * @return 0 if success, error code(<0) if fail
1511 * @retval PMINFO_R_OK success
1512 * @retval PMINFO_R_EINVAL invalid argument
1513 * @retval PMINFO_R_ERROR internal error
1514 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1515 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1516 * @see pkgmgrinfo_pkginfo_get_pkgid()
1517 static int get_pkg_support_disable(const char *pkgid)
1521 pkgmgrinfo_pkginfo_h handle = NULL;
1522 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1523 if (ret != PMINFO_R_OK)
1525 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1526 if (ret != PMINFO_R_OK) {
1527 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1530 printf("pkg is_global: %d\n", global);
1531 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1536 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1539 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1540 * @brief This API gets the package 'accessible' value from the package ID
1542 * @par This API is for package-manager client application
1543 * @par Sync (or) Async : Synchronous API
1545 * @param[in] handle pointer to package info handle
1546 * @param[out] accessible pointer to hold package accessible value
1547 * @return 0 if success, error code(<0) if fail
1548 * @retval PMINFO_R_OK success
1549 * @retval PMINFO_R_EINVAL invalid argument
1550 * @retval PMINFO_R_ERROR internal error
1551 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1552 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1553 * @see pkgmgrinfo_pkginfo_get_pkgid()
1554 * @see pkgmgrinfo_pkginfo_is_readonly()
1556 static int get_pkg_accessible(const char *pkgid)
1560 pkgmgrinfo_pkginfo_h handle;
1561 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1562 if (ret != PMINFO_R_OK)
1564 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1565 if (ret != PMINFO_R_OK) {
1566 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1569 printf("pkg accessible: %d\n", accessible);
1570 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1575 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1578 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1579 * @brief This API destroys the package information handle freeing up all the resources
1581 * @par This API is for package-manager client application
1582 * @par Sync (or) Async : Synchronous API
1584 * @param[in] handle pointer to the package info handle
1585 * @return 0 if success, error code(<0) if fail
1586 * @retval PMINFO_R_OK success
1587 * @retval PMINFO_R_EINVAL invalid argument
1588 * @retval PMINFO_R_ERROR internal error
1589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1591 * @see pkgmgrinfo_pkginfo_get_pkgid()
1592 * @see pkgmgrinfo_pkginfo_is_removable()
1594 static int get_pkg_type(const char *pkgid)
1598 pkgmgrinfo_pkginfo_h handle;
1599 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1600 if (ret != PMINFO_R_OK)
1602 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1603 if (ret != PMINFO_R_OK) {
1604 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1607 printf("pkgtype: %s\n", type);
1608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1616 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1617 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1618 The query will search the entire package information collected from the manifest file of all the installed packages
1620 * @par This API is for package-manager client application
1621 * @par Sync (or) Async : Synchronous API
1623 * @param[out] handle pointer to the package info filter handle.
1624 * @return 0 if success, error code(<0) if fail
1625 * @retval PMINFO_R_OK success
1626 * @retval PMINFO_R_EINVAL invalid argument
1627 * @retval PMINFO_R_ERROR internal error
1629 * @post pkgmgrinfo_pkginfo_filter_destroy()
1630 * @see pkgmgrinfo_pkginfo_filter_count()
1631 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1633 static int get_tpk_pkg_count()
1637 pkgmgrinfo_pkginfo_filter_h handle;
1638 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1639 if (ret != PMINFO_R_OK)
1641 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1642 if (ret != PMINFO_R_OK) {
1643 pkgmgrinfo_pkginfo_filter_destroy(handle);
1646 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1647 if (ret != PMINFO_R_OK) {
1648 pkgmgrinfo_pkginfo_filter_destroy(handle);
1651 printf("No of tpk pkgs: %d\n", count);
1652 pkgmgrinfo_pkginfo_filter_destroy(handle);
1657 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1660 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1661 * @brief This API destroys the package information filter handle freeing up all the resources
1663 * @par This API is for package-manager client application
1664 * @par Sync (or) Async : Synchronous API
1666 * @param[in] handle pointer to the package info filter handle.
1667 * @return 0 if success, error code(<0) if fail
1668 * @retval PMINFO_R_OK success
1669 * @retval PMINFO_R_EINVAL invalid argument
1670 * @retval PMINFO_R_ERROR internal error
1671 * @pre pkgmgrinfo_pkginfo_filter_create()
1673 * @see pkgmgrinfo_pkginfo_filter_count()
1674 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1676 static int get_tpk_pkg_count()
1680 pkgmgrinfo_pkginfo_filter_h handle;
1681 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1682 if (ret != PMINFO_R_OK)
1684 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1685 if (ret != PMINFO_R_OK) {
1686 pkgmgrinfo_pkginfo_filter_destroy(handle);
1689 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1690 if (ret != PMINFO_R_OK) {
1691 pkgmgrinfo_pkginfo_filter_destroy(handle);
1694 printf("No of tpk pkgs: %d\n", count);
1695 pkgmgrinfo_pkginfo_filter_destroy(handle);
1700 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1703 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1704 * @brief This API adds a boolean filter property to the filter handle
1706 * @par This API is for package-manager client application
1707 * @par Sync (or) Async : Synchronous API
1709 * @param[in] handle pointer to the package info filter handle.
1710 * @param[in] property boolean property name.
1711 * @param[in] value value corresponding to the property.
1712 * @return 0 if success, error code(<0) if fail
1713 * @retval PMINFO_R_OK success
1714 * @retval PMINFO_R_EINVAL invalid argument
1715 * @retval PMINFO_R_ERROR internal error
1716 * @pre pkgmgrinfo_pkginfo_filter_create()
1717 * @post pkgmgrinfo_pkginfo_filter_destroy()
1718 * @see pkgmgrinfo_pkginfo_filter_count()
1719 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1721 static int get_preload_pkg_count()
1725 pkgmgrinfo_pkginfo_filter_h handle;
1726 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1727 if (ret != PMINFO_R_OK)
1729 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1730 if (ret != PMINFO_R_OK) {
1731 pkgmgrinfo_pkginfo_filter_destroy(handle);
1734 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1735 if (ret != PMINFO_R_OK) {
1736 pkgmgrinfo_pkginfo_filter_destroy(handle);
1739 printf("No of preload pkgs: %d\n", count);
1740 pkgmgrinfo_pkginfo_filter_destroy(handle);
1745 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1746 const char *property, const bool value);
1749 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1750 * @brief This API adds an integer filter property to the filter handle
1752 * @par This API is for package-manager client application
1753 * @par Sync (or) Async : Synchronous API
1755 * @param[in] handle pointer to the package info filter handle.
1756 * @param[in] property integer property name.
1757 * @param[in] value value corresponding to the property.
1758 * @return 0 if success, error code(<0) if fail
1759 * @retval PMINFO_R_OK success
1760 * @retval PMINFO_R_EINVAL invalid argument
1761 * @retval PMINFO_R_ERROR internal error
1762 * @pre pkgmgrinfo_pkginfo_filter_create()
1763 * @post pkgmgrinfo_pkginfo_filter_destroy()
1764 * @see pkgmgrinfo_pkginfo_filter_count()
1765 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1767 static int get_pkg_count()
1771 pkgmgrinfo_pkginfo_filter_h handle;
1772 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1773 if (ret != PMINFO_R_OK)
1775 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1776 if (ret != PMINFO_R_OK) {
1777 pkgmgrinfo_pkginfo_filter_destroy(handle);
1780 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1781 if (ret != PMINFO_R_OK) {
1782 pkgmgrinfo_pkginfo_filter_destroy(handle);
1785 printf("No of preload pkgs: %d\n", count);
1786 pkgmgrinfo_pkginfo_filter_destroy(handle);
1791 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1792 const char *property, const int value);
1795 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1796 * @brief This API adds a string filter property to the filter handle
1798 * @par This API is for package-manager client application
1799 * @par Sync (or) Async : Synchronous API
1801 * @param[in] handle pointer to the package info filter handle.
1802 * @param[in] property string property name.
1803 * @param[in] value value corresponding to the property.
1804 * @return 0 if success, error code(<0) if fail
1805 * @retval PMINFO_R_OK success
1806 * @retval PMINFO_R_EINVAL invalid argument
1807 * @retval PMINFO_R_ERROR internal error
1808 * @pre pkgmgrinfo_pkginfo_filter_create()
1809 * @post pkgmgrinfo_pkginfo_filter_destroy()
1810 * @see pkgmgrinfo_pkginfo_filter_count()
1811 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1813 static int get_tpk_pkg_count()
1817 pkgmgrinfo_pkginfo_filter_h handle;
1818 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1819 if (ret != PMINFO_R_OK)
1821 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1822 if (ret != PMINFO_R_OK) {
1823 pkgmgrinfo_pkginfo_filter_destroy(handle);
1826 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1827 if (ret != PMINFO_R_OK) {
1828 pkgmgrinfo_pkginfo_filter_destroy(handle);
1831 printf("No of tpk pkgs: %d\n", count);
1832 pkgmgrinfo_pkginfo_filter_destroy(handle);
1837 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1838 const char *property, const char *value);
1841 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1842 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1844 * @par This API is for package-manager client application
1845 * @par Sync (or) Async : Synchronous API
1847 * @param[in] handle pointer to the package info filter handle.
1848 * @param[in] pkg_cb callback function.
1849 * @param[in] user_data user data to be passed to the callback function
1850 * @return 0 if success, error code(<0) if fail
1851 * @retval PMINFO_R_OK success
1852 * @retval PMINFO_R_EINVAL invalid argument
1853 * @retval PMINFO_R_ERROR internal error
1854 * @pre pkgmgrinfo_pkginfo_filter_create()
1855 * @post pkgmgrinfo_pkginfo_filter_destroy()
1856 * @see pkgmgrinfo_pkginfo_filter_count()
1858 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1861 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1862 printf("pkg id : %s\n", pkgid);
1866 static int get_tpk_pkg_list()
1869 pkgmgrinfo_pkginfo_filter_h handle;
1870 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1871 if (ret != PMINFO_R_OK)
1873 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1874 if (ret != PMINFO_R_OK) {
1875 pkgmgrinfo_pkginfo_filter_destroy(handle);
1878 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1879 if (ret != PMINFO_R_OK) {
1880 pkgmgrinfo_pkginfo_filter_destroy(handle);
1883 pkgmgrinfo_pkginfo_filter_destroy(handle);
1888 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1889 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1890 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1891 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1894 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1895 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1896 * @brief This API counts the package that satisfy the filter conditions
1898 * @par This API is for package-manager client application
1899 * @par Sync (or) Async : Synchronous API
1901 * @param[in] handle pointer to the package info filter handle.
1902 * @param[in] count pointer to store the count value.
1903 * @param[in] uid the addressee user id of the instruction
1904 * @return 0 if success, error code(<0) if fail
1905 * @retval PMINFO_R_OK success
1906 * @retval PMINFO_R_EINVAL invalid argument
1907 * @retval PMINFO_R_ERROR internal error
1908 * @pre pkgmgrinfo_pkginfo_filter_create()
1909 * @post pkgmgrinfo_pkginfo_filter_destroy()
1910 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1912 static int get_tpk_pkg_count()
1916 pkgmgrinfo_pkginfo_filter_h handle;
1917 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1918 if (ret != PMINFO_R_OK)
1920 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1921 if (ret != PMINFO_R_OK) {
1922 pkgmgrinfo_pkginfo_filter_destroy(handle);
1925 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1926 if (ret != PMINFO_R_OK) {
1927 pkgmgrinfo_pkginfo_filter_destroy(handle);
1930 printf("No of tpk pkgs: %d\n", count);
1931 pkgmgrinfo_pkginfo_filter_destroy(handle);
1936 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1937 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1939 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1940 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1941 * @brief This API gets the list of privilege for a particular package
1943 * @par This API is for package-manager client application
1944 * @par Sync (or) Async : Synchronous API
1945 * @param[in] handle pointer to the package info handle.
1946 * @param[in] privilege_func callback function for list
1947 * @param[in] user_data user data to be passed to callback function
1948 * @return 0 if success, error code(<0) if fail
1949 * @retval PMINFO_R_OK success
1950 * @retval PMINFO_R_EINVAL invalid argument
1951 * @retval PMINFO_R_ERROR internal error
1952 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1953 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1955 int privilege_func(const char *name, void *user_data)
1957 if (strcmp(name, (char *)user_data) == 0)
1963 static int list_privilege(const char *package, char *privilege)
1966 pkgmgrinfo_pkginfo_h handle;
1967 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1968 if (ret != PMINFO_R_OK)
1970 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1971 if (ret != PMINFO_R_OK) {
1972 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1975 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1980 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1981 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1983 /* TODO: add doxygen comment here */
1984 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1987 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
1988 * @brief This API copy the application information handle
1990 * @par This API is for package-manager client application
1991 * @par Sync (or) Async : Synchronous API
1993 * @param[in] handle pointer to the package info handle.
1994 * @param[out] handle pointer to the package info handle.
1995 * @return 0 if success, error code(<0) if fail
1996 * @retval PMINFO_R_OK success
1997 * @retval PMINFO_R_EINVAL invalid argument
1998 * @retval PMINFO_R_ERROR internal error
2000 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2002 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2006 pkgmgrinfo_pkginfo_h clone;
2008 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2009 if (ret != PMINFO_R_OK)
2013 printf("package: %s\n", clone->package);
2014 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2019 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2023 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2024 pkgmgrinfo_app_list_cb app_func, void *user_data)
2025 * @brief This API gets list of installed applications for a particular package
2027 * @par This API is for package-manager client application
2028 * @par Sync (or) Async : Synchronous API
2029 * @param[in] handle package info handle
2030 * @param[in] component application component
2031 * @param[in] app_func iteration function for list
2032 * @param[in] user_data user data to be passed to callback function
2033 * @return 0 if success, error code(<0) if fail
2034 * @retval PMINFO_R_OK success
2035 * @retval PMINFO_R_EINVAL invalid argument
2036 * @retval PMINFO_R_ERROR internal error
2037 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2038 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2040 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2043 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2044 printf("appid : %s\n", appid);
2048 static int list_apps(const char *pkgid)
2051 pkgmgrinfo_pkginfo_h handle;
2052 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2053 if (ret != PMINFO_R_OK)
2055 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2056 if (ret != PMINFO_R_OK) {
2057 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2060 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2065 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2066 pkgmgrinfo_app_list_cb app_func, void *user_data);
2067 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2068 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2071 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2072 * @brief This API gets list of installed applications from all packages with minimum informaion.
2074 * @par This API is for package-manager client application
2075 * @par Sync (or) Async : Synchronous API
2076 * @param[in] app_func iteration function for list
2077 * @param[in] user_data user data to be passed to callback function
2078 * @return 0 if success, error code(<0) if fail
2079 * @retval PMINFO_R_OK success
2080 * @retval PMINFO_R_EINVAL invalid argument
2081 * @retval PMINFO_R_ERROR internal error
2085 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2087 char *pkgid1 = NULL;
2088 char *pkgid2 = NULL;
2089 pkgid1 = (char *)user_data;
2090 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2091 if (strcmp(pkgid1, pkgid2) == 0) {
2098 static int list_apps()
2101 char *name = "helloworld";
2102 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2103 if (ret != PMINFO_R_OK) {
2110 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2111 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2114 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2115 * @brief This API gets list of installed applications from all packages.
2117 * @par This API is for package-manager client application
2118 * @par Sync (or) Async : Synchronous API
2119 * @param[in] app_func iteration function for list
2120 * @param[in] user_data user data to be passed to callback function
2121 * @return 0 if success, error code(<0) if fail
2122 * @retval PMINFO_R_OK success
2123 * @retval PMINFO_R_EINVAL invalid argument
2124 * @retval PMINFO_R_ERROR internal error
2128 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2130 char *pkgid1 = NULL;
2131 char *pkgid2 = NULL;
2132 pkgid1 = (char *)user_data;
2133 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2134 if (strcmp(pkgid1, pkgid2) == 0) {
2141 static int list_apps()
2144 char *name = "helloworld";
2145 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2146 if (ret != PMINFO_R_OK) {
2153 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2154 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2157 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2158 * @brief This API creates the disabled application information handle from db
2160 * @par This API is for package-manager client application
2161 * @par Sync (or) Async : Synchronous API
2163 * @param[in] appid pointer to appid
2164 * @param[out] handle pointer to the application info handle.
2165 * @return 0 if success, error code(<0) if fail
2166 * @retval PMINFO_R_OK success
2167 * @retval PMINFO_R_EINVAL invalid argument
2168 * @retval PMINFO_R_ERROR internal error
2170 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2171 * @see pkgmgrinfo_appinfo_get_pkgid()
2172 * @see pkgmgrinfo_appinfo_is_multiple()
2174 static int get_disabled_app_type(const char *appid)
2178 pkgmgrinfo_appinfo_h handle;
2179 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2180 if (ret != PMINFO_R_OK)
2182 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2183 if (ret != PMINFO_R_OK) {
2184 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2187 printf("apptype: %s\n", type);
2188 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2193 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2194 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2197 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2198 * @brief This API creates the application information handle from db
2200 * @par This API is for package-manager client application
2201 * @par Sync (or) Async : Synchronous API
2203 * @param[in] appid pointer to appid
2204 * @param[out] handle pointer to the application info handle.
2205 * @return 0 if success, error code(<0) if fail
2206 * @retval PMINFO_R_OK success
2207 * @retval PMINFO_R_EINVAL invalid argument
2208 * @retval PMINFO_R_ERROR internal error
2210 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2211 * @see pkgmgrinfo_appinfo_get_pkgid()
2212 * @see pkgmgrinfo_appinfo_is_multiple()
2214 static int get_app_type(const char *appid)
2218 pkgmgrinfo_appinfo_h handle;
2219 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2220 if (ret != PMINFO_R_OK)
2222 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2223 if (ret != PMINFO_R_OK) {
2224 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2227 printf("apptype: %s\n", type);
2228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2233 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2234 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2237 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2238 * @brief This API gets the application ID
2240 * @par This API is for package-manager client application
2241 * @par Sync (or) Async : Synchronous API
2243 * @param[in] handle pointer to the application info handle.
2244 * @param[out] appid pointer to hold appid
2245 * @return 0 if success, error code(<0) if fail
2246 * @retval PMINFO_R_OK success
2247 * @retval PMINFO_R_EINVAL invalid argument
2248 * @retval PMINFO_R_ERROR internal error
2249 * @pre pkgmgrinfo_appinfo_get_appinfo()
2250 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2251 * @see pkgmgrinfo_appinfo_get_pkgid()
2252 * @see pkgmgrinfo_appinfo_is_multiple()
2254 static int get_app_id(const char *appid)
2257 char *app_id = NULL;
2258 pkgmgrinfo_appinfo_h handle;
2259 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2260 if (ret != PMINFO_R_OK)
2262 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2263 if (ret != PMINFO_R_OK) {
2264 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2267 printf("app id: %s\n", app_id);
2268 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2273 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2276 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2277 * @brief This API gets the package name of the application
2279 * @par This API is for package-manager client application
2280 * @par Sync (or) Async : Synchronous API
2282 * @param[in] handle pointer to the application info handle.
2283 * @param[out] pkg_name pointer to hold package name
2284 * @return 0 if success, error code(<0) if fail
2285 * @retval PMINFO_R_OK success
2286 * @retval PMINFO_R_EINVAL invalid argument
2287 * @retval PMINFO_R_ERROR internal error
2288 * @pre pkgmgrinfo_appinfo_get_appinfo()
2289 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2290 * @see pkgmgrinfo_appinfo_get_appid()
2291 * @see pkgmgrinfo_appinfo_is_multiple()
2293 static int get_app_pkgname(const char *appid)
2296 char *pkgname = NULL;
2297 pkgmgrinfo_appinfo_h handle;
2298 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2299 if (ret != PMINFO_R_OK)
2301 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2302 if (ret != PMINFO_R_OK) {
2303 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2306 printf("pkg name: %s\n", pkgname);
2307 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2312 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2315 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2316 * @brief This API gets the package id of the application
2318 * @par This API is for package-manager client application
2319 * @par Sync (or) Async : Synchronous API
2321 * @param[in] handle pointer to the application info handle.
2322 * @param[out] pkgid pointer to hold package id
2323 * @return 0 if success, error code(<0) if fail
2324 * @retval PMINFO_R_OK success
2325 * @retval PMINFO_R_EINVAL invalid argument
2326 * @retval PMINFO_R_ERROR internal error
2327 * @pre pkgmgrinfo_appinfo_get_appinfo()
2328 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2329 * @see pkgmgrinfo_appinfo_get_appid()
2330 * @see pkgmgrinfo_appinfo_is_multiple()
2332 static int get_app_pkgid(const char *appid)
2336 pkgmgrinfo_appinfo_h handle;
2337 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2338 if (ret != PMINFO_R_OK)
2340 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2341 if (ret != PMINFO_R_OK) {
2342 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2345 printf("pkg id: %s\n", pkgid);
2346 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2351 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2354 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2355 * @brief This API gets the package type of the application
2357 * @par This API is for package-manager client application
2358 * @par Sync (or) Async : Synchronous API
2360 * @param[in] handle pointer to the application info handle.
2361 * @param[out] pkgtype pointer to hold package type
2362 * @return 0 if success, error code(<0) if fail
2363 * @retval PMINFO_R_OK success
2364 * @retval PMINFO_R_EINVAL invalid argument
2365 * @retval PMINFO_R_ERROR internal error
2366 * @pre pkgmgrinfo_appinfo_get_appinfo()
2367 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2368 * @see pkgmgrinfo_appinfo_get_appid()
2369 * @see pkgmgrinfo_appinfo_is_multiple()
2371 static int get_app_pkgtype(const char *appid)
2374 char *pkgtype = NULL;
2375 pkgmgrinfo_appinfo_h handle = NULL;
2376 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2377 if (ret != PMINFO_R_OK)
2379 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2380 if (ret != PMINFO_R_OK) {
2381 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2384 printf("pkgtype: %s\n", pkgtype);
2385 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2390 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2393 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2394 * @brief This API gets the executable name of the application
2396 * @par This API is for package-manager client application
2397 * @par Sync (or) Async : Synchronous API
2399 * @param[in] handle pointer to the application info handle.
2400 * @param[out] exec pointer to hold app exec name
2401 * @return 0 if success, error code(<0) if fail
2402 * @retval PMINFO_R_OK success
2403 * @retval PMINFO_R_EINVAL invalid argument
2404 * @retval PMINFO_R_ERROR internal error
2405 * @pre pkgmgrinfo_appinfo_get_appinfo()
2406 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2407 * @see pkgmgrinfo_appinfo_get_appid()
2408 * @see pkgmgrinfo_appinfo_is_multiple()
2410 static int get_app_exec(const char *appid)
2414 pkgmgrinfo_appinfo_h handle;
2415 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2416 if (ret != PMINFO_R_OK)
2418 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2419 if (ret != PMINFO_R_OK) {
2420 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2423 printf("exec name: %s\n", exec);
2424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2429 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2432 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2433 * @brief This API gets the icon name of the application
2435 * @par This API is for package-manager client application
2436 * @par Sync (or) Async : Synchronous API
2438 * @param[in] handle pointer to the application info handle.
2439 * @param[out] icon pointer to hold app icon name
2440 * @return 0 if success, error code(<0) if fail
2441 * @retval PMINFO_R_OK success
2442 * @retval PMINFO_R_EINVAL invalid argument
2443 * @retval PMINFO_R_ERROR internal error
2444 * @pre pkgmgrinfo_appinfo_get_appinfo()
2445 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2446 * @see pkgmgrinfo_appinfo_get_appid()
2447 * @see pkgmgrinfo_appinfo_is_multiple()
2449 static int get_app_icon(const char *appid)
2453 pkgmgrinfo_appinfo_h handle;
2454 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2455 if (ret != PMINFO_R_OK)
2457 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2458 if (ret != PMINFO_R_OK) {
2459 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2462 printf("icon name: %s\n", icon);
2463 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2468 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2471 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2472 * @brief This API gets the label of the application
2474 * @par This API is for package-manager client application
2475 * @par Sync (or) Async : Synchronous API
2477 * @param[in] handle pointer to the application info handle.
2478 * @param[out] label pointer to hold app label
2479 * @return 0 if success, error code(<0) if fail
2480 * @retval PMINFO_R_OK success
2481 * @retval PMINFO_R_EINVAL invalid argument
2482 * @retval PMINFO_R_ERROR internal error
2483 * @pre pkgmgrinfo_appinfo_get_appinfo()
2484 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2485 * @see pkgmgrinfo_appinfo_get_appid()
2486 * @see pkgmgrinfo_appinfo_is_multiple()
2488 static int get_app_label(const char *appid)
2492 pkgmgrinfo_appinfo_h handle;
2493 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2494 if (ret != PMINFO_R_OK)
2496 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2497 if (ret != PMINFO_R_OK) {
2498 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2501 printf("label : %s\n", label);
2502 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2507 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2510 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2511 * @brief This API gets exactly matched label by given appid and locale
2513 * @par This API is for package-manager client application
2514 * @par Sync (or) Async : Synchronous API
2516 * @param[in] appid pointer to appid
2517 * @param[in] locale pointer to locale
2518 * @param[out] label pointer to hold app label
2519 * @return 0 if success, error code(<0) if fail
2520 * @retval PMINFO_R_OK success
2521 * @retval PMINFO_R_EINVAL invalid argument
2522 * @retval PMINFO_R_ERROR internal error
2524 static int get_localed_label(const char *appid, const char *locale)
2529 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2530 if (ret != PMINFO_R_OK)
2533 printf("localed label: %s\n", label);
2541 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2542 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2545 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2546 * @brief This API gets metadata value by given metadata key
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[in] metadata_key metadata key
2553 * @param[out] metadata_value pointer to hold metadata value
2554 * @return 0 if success, error code(<0) if fail
2555 * @retval PMINFO_R_OK success
2556 * @retval PMINFO_R_EINVAL invalid argument
2558 static int get_metadata_value(const char *appid, const char *metadata_key)
2561 pkgmgrinfo_appinfo_h handle = NULL;
2562 char *metadata_value = NULL;
2564 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2565 if (ret != PMINFO_R_OK)
2568 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2569 if (ret != PMINFO_R_OK) {
2570 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2574 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2579 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2582 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2583 * @brief This API gets the component of the application
2585 * @par This API is for package-manager client application
2586 * @par Sync (or) Async : Synchronous API
2588 * @param[in] handle pointer to the application info handle.
2589 * @param[out] component pointer to hold app component
2590 * @return 0 if success, error code(<0) if fail
2591 * @retval PMINFO_R_OK success
2592 * @retval PMINFO_R_EINVAL invalid argument
2593 * @retval PMINFO_R_ERROR internal error
2594 * @pre pkgmgrinfo_appinfo_get_appinfo()
2595 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2596 * @see pkgmgrinfo_appinfo_get_appid()
2597 * @see pkgmgrinfo_appinfo_is_multiple()
2599 static int get_app_component(const char *appid)
2602 pkgmgrinfo_app_component component;
2603 pkgmgrinfo_appinfo_h handle;
2604 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2605 if (ret != PMINFO_R_OK)
2607 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2608 if (ret != PMINFO_R_OK) {
2609 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2612 printf("component : %s\n", component);
2613 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2618 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2621 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2622 * @brief This API gets the apptype of the application
2624 * @par This API is for package-manager client application
2625 * @par Sync (or) Async : Synchronous API
2627 * @param[in] handle pointer to the application info handle.
2628 * @param[out] app_type pointer to hold apptype
2629 * @return 0 if success, error code(<0) if fail
2630 * @retval PMINFO_R_OK success
2631 * @retval PMINFO_R_EINVAL invalid argument
2632 * @retval PMINFO_R_ERROR internal error
2633 * @pre pkgmgrinfo_appinfo_get_appinfo()
2634 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2635 * @see pkgmgrinfo_appinfo_get_appid()
2636 * @see pkgmgrinfo_appinfo_is_multiple()
2638 static int get_app_type(const char *appid)
2641 char *apptype = NULL;
2642 pkgmgrinfo_appinfo_h handle;
2643 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2644 if (ret != PMINFO_R_OK)
2646 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2647 if (ret != PMINFO_R_OK) {
2648 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2651 printf("apptype : %s\n", apptype);
2652 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2657 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2660 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2661 int *operation_count, char ***operation)
2662 * @brief This API gets the list of operation of the application
2664 * @par This API is for package-manager client application
2665 * @par Sync (or) Async : Synchronous API
2667 * @param[in] handle pointer to the appcontrol handle.
2668 * @param[out] operation_count pointer to hold number of operations
2669 * @param[out] operation pointer to hold list of operations
2670 * @return 0 if success, error code(<0) if fail
2671 * @retval PMINFO_R_OK success
2672 * @retval PMINFO_R_EINVAL invalid argument
2673 * @retval PMINFO_R_ERROR internal error
2674 * @pre pkgmgrinfo_appinfo_get_appinfo()
2675 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2676 * @see pkgmgrinfo_appinfo_get_uri()
2677 * @see pkgmgrinfo_appinfo_get_mime()
2679 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2684 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2685 for (i = 0; i < oc; i++) {
2686 if (strcmp(operation[i], (char *)user_data) == 0)
2693 static int check_operation(const char *appid, char *operation)
2696 pkgmgrinfo_appinfo_h handle;
2697 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2698 if (ret != PMINFO_R_OK)
2700 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2701 if (ret != PMINFO_R_OK) {
2702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2705 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2710 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2711 int *operation_count, char ***operation);
2714 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2715 int *uri_count, char ***uri)
2716 * @brief This API gets the list of uri of the application
2718 * @par This API is for package-manager client application
2719 * @par Sync (or) Async : Synchronous API
2721 * @param[in] handle pointer to the appcontrol handle.
2722 * @param[out] uri_count pointer to hold number of uris
2723 * @param[out] uri pointer to hold list of uris
2724 * @return 0 if success, error code(<0) if fail
2725 * @retval PMINFO_R_OK success
2726 * @retval PMINFO_R_EINVAL invalid argument
2727 * @retval PMINFO_R_ERROR internal error
2728 * @pre pkgmgrinfo_appinfo_get_appinfo()
2729 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2730 * @see pkgmgrinfo_appinfo_get_operation()
2731 * @see pkgmgrinfo_appinfo_get_mime()
2733 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2738 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2739 for (i = 0; i < uc; i++) {
2740 if (strcmp(uri[i], (char *)user_data) == 0)
2747 static int check_uri(const char *appid, char *uri)
2750 pkgmgrinfo_appinfo_h handle;
2751 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2752 if (ret != PMINFO_R_OK)
2754 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2755 if (ret != PMINFO_R_OK) {
2756 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2759 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2764 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2765 int *uri_count, char ***uri);
2768 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2769 int *mime_count, char ***mime)
2770 * @brief This API gets the list of mime of the application
2772 * @par This API is for package-manager client application
2773 * @par Sync (or) Async : Synchronous API
2775 * @param[in] handle pointer to the appcontrol handle.
2776 * @param[out] mime_count pointer to hold number of mimes
2777 * @param[out] mime pointer to hold list of mimes
2778 * @return 0 if success, error code(<0) if fail
2779 * @retval PMINFO_R_OK success
2780 * @retval PMINFO_R_EINVAL invalid argument
2781 * @retval PMINFO_R_ERROR internal error
2782 * @pre pkgmgrinfo_appinfo_get_appinfo()
2783 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2784 * @see pkgmgrinfo_appinfo_get_uri()
2785 * @see pkgmgrinfo_appinfo_get_operation()
2787 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2792 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2793 for (i = 0; i < mc; i++) {
2794 if (strcmp(mime[i], (char *)user_data) == 0)
2801 static int check_mime(const char *appid, char *mime)
2804 pkgmgrinfo_appinfo_h handle;
2805 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2806 if (ret != PMINFO_R_OK)
2808 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2809 if (ret != PMINFO_R_OK) {
2810 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2813 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2818 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2819 int *mime_count, char ***mime);
2822 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2823 int *subapp_count, char ***subapp)
2824 * @brief This API gets the list of subapp of the application
2826 * @par This API is for package-manager client application
2827 * @par Sync (or) Async : Synchronous API
2829 * @param[in] handle pointer to the appcontrol handle.
2830 * @param[out] subapp_count pointer to hold number of subapp
2831 * @param[out] subapp pointer to hold list of subapp
2832 * @return 0 if success, error code(<0) if fail
2833 * @retval PMINFO_R_OK success
2834 * @retval PMINFO_R_EINVAL invalid argument
2835 * @retval PMINFO_R_ERROR internal error
2836 * @pre pkgmgrinfo_appinfo_get_appinfo()
2837 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2838 * @see pkgmgrinfo_appinfo_get_uri()
2839 * @see pkgmgrinfo_appinfo_get_operation()
2841 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2845 char **subapp = NULL;
2846 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2847 for (i = 0; i < sc; i++) {
2848 if (strcmp(subapp[i], (char *)user_data) == 0)
2855 static int check_subapp(const char *appid, char *subapp)
2858 pkgmgrinfo_appinfo_h handle = NULL;
2859 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2860 if (ret != PMINFO_R_OK)
2862 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2863 if (ret != PMINFO_R_OK) {
2864 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2872 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2873 int *subapp_count, char ***subapp);
2876 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2877 * @brief This API gets the notification icon of the application
2879 * @par This API is for package-manager client application
2880 * @par Sync (or) Async : Synchronous API
2882 * @param[in] handle pointer to the application info handle.
2883 * @param[out] path pointer to hold notification icon
2884 * @return 0 if success, error code(<0) if fail
2885 * @retval PMINFO_R_OK success
2886 * @retval PMINFO_R_EINVAL invalid argument
2887 * @retval PMINFO_R_ERROR internal error
2888 * @pre pkgmgrinfo_appinfo_get_appinfo()
2889 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2890 * @see pkgmgrinfo_appinfo_get_appid()
2891 * @see pkgmgrinfo_appinfo_is_multiple()
2893 static int get_app_notification_icon(const char *appid)
2896 char *notification_icon = NULL;
2897 pkgmgrinfo_appinfo_h handle;
2898 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2899 if (ret != PMINFO_R_OK)
2901 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2902 if (ret != PMINFO_R_OK) {
2903 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2906 printf("notification icon : %s\n", notification_icon);
2907 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2912 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2915 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2916 * @brief This API gets the setting icon of the application
2918 * @par This API is for package-manager client application
2919 * @par Sync (or) Async : Synchronous API
2921 * @param[in] handle pointer to the application info handle.
2922 * @param[out] path pointer to hold setting icon
2923 * @return 0 if success, error code(<0) if fail
2924 * @retval PMINFO_R_OK success
2925 * @retval PMINFO_R_EINVAL invalid argument
2926 * @retval PMINFO_R_ERROR internal error
2927 * @pre pkgmgrinfo_appinfo_get_appinfo()
2928 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2929 * @see pkgmgrinfo_appinfo_get_appid()
2930 * @see pkgmgrinfo_appinfo_is_multiple()
2932 static int get_app_setting_icon(const char *appid)
2935 char *setting_icon = NULL;
2936 pkgmgrinfo_appinfo_h handle;
2937 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2938 if (ret != PMINFO_R_OK)
2940 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2941 if (ret != PMINFO_R_OK) {
2942 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2945 printf("setting icon : %s\n", setting_icon);
2946 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2951 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2954 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2955 * @brief This API gets the type of recent image on app-tray
2957 * @par This API is for package-manager client application
2958 * @par Sync (or) Async : Synchronous API
2960 * @param[in] handle pointer to the application info handle.
2961 * @param[out] type pointer to hold image type
2962 * @return 0 if success, error code(<0) if fail
2963 * @retval PMINFO_R_OK success
2964 * @retval PMINFO_R_EINVAL invalid argument
2965 * @retval PMINFO_R_ERROR internal error
2966 * @pre pkgmgrinfo_appinfo_get_appinfo()
2967 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2968 * @see pkgmgrinfo_appinfo_get_appid()
2969 * @see pkgmgrinfo_appinfo_is_multiple()
2971 static int get_app_recent_image_type(const char *appid)
2974 pkgmgrinfo_app_recentimage type;
2975 pkgmgrinfo_appinfo_h handle;
2976 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2977 if (ret != PMINFO_R_OK)
2979 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2980 if (ret != PMINFO_R_OK) {
2981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2984 printf("recent image type: %d\n", type);
2985 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2990 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2994 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2995 * @brief This API gets the preview image of application
2997 * @par Sync (or) Async : Synchronous API
2999 * @param[in] handle pointer to the application info handle.
3000 * @param[out] preview_img pointer to hold preview image path
3001 * @return 0 if success, error code(<0) if fail
3002 * @retval PMINFO_R_OK success
3003 * @retval PMINFO_R_EINVAL invalid argument
3004 * @retval PMINFO_R_ERROR internal error
3005 * @pre pkgmgrinfo_appinfo_get_appinfo()
3006 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3007 * @see pkgmgrinfo_appinfo_get_appid()
3009 static int get_app_previewimage(const char *appid)
3012 char *preview = NULL;
3013 pkgmgrinfo_appinfo_h handle = NULL;
3014 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3015 if (ret != PMINFO_R_OK)
3017 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3018 if (ret != PMINFO_R_OK) {
3019 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3022 printf("preview image path : %s\n", preview);
3023 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3028 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3032 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3033 * @brief This API gets the package permission type of the application
3035 * @par This API is for package-manager client application
3036 * @par Sync (or) Async : Synchronous API
3038 * @param[in] handle pointer to the application info handle.
3039 * @param[out] permission pointer to hold package permission
3040 * @return 0 if success, error code(<0) if fail
3041 * @retval PMINFO_R_OK success
3042 * @retval PMINFO_R_EINVAL invalid argument
3043 * @retval PMINFO_R_ERROR internal error
3044 * @pre pkgmgrinfo_appinfo_get_appinfo()
3045 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3046 * @see pkgmgrinfo_appinfo_get_appid()
3048 static int get_app_permission(const char *appid)
3051 pkgmgrinfo_permission_type permission = 0;
3052 pkgmgrinfo_appinfo_h handle;
3054 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3055 if (ret != PMINFO_R_OK)
3057 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3058 if (ret != PMINFO_R_OK) {
3059 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3062 printf("permission type: %d\n", permission);
3063 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3068 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3071 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3072 * @brief This API gets the component_type
3074 * @par This API is for package-manager client application
3075 * @par Sync (or) Async : Synchronous API
3077 * @param[in] handle pointer to the application info handle.
3078 * @param[out] component_type pointer to hold component_type
3079 * @return 0 if success, error code(<0) if fail
3080 * @retval PMINFO_R_OK success
3081 * @retval PMINFO_R_EINVAL invalid argument
3082 * @retval PMINFO_R_ERROR internal error
3083 * @pre pkgmgrinfo_appinfo_get_appinfo()
3084 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3085 * @see pkgmgrinfo_appinfo_get_pkgid()
3086 * @see pkgmgrinfo_appinfo_is_multiple()
3088 static int get_component_type(const char *appid)
3091 char *component_type = NULL;
3092 pkgmgrinfo_appinfo_h handle;
3093 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3094 if (ret != PMINFO_R_OK)
3096 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3097 if (ret != PMINFO_R_OK) {
3098 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3101 printf("component_type: %s\n", component_type);
3102 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3107 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3110 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3111 * @brief This API gets the application 'hwacceleration' value from the app ID
3113 * @par This API is for package-manager client application
3114 * @par Sync (or) Async : Synchronous API
3116 * @param[in] handle pointer to application info handle
3117 * @param[out] hwacceleration pointer to hold package hwacceleration value
3118 * @return 0 if success, error code(<0) if fail
3119 * @retval PMINFO_R_OK success
3120 * @retval PMINFO_R_EINVAL invalid argument
3121 * @retval PMINFO_R_ERROR internal error
3122 * @pre pkgmgrinfo_appinfo_get_appinfo()
3123 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3124 * @see pkgmgrinfo_appinfo_get_appid()
3125 * @see pkgmgrinfo_appinfo_is_multiple()
3127 static int get_app_hwacceleration(const char *appid)
3130 pkgmgrinfo_app_hwacceleration hwacceleration;
3131 pkgmgrinfo_appinfo_h handle;
3132 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3133 if (ret != PMINFO_R_OK)
3135 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3136 if (ret != PMINFO_R_OK) {
3137 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3140 printf("app hwacceleration: %d\n", hwacceleration);
3141 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3146 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3149 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3150 * @brief This API gets the application 'screenreader' value from the app ID
3152 * @par This API is for package-manager client application
3153 * @par Sync (or) Async : Synchronous API
3155 * @param[in] handle pointer to application info handle
3156 * @param[out] screenreader pointer to hold package accessibility value
3157 * @return 0 if success, error code(<0) if fail
3158 * @retval PMINFO_R_OK success
3159 * @retval PMINFO_R_EINVAL invalid argument
3160 * @retval PMINFO_R_ERROR internal error
3161 * @pre pkgmgrinfo_appinfo_get_appinfo()
3162 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3163 * @see pkgmgrinfo_appinfo_get_appid()
3164 * @see pkgmgrinfo_appinfo_is_multiple()
3166 static int get_app_screenreader(const char *appid)
3169 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3170 pkgmgrinfo_appinfo_h handle = NULL;
3171 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3172 if (ret != PMINFO_R_OK)
3174 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3175 if (ret != PMINFO_R_OK) {
3176 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3179 printf("app screenreader: %d\n", screenreader);
3180 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3185 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3188 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3189 * @brief This API gets the application's landscape & portrait effect images
3191 * @par This API is for package-manager client application
3192 * @par Sync (or) Async : Synchronous API
3194 * @param[in] handle pointer to application info handle
3195 * @param[out] portrait_img contains portrait mode effect image
3196 * @param[out] landscape_img contains landscape mode effect image
3197 * @return 0 if success, error code(<0) if fail
3198 * @retval PMINFO_R_OK success
3199 * @retval PMINFO_R_EINVAL invalid argument
3200 * @retval PMINFO_R_ERROR internal error
3201 * @pre pkgmgrinfo_appinfo_get_appinfo()
3202 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3203 * @see pkgmgrinfo_appinfo_get_appid()
3204 * @see pkgmgrinfo_appinfo_is_nodisplay()
3206 static int get_app_effectimages(const char *appid)
3209 char *portraitimg = NULL;
3210 char *landscapeimg = NULL;
3211 pkgmgrinfo_appinfo_h handle;
3212 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3213 if (ret != PMINFO_R_OK)
3215 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3216 if (ret != PMINFO_R_OK) {
3217 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3220 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3221 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3226 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3229 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3230 * @brief This API gets the application's effect image type
3232 * @par This API is for package-manager client application
3233 * @par Sync (or) Async : Synchronous API
3235 * @param[in] handle pointer to application info handle
3236 * @param[out] effectimg_type contains effect image type
3237 * @return 0 if success, error code(<0) if fail
3238 * @retval PMINFO_R_OK success
3239 * @retval PMINFO_R_EINVAL invalid argument
3240 * @retval PMINFO_R_ERROR internal error
3241 * @pre pkgmgrinfo_appinfo_get_appinfo()
3242 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3243 * @see pkgmgrinfo_appinfo_get_appid()
3244 * @see pkgmgrinfo_appinfo_is_nodisplay()
3246 static int get_app_effectimage_type(const char *appid)
3249 char *effectimg_type = NULL;
3250 pkgmgrinfo_appinfo_h handle = NULL;
3251 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3252 if (ret != PMINFO_R_OK)
3254 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3255 if (ret != PMINFO_R_OK) {
3256 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3259 printf("app effect image type: %s\n", effectimg_type);
3260 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3265 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3268 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3269 * @brief This API gets the submode_mainid of the application
3271 * @par This API is for package-manager client application
3272 * @par Sync (or) Async : Synchronous API
3274 * @param[in] handle pointer to the application info handle.
3275 * @param[out] submode_mainid pointer to hold package name
3276 * @return 0 if success, error code(<0) if fail
3277 * @retval PMINFO_R_OK success
3278 * @retval PMINFO_R_EINVAL invalid argument
3279 * @retval PMINFO_R_ERROR internal error
3280 * @pre pkgmgrinfo_appinfo_get_appinfo()
3281 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3282 * @see pkgmgrinfo_appinfo_get_appid()
3283 * @see pkgmgrinfo_appinfo_is_multiple()
3285 static int get_app_submode_mainid(const char *appid)
3288 char *submode_mainid = NULL;
3289 pkgmgrinfo_appinfo_h handle = NULL;
3290 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3291 if (ret != PMINFO_R_OK)
3293 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3294 if (ret != PMINFO_R_OK) {
3295 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3298 printf("submode_mainid: %s\n", submode_mainid);
3299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3304 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3307 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3308 * @brief This API gets the datacontrol info
3310 * @par This API is for package-manager client application
3311 * @par Sync (or) Async : Synchronous API
3313 * @param[in] providerid pointer to the providerid of dataconltrol.
3314 * @param[in] type pointer to the type of dataconltrol.
3315 * @param[out] appid pointer to hold appid, need to free after using
3316 * @param[out] access pointer to hold access, need to free after using
3317 * @return 0 if success, error code(<0) if fail
3318 * @retval PMINFO_R_OK success
3319 * @retval PMINFO_R_EINVAL invalid argument
3320 * @retval PMINFO_R_ERROR internal error
3323 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3324 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3327 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3328 * @brief This API gets the appid of datacontrol
3330 * @par This API is for package-manager client application
3331 * @par Sync (or) Async : Synchronous API
3333 * @param[in] providerid pointer to the providerid of dataconltrol.
3334 * @param[out] appid pointer to hold appid, need to free after using
3335 * @return 0 if success, error code(<0) if fail
3336 * @retval PMINFO_R_OK success
3337 * @retval PMINFO_R_EINVAL invalid argument
3338 * @retval PMINFO_R_ERROR internal error
3341 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3342 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3345 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3346 * @brief This API gets the alias_appid of the application
3348 * @par This API is for package-manager client application
3349 * @par Sync (or) Async : Synchronous API
3351 * @param[in] handle pointer to the application info handle.
3352 * @param[out] alias_appid pointer to hold app alias_appid
3353 * @return 0 if success, error code(<0) if fail
3354 * @retval PMINFO_R_OK success
3355 * @retval PMINFO_R_EINVAL invalid argument
3356 * @retval PMINFO_R_ERROR internal error
3357 * @pre pkgmgrinfo_appinfo_get_appinfo()
3358 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3359 * @see pkgmgrinfo_appinfo_get_appid()
3361 static int get_alias_appid(const char *appid)
3364 char *alias_appid= 0;
3365 pkgmgrinfo_appinfo_h handle = NULL;
3366 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3367 if (ret != PMINFO_R_OK)
3369 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3370 if (ret != PMINFO_R_OK) {
3371 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3374 printf("alias_appid: %s\n", alias_appid);
3375 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3380 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3383 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3384 * @brief This API gets the effective_appid of the application
3386 * @par This API is for package-manager client application
3387 * @par Sync (or) Async : Synchronous API
3389 * @param[in] handle pointer to the application info handle.
3390 * @param[out] effective_appid pointer to hold app effective_appid
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
3395 * @pre pkgmgrinfo_appinfo_get_appinfo()
3396 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3397 * @see pkgmgrinfo_appinfo_get_appid()
3399 static int get_effective_appid(const char *appid)
3402 char *effective_appid= 0;
3403 pkgmgrinfo_appinfo_h handle = NULL;
3404 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3405 if (ret != PMINFO_R_OK)
3407 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3408 if (ret != PMINFO_R_OK) {
3409 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3412 printf("effective_appid: %s\n", effective_appid);
3413 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3418 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3421 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3422 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3424 * @par This API is for package-manager client application
3425 * @par Sync (or) Async : Synchronous API
3427 * @param[in] handle pointer to the appinfo handle.
3428 * @param[out] tep_name pointer to hold tep name
3429 * @return 0 if success, error code(<0) if fail
3430 * @retval PMINFO_R_OK success
3431 * @retval PMINFO_R_EINVAL invalid argument
3432 * @retval PMINFO_R_ERROR internal error
3433 * @pre pkgmgrinfo_appinfo_get_appinfo()
3434 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3435 * @see pkgmgrinfo_appinfo_get_appid()
3437 static int get_tep_name(const char *appid)
3440 char *tep_name = NULL;
3441 pkgmgrinfo_appinfo_h handle = NULL;
3442 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3443 if (ret != PMINFO_R_OK)
3445 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3446 if (ret != PMINFO_R_OK) {
3447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3450 printf("TEP name is: %s\n", tep_name);
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3459 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3460 * @brief This API gets zip mount file name associated with the package which contain given application
3461 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3463 * @par This API is for package-manager client application
3464 * @par Sync (or) Async : Synchronous API
3466 * @param[in] handle pointer to the appinfo handle.
3467 * @param[out] zip_mount_file pointer to hold zip mount file name
3468 * @return 0 if success, error code(<0) if fail
3469 * @retval PMINFO_R_OK success
3470 * @retval PMINFO_R_EINVAL invalid argument
3471 * @retval PMINFO_R_ERROR internal error
3472 * @pre pkgmgrinfo_appinfo_get_appinfo()
3473 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3474 * @see pkgmgrinfo_appinfo_get_appid()
3476 static int get_zip_mount_file(const char *appid)
3479 char *zip_mount_file = NULL;
3480 pkgmgrinfo_appinfo_h handle = NULL;
3481 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3482 if (ret != PMINFO_R_OK)
3484 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3485 if (ret != PMINFO_R_OK) {
3486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3489 printf("Mount file name is: %s\n", zip_mount_file);
3490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3495 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3498 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3499 * @brief This API gets the root path of application
3501 * @par Sync (or) Async : Synchronous API
3503 * @param[in] handle pointer to appinfo handle
3504 * @param[out] path pointer to hold root path of application
3505 * @return 0 if success, error code(<0) if fail
3506 * @retval PMINFO_R_OK success
3507 * @retval PMINFO_R_EINVAL invalid argument
3508 * @retval PMINFO_R_ERROR internal error
3510 static int get_root_path(const char *appid)
3514 pkgmgrinfo_appinfo_h handle;
3515 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3516 if (ret != PMINFO_R_OK)
3519 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3520 if (ret != PMINFO_R_OK) {
3521 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3524 printf("path : %s\n", path);
3525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3531 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3534 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3535 * @brief This API gets the application api_version from the application ID
3537 * @par This API is for package-manager client application
3538 * @par Sync (or) Async : Synchronous API
3540 * @param[in] handle pointer to appinfo handle
3541 * @param[out] api_version pointer to hold application api_version
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_app_api_version(const char *appid)
3553 char *api_version = 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_api_version(handle, &api_version);
3559 if (ret != PMINFO_R_OK) {
3560 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3563 printf("app api_version: %s\n", api_version);
3564 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3569 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3572 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3573 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3574 * @brief This API gets the list of permission for a particular application
3576 * @par This API is for package-manager client application
3577 * @par Sync (or) Async : Synchronous API
3578 * @param[in] handle pointer to the application info handle.
3579 * @param[in] permission_func callback function for list
3580 * @param[in] user_data user data to be passed to callback function
3581 * @return 0 if success, error code(<0) if fail
3582 * @retval PMINFO_R_OK success
3583 * @retval PMINFO_R_EINVAL invalid argument
3584 * @retval PMINFO_R_ERROR internal error
3585 * @pre pkgmgrinfo_appinfo_get_appinfo()
3586 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3588 int permission_func(const char *name, void *user_data)
3590 if (strcmp(name, (char *)user_data) == 0)
3596 static int list_permission(const char *appid, char *permission)
3599 pkgmgrinfo_appinfo_h handle;
3600 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3601 if (ret != PMINFO_R_OK)
3603 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3604 if (ret != PMINFO_R_OK) {
3605 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3608 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3613 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3614 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3617 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3618 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3619 * @brief This API gets the list of category for a particular application
3621 * @par This API is for package-manager client application
3622 * @par Sync (or) Async : Synchronous API
3623 * @param[in] handle pointer to the application info handle.
3624 * @param[in] category_func callback function for list
3625 * @param[in] user_data user data to be passed to callback function
3626 * @return 0 if success, error code(<0) if fail
3627 * @retval PMINFO_R_OK success
3628 * @retval PMINFO_R_EINVAL invalid argument
3629 * @retval PMINFO_R_ERROR internal error
3630 * @pre pkgmgrinfo_appinfo_get_appinfo()
3631 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3633 int category_func(const char *name, void *user_data)
3635 if (strcmp(name, (char *)user_data) == 0)
3641 static int list_category(const char *appid, char *category)
3644 pkgmgrinfo_appinfo_h handle;
3645 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3646 if (ret != PMINFO_R_OK)
3648 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3649 if (ret != PMINFO_R_OK) {
3650 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3653 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3658 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3659 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3662 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3663 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3664 * @brief This API gets the list of metadata for a particular application
3666 * @par This API is for package-manager client application
3667 * @par Sync (or) Async : Synchronous API
3668 * @param[in] handle pointer to the application info handle.
3669 * @param[in] metadata_func callback function for list
3670 * @param[in] user_data user data to be passed to callback function
3671 * @return 0 if success, error code(<0) if fail
3672 * @retval PMINFO_R_OK success
3673 * @retval PMINFO_R_EINVAL invalid argument
3674 * @retval PMINFO_R_ERROR internal error
3675 * @pre pkgmgrinfo_appinfo_get_appinfo()
3676 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3678 int metadata_func(const char *key, const char *value, void *user_data)
3680 if (strcmp(key, (char *)user_data) == 0) {
3681 printf("Value is %s\n", value);
3688 static int list_metadata(const char *appid, char *key)
3691 pkgmgrinfo_appinfo_h handle;
3692 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3693 if (ret != PMINFO_R_OK)
3695 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3696 if (ret != PMINFO_R_OK) {
3697 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3700 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3705 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3706 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3710 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3711 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3712 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3713 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3714 * @brief This API gets the list of app-control for a particular application
3716 * @par This API is for package-manager client application
3717 * @par Sync (or) Async : Synchronous API
3718 * @param[in] handle pointer to the application info handle.
3719 * @param[in] appcontrol_func callback function for list
3720 * @param[in] user_data user data to be passed to callback function
3721 * @param[in] uid the addressee user id of the instruction
3722 * @return 0 if success, error code(<0) if fail
3723 * @retval PMINFO_R_OK success
3724 * @retval PMINFO_R_EINVAL invalid argument
3725 * @retval PMINFO_R_ERROR internal error
3726 * @pre pkgmgrinfo_appinfo_get_appinfo()
3727 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3729 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3734 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3735 for (i = 0; i < oc; i++) {
3736 if (strcmp(operation[i], (char *)user_data) == 0)
3743 static int check_operation(const char *appid, char *operation)
3746 pkgmgrinfo_appinfo_h handle;
3747 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3748 if (ret != PMINFO_R_OK)
3750 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3751 if (ret != PMINFO_R_OK) {
3752 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3755 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3760 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3761 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3766 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3767 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3770 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3771 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3772 * @brief This API gets the list of splashscreen for a particular application
3774 * @par This API is for package-manager client application
3775 * @par Sync (or) Async : Synchronous API
3776 * @param[in] handle pointer to the application info handle.
3777 * @param[in] splash_screen_func callback function for list
3778 * @param[in] user_data user data to be passed to callback function
3779 * @return 0 if success, error code(<0) if fail
3780 * @retval PMINFO_R_OK success
3781 * @retval PMINFO_R_EINVAL invalid argument
3782 * @retval PMINFO_R_ERROR internal error
3783 * @pre pkgmgrinfo_appinfo_get_appinfo()
3784 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3787 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3788 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3791 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3792 * @brief This API gets the application 'nodisplay' value from the app ID
3794 * @par This API is for package-manager client application
3795 * @par Sync (or) Async : Synchronous API
3797 * @param[in] handle pointer to application info handle
3798 * @param[out] nodisplay pointer to hold package nodisplay value
3799 * @return 0 if success, error code(<0) if fail
3800 * @retval PMINFO_R_OK success
3801 * @retval PMINFO_R_EINVAL invalid argument
3802 * @retval PMINFO_R_ERROR internal error
3803 * @pre pkgmgrinfo_appinfo_get_appinfo()
3804 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3805 * @see pkgmgrinfo_appinfo_get_appid()
3806 * @see pkgmgrinfo_appinfo_is_multiple()
3808 static int get_app_nodisplay(const char *appid)
3812 pkgmgrinfo_appinfo_h handle;
3813 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3814 if (ret != PMINFO_R_OK)
3816 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3817 if (ret != PMINFO_R_OK) {
3818 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3821 printf("app nodisplay: %d\n", nodisplay);
3822 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3827 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3830 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3831 * @brief This API gets the application 'multiple' value from the app ID
3833 * @par This API is for package-manager client application
3834 * @par Sync (or) Async : Synchronous API
3836 * @param[in] handle pointer to application info handle
3837 * @param[out] multiple pointer to hold package multiple value
3838 * @return 0 if success, error code(<0) if fail
3839 * @retval PMINFO_R_OK success
3840 * @retval PMINFO_R_EINVAL invalid argument
3841 * @retval PMINFO_R_ERROR internal error
3842 * @pre pkgmgrinfo_appinfo_get_appinfo()
3843 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3844 * @see pkgmgrinfo_appinfo_get_appid()
3845 * @see pkgmgrinfo_appinfo_is_nodisplay()
3847 static int get_app_multiple(const char *appid)
3851 pkgmgrinfo_appinfo_h handle;
3852 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3853 if (ret != PMINFO_R_OK)
3855 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3856 if (ret != PMINFO_R_OK) {
3857 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3860 printf("app multiple: %d\n", multiple);
3861 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3866 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3869 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3870 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3871 * application launching effect. If fales, indicator will be hidden during application launching effect
3873 * @par This API is for package-manager client application
3874 * @par Sync (or) Async : Synchronous API
3876 * @param[in] handle pointer to application info handle
3877 * @param[out] indicator_disp contains indicator display status for application launching effect
3878 * @return 0 if success, error code(<0) if fail
3879 * @retval PMINFO_R_OK success
3880 * @retval PMINFO_R_EINVAL invalid argument
3881 * @retval PMINFO_R_ERROR internal error
3882 * @pre pkgmgrinfo_appinfo_get_appinfo()
3883 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3884 * @see pkgmgrinfo_appinfo_get_appid()
3885 * @see pkgmgrinfo_appinfo_is_nodisplay()
3887 static int get_app_indicator_display(const char *appid)
3890 bool indicator_disp;
3891 pkgmgrinfo_appinfo_h handle;
3892 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3893 if (ret != PMINFO_R_OK)
3895 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3896 if (ret != PMINFO_R_OK){
3897 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3900 printf("app indicator disp : %d\n", indicator_disp);
3901 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3906 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3909 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3910 * @brief This API gets the application 'taskmanage' value from the app ID
3912 * @par This API is for package-manager client application
3913 * @par Sync (or) Async : Synchronous API
3915 * @param[in] handle pointer to application info handle
3916 * @param[out] taskmanage pointer to hold package taskmanage value
3917 * @return 0 if success, error code(<0) if fail
3918 * @retval PMINFO_R_OK success
3919 * @retval PMINFO_R_EINVAL invalid argument
3920 * @retval PMINFO_R_ERROR internal error
3921 * @pre pkgmgrinfo_appinfo_get_appinfo()
3922 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3923 * @see pkgmgrinfo_appinfo_get_appid()
3924 * @see pkgmgrinfo_appinfo_is_multiple()
3926 static int get_app_taskmanage(const char *appid)
3930 pkgmgrinfo_appinfo_h handle;
3931 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3932 if (ret != PMINFO_R_OK)
3934 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3935 if (ret != PMINFO_R_OK) {
3936 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3939 printf("app taskmanage: %d\n", taskmanage);
3940 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3945 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3948 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3949 * @brief This API gets the application 'taskmanage' value from the app ID
3951 * @par This API is for package-manager client application
3952 * @par Sync (or) Async : Synchronous API
3954 * @param[in] handle pointer to application info handle
3955 * @param[out] enabled pointer to hold package enabled value
3956 * @return 0 if success, error code(<0) if fail
3957 * @retval PMINFO_R_OK success
3958 * @retval PMINFO_R_EINVAL invalid argument
3959 * @retval PMINFO_R_ERROR internal error
3960 * @pre pkgmgrinfo_appinfo_get_appinfo()
3961 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3962 * @see pkgmgrinfo_appinfo_get_appid()
3963 * @see pkgmgrinfo_appinfo_is_multiple()
3965 static int get_app_enabled(const char *appid)
3969 pkgmgrinfo_appinfo_h handle;
3970 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3971 if (ret != PMINFO_R_OK)
3973 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3974 if (ret != PMINFO_R_OK) {
3975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3978 printf("app enabled: %d\n", enabled);
3979 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3984 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3987 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3988 * @brief This API gets the application 'onboot' value from the app ID
3990 * @par This API is for package-manager client application
3991 * @par Sync (or) Async : Synchronous API
3993 * @param[in] handle pointer to application info handle
3994 * @param[out] onboot pointer to hold package onboot value
3995 * @return 0 if success, error code(<0) if fail
3996 * @retval PMINFO_R_OK success
3997 * @retval PMINFO_R_EINVAL invalid argument
3998 * @retval PMINFO_R_ERROR internal error
3999 * @pre pkgmgrinfo_appinfo_get_appinfo()
4000 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4001 * @see pkgmgrinfo_appinfo_get_appid()
4002 * @see pkgmgrinfo_appinfo_is_multiple()
4004 static int get_app_onboot(const char *appid)
4008 pkgmgrinfo_appinfo_h handle;
4009 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4010 if (ret != PMINFO_R_OK)
4012 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4013 if (ret != PMINFO_R_OK) {
4014 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4017 printf("app onboot: %d\n", onboot);
4018 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4023 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4026 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4027 * @brief This API gets the application 'autorestart' value from the app ID
4029 * @par This API is for package-manager client application
4030 * @par Sync (or) Async : Synchronous API
4032 * @param[in] handle pointer to application info handle
4033 * @param[out] autorestart pointer to hold package autorestart value
4034 * @return 0 if success, error code(<0) if fail
4035 * @retval PMINFO_R_OK success
4036 * @retval PMINFO_R_EINVAL invalid argument
4037 * @retval PMINFO_R_ERROR internal error
4038 * @pre pkgmgrinfo_appinfo_get_appinfo()
4039 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4040 * @see pkgmgrinfo_appinfo_get_appid()
4041 * @see pkgmgrinfo_appinfo_is_multiple()
4043 static int get_app_autorestart(const char *appid)
4047 pkgmgrinfo_appinfo_h handle;
4048 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4049 if (ret != PMINFO_R_OK)
4051 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4052 if (ret != PMINFO_R_OK) {
4053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4056 printf("app autorestart: %d\n", autorestart);
4057 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4062 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4065 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4066 * @brief This API gets the value for given application is main app or not from handle
4068 * @par This API is for package-manager client application
4069 * @par Sync (or) Async : Synchronous API
4071 * @param[in] handle pointer to application info handle
4072 * @param[out] mainapp pointer to hold package mainapp is or not
4073 * @return 0 if success, error code(<0) if fail
4074 * @retval PMINFO_R_OK success
4075 * @retval PMINFO_R_EINVAL invalid argument
4076 * @retval PMINFO_R_ERROR internal error
4077 * @pre pkgmgrinfo_appinfo_get_appinfo()
4078 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4079 * @see pkgmgrinfo_appinfo_get_appid()
4080 * @see pkgmgrinfo_appinfo_is_multiple()
4082 static int get_app_mainapp(const char *appid)
4086 pkgmgrinfo_appinfo_h handle;
4087 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4088 if (ret != PMINFO_R_OK)
4090 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4091 if (ret != PMINFO_R_OK) {
4092 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4095 printf("mainapp: %d\n", mainapp);
4096 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4101 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4105 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4106 * @brief This API gets the value for given application is preload or not from handle
4108 * @par This API is for package-manager client application
4109 * @par Sync (or) Async : Synchronous API
4111 * @param[in] handle pointer to application info handle
4112 * @param[out] preload pointer to hold preload is or not
4113 * @return 0 if success, error code(<0) if fail
4114 * @retval PMINFO_R_OK success
4115 * @retval PMINFO_R_EINVAL invalid argument
4116 * @retval PMINFO_R_ERROR internal error
4117 * @pre pkgmgrinfo_appinfo_get_appinfo()
4118 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4119 * @see pkgmgrinfo_appinfo_get_appid()
4120 * @see pkgmgrinfo_appinfo_is_multiple()
4122 static int get_app_preload(const char *appid)
4126 pkgmgrinfo_appinfo_h handle = NULL;
4127 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4128 if (ret != PMINFO_R_OK)
4130 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4131 if (ret != PMINFO_R_OK) {
4132 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4135 printf("preload: %d\n", preload);
4136 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4141 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4144 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4145 * @brief This API gets the value for given application is submode or not from handle
4147 * @par This API is for package-manager client application
4148 * @par Sync (or) Async : Synchronous API
4150 * @param[in] handle pointer to application info handle
4151 * @param[out] submode pointer to hold submode is or not
4152 * @return 0 if success, error code(<0) if fail
4153 * @retval PMINFO_R_OK success
4154 * @retval PMINFO_R_EINVAL invalid argument
4155 * @retval PMINFO_R_ERROR internal error
4156 * @pre pkgmgrinfo_appinfo_get_appinfo()
4157 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4158 * @see pkgmgrinfo_appinfo_get_appid()
4159 * @see pkgmgrinfo_appinfo_is_multiple()
4161 static int get_app_submode(const char *appid)
4165 pkgmgrinfo_appinfo_h handle = NULL;
4166 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4167 if (ret != PMINFO_R_OK)
4169 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4170 if (ret != PMINFO_R_OK) {
4171 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4174 printf("submode: %d\n", submode);
4175 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4180 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4183 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4184 * @brief This API gets the value for given application is process_pool or not from handle
4186 * @par This API is for package-manager client application
4187 * @par Sync (or) Async : Synchronous API
4189 * @param[in] handle pointer to application info handle
4190 * @param[out] process_pool pointer to hold process_pool is or not
4191 * @return 0 if success, error code(<0) if fail
4192 * @retval PMINFO_R_OK success
4193 * @retval PMINFO_R_EINVAL invalid argument
4194 * @retval PMINFO_R_ERROR internal error
4195 * @pre pkgmgrinfo_appinfo_get_appinfo()
4196 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4197 * @see pkgmgrinfo_appinfo_get_appid()
4199 static int get_app_process_pool(const char *appid)
4202 bool process_pool = 0;
4203 pkgmgrinfo_appinfo_h handle = NULL;
4204 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4205 if (ret != PMINFO_R_OK)
4207 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4208 if (ret != PMINFO_R_OK) {
4209 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4212 printf("process_pool: %d\n", process_pool);
4213 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4218 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4221 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4222 * @brief This API gets the installed storage location of the application
4224 * @par This API is for package-manager client application
4225 * @par Sync (or) Async : Synchronous API
4227 * @param[in] handle pointer to the application info handle.
4228 * @param[out] app_type pointer to hold installed storage location
4229 * @return 0 if success, error code(<0) if fail
4230 * @retval PMINFO_R_OK success
4231 * @retval PMINFO_R_EINVAL invalid argument
4232 * @retval PMINFO_R_ERROR internal error
4233 * @pre pkgmgrinfo_appinfo_get_appinfo()
4234 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4235 * @see pkgmgrinfo_appinfo_get_appid()
4237 static int get_app_installed_location(const char *appid)
4240 pkgmgrinfo_installed_storage storage;
4241 pkgmgrinfo_appinfo_h handle = NULL;
4242 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4243 if (ret != PMINFO_R_OK)
4245 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4246 if (ret != PMINFO_R_OK) {
4247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4250 printf("Installed storage location : %d\n", storage);
4251 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4256 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4260 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4261 * @brief This API checks if the application has the given category
4263 * @par This API is for package-manager client application
4264 * @par Sync (or) Async : Synchronous API
4266 * @param[in] handle pointer to the application info handle
4267 * @param[in] category category
4268 * @param[out] exist value Gets whether the application has the given category
4269 * @return 0 if success, error code(<0) if fail
4270 * @retval PMINFO_R_OK success
4271 * @retval PMINFO_R_EINVAL invalid argument
4272 * @retval PMINFO_R_ERROR internal error
4274 static int is_category_exist(const char *appid, const char *category)
4277 pkgmgrinfo_appinfo_h handle;
4280 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4281 if (ret != PMINFO_R_OK)
4284 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4285 if (ret != PMINFO_R_OK) {
4286 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4290 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4295 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4298 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4299 * @brief This API gets the application 'ui_gadget' value from the app ID
4301 * @par This API is for package-manager client application
4302 * @par Sync (or) Async : Synchronous API
4304 * @param[in] handle pointer to application info handle
4305 * @param[out] ui_gadget pointer to hold package ui_gadget value
4306 * @return 0 if success, error code(<0) if fail
4307 * @retval PMINFO_R_OK success
4308 * @retval PMINFO_R_EINVAL invalid argument
4309 * @pre pkgmgrinfo_appinfo_get_appinfo()
4310 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4312 static int get_app_ui_gadget(const char *appid)
4316 pkgmgrinfo_appinfo_h handle = NULL;
4317 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4318 if (ret != PMINFO_R_OK)
4320 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4321 if (ret != PMINFO_R_OK) {
4322 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4325 printf("app ui_gadget: %d\n", ui_gadget);
4326 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4331 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4334 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4335 * @brief This API gets the application 'support_disable' value from the app ID
4337 * @par This API is for package-manager client application
4338 * @par Sync (or) Async : Synchronous API
4340 * @param[in] handle pointer to application info handle
4341 * @param[out] support_disable pointer to hold package support_disable value
4342 * @return 0 if success, error code(<0) if fail
4343 * @retval PMINFO_R_OK success
4344 * @retval PMINFO_R_EINVAL invalid argument
4345 * @pre pkgmgrinfo_appinfo_get_appinfo()
4346 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4348 static int get_app_support_disable(const char *appid)
4351 bool support_disable;
4352 pkgmgrinfo_appinfo_h handle = NULL;
4353 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4354 if (ret != PMINFO_R_OK)
4356 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4357 if (ret != PMINFO_R_OK) {
4358 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4361 printf("app support_disable: %d\n", support_disable);
4362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4367 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4370 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4371 * @brief This API gets the application 'is_disable' value from the app ID
4373 * @par This API is for package-manager client application
4374 * @par Sync (or) Async : Synchronous API
4376 * @param[in] handle pointer to application info handle
4377 * @param[out] disabled pointer to hold application is_disabled value
4378 * @return 0 if success, error code(<0) if fail
4379 * @retval PMINFO_R_OK success
4380 * @retval PMINFO_R_EINVAL invalid argument
4381 * @pre pkgmgrinfo_appinfo_get_appinfo()
4382 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4384 static int get_app_is_disable(const char *appid)
4388 pkgmgrinfo_appinfo_h handle = NULL;
4389 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4390 if (ret != PMINFO_R_OK)
4392 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4393 if (ret != PMINFO_R_OK) {
4394 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4397 printf("app is_disable: %d\n", is_disable);
4398 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4403 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4406 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4407 * @brief This API gets whethere the given application is global application or user application
4409 * @par This API is for package-manager client application
4410 * @par Sync (or) Async : Synchronous API
4412 * @param[in] handle pointer to application info handle
4413 * @param[in] global pointer to hold application global value
4414 * @return 0 if success, error code(<0) if fail
4415 * @retval PMINFO_R_OK success
4416 * @retval PMINFO_R_EINVAL invalid argument
4417 * @retval PMINFO_R_ERROR internal error
4418 * @pre pkgmgrinfo_appinfo_get_appinfo()
4419 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4420 * @see pkgmgrinfo_appinfo_get_appid()
4421 static int get_app_is_global(const char *appid)
4425 pkgmgrinfo_appinfo_h handle = NULL;
4426 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4427 if (ret != PMINFO_R_OK)
4429 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4430 if (ret != PMINFO_R_OK) {
4431 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4434 printf("app is_global: %d\n", global);
4435 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4440 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4443 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4444 * @brief This API gets the application 'splash_screen_display' value from the app ID
4446 * @par This API is for package-manager client application
4447 * @par Sync (or) Async : Synchronous API
4449 * @param[in] handle pointer to application info handle
4450 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4451 * @return 0 if success, error code(<0) if fail
4452 * @retval PMINFO_R_OK success
4453 * @retval PMINFO_R_EINVAL invalid argument
4454 * @retval PMINFO_R_ERROR internal error
4456 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4459 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4460 * @brief This API destroys the application information handle freeing up all the resources
4462 * @par This API is for package-manager client application
4463 * @par Sync (or) Async : Synchronous API
4465 * @param[in] handle pointer to the application info handle.
4466 * @return 0 if success, error code(<0) if fail
4467 * @retval PMINFO_R_OK success
4468 * @retval PMINFO_R_EINVAL invalid argument
4469 * @retval PMINFO_R_ERROR internal error
4470 * @pre pkgmgrinfo_appinfo_get_appinfo()
4472 * @see pkgmgrinfo_appinfo_get_pkgid()
4473 * @see pkgmgrinfo_appinfo_is_multiple()
4475 static int get_app_type(const char *appid)
4479 pkgmgrinfo_appinfo_h handle;
4480 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4481 if (ret != PMINFO_R_OK)
4483 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4484 if (ret != PMINFO_R_OK) {
4485 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4488 printf("apptype: %s\n", type);
4489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4494 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4497 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4498 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4499 The query will search the entire application information collected from the manifest file of all the installed packages
4501 * @par This API is for package-manager client application
4502 * @par Sync (or) Async : Synchronous API
4504 * @param[out] handle pointer to the application info filter handle.
4505 * @return 0 if success, error code(<0) if fail
4506 * @retval PMINFO_R_OK success
4507 * @retval PMINFO_R_EINVAL invalid argument
4508 * @retval PMINFO_R_ERROR internal error
4510 * @post pkgmgrinfo_appinfo_filter_destroy()
4511 * @see pkgmgrinfo_appinfo_filter_count()
4512 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4514 static int get_capp_count()
4518 pkgmgrinfo_appinfo_filter_h handle;
4519 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4520 if (ret != PMINFO_R_OK)
4522 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4523 if (ret != PMINFO_R_OK) {
4524 pkgmgrinfo_appinfo_filter_destroy(handle);
4527 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4528 if (ret != PMINFO_R_OK) {
4529 pkgmgrinfo_appinfo_filter_destroy(handle);
4532 printf("No of capp: %d\n", count);
4533 pkgmgrinfo_appinfo_filter_destroy(handle);
4538 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4541 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4542 * @brief This API destroys the application information filter handle freeing up all the resources
4544 * @par This API is for package-manager client application
4545 * @par Sync (or) Async : Synchronous API
4547 * @param[in] handle pointer to the application info filter handle.
4548 * @return 0 if success, error code(<0) if fail
4549 * @retval PMINFO_R_OK success
4550 * @retval PMINFO_R_EINVAL invalid argument
4551 * @retval PMINFO_R_ERROR internal error
4552 * @pre pkgmgrinfo_appinfo_filter_create()
4554 * @see pkgmgrinfo_appinfo_filter_count()
4555 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4557 static int get_capp_count()
4561 pkgmgrinfo_appinfo_filter_h handle;
4562 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4563 if (ret != PMINFO_R_OK)
4565 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4566 if (ret != PMINFO_R_OK) {
4567 pkgmgrinfo_appinfo_filter_destroy(handle);
4570 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4571 if (ret != PMINFO_R_OK) {
4572 pkgmgrinfo_appinfo_filter_destroy(handle);
4575 printf("No of capp: %d\n", count);
4576 pkgmgrinfo_appinfo_filter_destroy(handle);
4581 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4584 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4585 * @brief This API adds a boolean filter property to the filter handle
4587 * @par This API is for package-manager client application
4588 * @par Sync (or) Async : Synchronous API
4590 * @param[in] handle pointer to the application info filter handle.
4591 * @param[in] property boolean property name.
4592 * @param[in] value value corresponding to the property.
4593 * @return 0 if success, error code(<0) if fail
4594 * @retval PMINFO_R_OK success
4595 * @retval PMINFO_R_EINVAL invalid argument
4596 * @retval PMINFO_R_ERROR internal error
4597 * @pre pkgmgrinfo_appinfo_filter_create()
4598 * @post pkgmgrinfo_appinfo_filter_destroy()
4599 * @see pkgmgrinfo_appinfo_filter_count()
4600 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4602 static int get_taskmanageable_app_count()
4606 pkgmgrinfo_appinfo_filter_h handle;
4607 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4608 if (ret != PMINFO_R_OK)
4610 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4611 if (ret != PMINFO_R_OK) {
4612 pkgmgrinfo_appinfo_filter_destroy(handle);
4615 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4616 if (ret != PMINFO_R_OK) {
4617 pkgmgrinfo_appinfo_filter_destroy(handle);
4620 printf("No of taskmanageable apps: %d\n", count);
4621 pkgmgrinfo_appinfo_filter_destroy(handle);
4626 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4627 const char *property, const bool value);
4630 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4631 * @brief This API adds an integer filter property to the filter handle
4633 * @par This API is for package-manager client application
4634 * @par Sync (or) Async : Synchronous API
4636 * @param[in] handle pointer to the application info filter handle.
4637 * @param[in] property integer property name.
4638 * @param[in] value value corresponding to the property.
4639 * @return 0 if success, error code(<0) if fail
4640 * @retval PMINFO_R_OK success
4641 * @retval PMINFO_R_EINVAL invalid argument
4642 * @retval PMINFO_R_ERROR internal error
4643 * @pre pkgmgrinfo_appinfo_filter_create()
4644 * @post pkgmgrinfo_appinfo_filter_destroy()
4645 * @see pkgmgrinfo_appinfo_filter_count()
4646 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4648 static int get_taskmanageable_app_count()
4652 pkgmgrinfo_appinfo_filter_h handle;
4653 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4654 if (ret != PMINFO_R_OK)
4656 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4657 if (ret != PMINFO_R_OK) {
4658 pkgmgrinfo_appinfo_filter_destroy(handle);
4661 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4662 if (ret != PMINFO_R_OK) {
4663 pkgmgrinfo_appinfo_filter_destroy(handle);
4666 printf("No of apps: %d\n", count);
4667 pkgmgrinfo_appinfo_filter_destroy(handle);
4672 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4673 const char *property, const int value);
4676 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4677 * @brief This API adds a string filter property to the filter handle
4679 * @par This API is for package-manager client application
4680 * @par Sync (or) Async : Synchronous API
4682 * @param[in] handle pointer to the application info filter handle.
4683 * @param[in] property string property name.
4684 * @param[in] value value corresponding to the property.
4685 * @return 0 if success, error code(<0) if fail
4686 * @retval PMINFO_R_OK success
4687 * @retval PMINFO_R_EINVAL invalid argument
4688 * @retval PMINFO_R_ERROR internal error
4689 * @pre pkgmgrinfo_appinfo_filter_create()
4690 * @post pkgmgrinfo_appinfo_filter_destroy()
4691 * @see pkgmgrinfo_appinfo_filter_count()
4692 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4694 static int get_capp_count()
4698 pkgmgrinfo_appinfo_filter_h handle;
4699 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4700 if (ret != PMINFO_R_OK)
4702 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4703 if (ret != PMINFO_R_OK) {
4704 pkgmgrinfo_appinfo_filter_destroy(handle);
4707 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4708 if (ret != PMINFO_R_OK) {
4709 pkgmgrinfo_appinfo_filter_destroy(handle);
4712 printf("No of capp: %d\n", count);
4713 pkgmgrinfo_appinfo_filter_destroy(handle);
4718 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4719 const char *property, const char *value);
4722 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4723 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4725 * @par This API is for package-manager client application
4726 * @par Sync (or) Async : Synchronous API
4728 * @param[in] handle pointer to the application info filter handle.
4729 * @param[in] app_cb callback function.
4730 * @param[in] user_data user data to be passed to the callback function
4731 * @return 0 if success, error code(<0) if fail
4732 * @retval PMINFO_R_OK success
4733 * @retval PMINFO_R_EINVAL invalid argument
4734 * @retval PMINFO_R_ERROR internal error
4735 * @pre pkgmgrinfo_appinfo_filter_create()
4736 * @post pkgmgrinfo_appinfo_filter_destroy()
4737 * @see pkgmgrinfo_appinfo_filter_count()
4739 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4742 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4743 printf("appid : %s\n", appid);
4747 static int get_capp_list()
4750 pkgmgrinfo_appinfo_filter_h handle;
4751 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4752 if (ret != PMINFO_R_OK)
4754 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4755 if (ret != PMINFO_R_OK) {
4756 pkgmgrinfo_appinfo_filter_destroy(handle);
4759 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4760 if (ret != PMINFO_R_OK) {
4761 pkgmgrinfo_appinfo_filter_destroy(handle);
4764 pkgmgrinfo_appinfo_filter_destroy(handle);
4769 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4770 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4771 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4772 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4775 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4776 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4777 * @brief This API counts the application that satisfy the filter conditions
4779 * @par This API is for package-manager client application
4780 * @par Sync (or) Async : Synchronous API
4782 * @param[in] handle pointer to the application info filter handle.
4783 * @param[in] count pointer to store count value
4784 * @param[in] uid the addressee user id of the instruction
4785 * @return 0 if success, error code(<0) if fail
4786 * @retval PMINFO_R_OK success
4787 * @retval PMINFO_R_EINVAL invalid argument
4788 * @retval PMINFO_R_ERROR internal error
4789 * @pre pkgmgrinfo_appinfo_filter_create()
4790 * @post pkgmgrinfo_appinfo_filter_destroy()
4791 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4793 static int get_capp_count()
4797 pkgmgrinfo_appinfo_filter_h handle;
4798 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4799 if (ret != PMINFO_R_OK)
4801 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4802 if (ret != PMINFO_R_OK) {
4803 pkgmgrinfo_appinfo_filter_destroy(handle);
4806 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4807 if (ret != PMINFO_R_OK) {
4808 pkgmgrinfo_appinfo_filter_destroy(handle);
4811 printf("No of capp: %d\n", count);
4812 pkgmgrinfo_appinfo_filter_destroy(handle);
4817 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4818 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4820 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4821 * @brief This API creates the application's metadata information filter handle from db.
4823 * @par This API is for package-manager client application
4824 * @par Sync (or) Async : Synchronous API
4826 * @param[out] handle pointer to the application metadata info filter handle.
4827 * @return 0 if success, error code(<0) if fail
4828 * @retval PMINFO_R_OK success
4829 * @retval PMINFO_R_EINVAL invalid argument
4830 * @retval PMINFO_R_ERROR internal error
4832 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4833 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4835 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4838 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4839 printf("appid : %s\n", appid);
4843 static int get_app_list(const char *mkey, const char *mvalue)
4846 pkgmgrinfo_appinfo_metadata_filter_h handle;
4847 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4848 if (ret != PMINFO_R_OK)
4850 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4851 if (ret != PMINFO_R_OK) {
4852 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4855 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4856 if (ret != PMINFO_R_OK) {
4857 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4860 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4865 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4868 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4869 * @brief This API destroys the application's metadata information filter handle.
4871 * @par This API is for package-manager client application
4872 * @par Sync (or) Async : Synchronous API
4874 * @param[in] handle pointer to the application metadata info filter handle.
4875 * @return 0 if success, error code(<0) if fail
4876 * @retval PMINFO_R_OK success
4877 * @retval PMINFO_R_EINVAL invalid argument
4878 * @retval PMINFO_R_ERROR internal error
4879 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4881 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4883 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4886 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4887 printf("appid : %s\n", appid);
4891 static int get_app_list(const char *mkey, const char *mvalue)
4894 pkgmgrinfo_appinfo_metadata_filter_h handle;
4895 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4896 if (ret != PMINFO_R_OK)
4898 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4899 if (ret != PMINFO_R_OK) {
4900 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4903 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4904 if (ret != PMINFO_R_OK) {
4905 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4908 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4913 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4916 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4917 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4918 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4920 * @par This API is for package-manager client application
4921 * @par Sync (or) Async : Synchronous API
4923 * @param[in] handle pointer to the application metadata info filter handle.
4924 * @param[in] key pointer to metadata key
4925 * @param[in] value pointer to metadata value
4926 * @return 0 if success, error code(<0) if fail
4927 * @retval PMINFO_R_OK success
4928 * @retval PMINFO_R_EINVAL invalid argument
4929 * @retval PMINFO_R_ERROR internal error
4930 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4931 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4932 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4934 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4937 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4938 printf("appid : %s\n", appid);
4942 static int get_app_list(const char *mkey, const char *mvalue)
4945 pkgmgrinfo_appinfo_metadata_filter_h handle;
4946 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4947 if (ret != PMINFO_R_OK)
4949 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4950 if (ret != PMINFO_R_OK) {
4951 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4954 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4955 if (ret != PMINFO_R_OK) {
4956 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4959 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4964 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4965 const char *key, const char *value);
4968 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4969 * @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)
4970 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4971 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4972 * negative value, no more callbacks will be called and API will return.
4974 * @par This API is for package-manager client application
4975 * @par Sync (or) Async : Synchronous API
4977 * @param[in] handle pointer to the application metadata info filter handle.
4978 * @param[in] app_cb function pointer to callback
4979 * @param[in] user_data pointer to user data
4980 * @param[in] uid the addressee user id of the instruction
4981 * @return 0 if success, error code(<0) if fail
4982 * @retval PMINFO_R_OK success
4983 * @retval PMINFO_R_EINVAL invalid argument
4984 * @retval PMINFO_R_ERROR internal error
4985 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4986 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4988 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4991 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4992 printf("appid : %s\n", appid);
4996 static int get_app_list(const char *mkey, const char *mvalue)
4999 pkgmgrinfo_appinfo_metadata_filter_h handle;
5000 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5001 if (ret != PMINFO_R_OK)
5003 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5004 if (ret != PMINFO_R_OK) {
5005 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5008 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5009 if (ret != PMINFO_R_OK) {
5010 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5013 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5018 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5019 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5020 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5021 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5023 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5024 * @brief This API creates the package cert information handle to get data from db.
5026 * @par This API is for package-manager client application
5027 * @par Sync (or) Async : Synchronous API
5029 * @param[out] handle pointer to the package cert handle.
5030 * @return 0 if success, error code(<0) if fail
5031 * @retval PMINFO_R_OK success
5032 * @retval PMINFO_R_EINVAL invalid argument
5033 * @retval PMINFO_R_ERROR internal error
5035 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5036 * @see pkgmgrinfo_pkginfo_get_cert_value()
5037 * @see pkgmgrinfo_pkginfo_load_certinfo()
5039 static int get_cert_info(const char *pkgid)
5042 pkgmgrinfo_certinfo_h handle;
5043 char *auth_cert = NULL;
5044 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5045 if (ret != PMINFO_R_OK)
5047 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5048 if (ret != PMINFO_R_OK) {
5049 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5052 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5053 if (ret != PMINFO_R_OK) {
5054 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5057 printf("Author root certificate: %s\n", auth_root);
5058 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5063 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5066 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5067 * @brief This API loads the package cert information handle with data from db.
5069 * @par This API is for package-manager client application
5070 * @par Sync (or) Async : Synchronous API
5072 * @param[in] pkgid pointer to the package ID.
5073 * @param[in] handle pointer to the package cert handle.
5074 * @return 0 if success, error code(<0) if fail
5075 * @retval PMINFO_R_OK success
5076 * @retval PMINFO_R_EINVAL invalid argument
5077 * @retval PMINFO_R_ERROR internal error
5078 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5079 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5080 * @see pkgmgrinfo_pkginfo_get_cert_value()
5082 static int get_cert_info(const char *pkgid)
5085 pkgmgrinfo_certinfo_h handle;
5086 char *auth_cert = NULL;
5087 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5088 if (ret != PMINFO_R_OK)
5090 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5091 if (ret != PMINFO_R_OK) {
5092 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5095 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5096 if (ret != PMINFO_R_OK) {
5097 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5100 printf("Author root certificate: %s\n", auth_root);
5101 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5106 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5109 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5110 * @brief This API gets the package cert information from the handle
5112 * @par This API is for package-manager client application
5113 * @par Sync (or) Async : Synchronous API
5115 * @param[in] handle pointer to the package cert handle.
5116 * @param[in] cert_type certificate type
5117 * @param[out] cert_value pointer to hold certificate value
5118 * @return 0 if success, error code(<0) if fail
5119 * @retval PMINFO_R_OK success
5120 * @retval PMINFO_R_EINVAL invalid argument
5121 * @retval PMINFO_R_ERROR internal error
5122 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5123 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5124 * @see pkgmgrinfo_pkginfo_load_certinfo()
5126 static int get_cert_info(const char *pkgid)
5129 pkgmgrinfo_certinfo_h handle;
5130 char *auth_cert = NULL;
5131 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5132 if (ret != PMINFO_R_OK)
5134 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5135 if (ret != PMINFO_R_OK) {
5136 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5139 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5140 if (ret != PMINFO_R_OK) {
5141 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5144 printf("Author root certificate: %s\n", auth_root);
5145 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5150 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5153 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5154 * @brief This API destroys the package cert information handle freeing up all the resources
5156 * @par This API is for package-manager client application
5157 * @par Sync (or) Async : Synchronous API
5159 * @param[in] handle pointer to the package cert handle.
5160 * @return 0 if success, error code(<0) if fail
5161 * @retval PMINFO_R_OK success
5162 * @retval PMINFO_R_EINVAL invalid argument
5163 * @retval PMINFO_R_ERROR internal error
5164 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5166 * @see pkgmgrinfo_pkginfo_load_certinfo()
5168 static int get_cert_info(const char *pkgid)
5171 pkgmgrinfo_certinfo_h handle;
5172 char *auth_cert = NULL;
5173 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5174 if (ret != PMINFO_R_OK)
5176 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5177 if (ret != PMINFO_R_OK) {
5178 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5181 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5182 if (ret != PMINFO_R_OK) {
5183 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5186 printf("Author root certificate: %s\n", auth_root);
5187 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5192 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5195 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5196 * @brief This API deletes the package cert information from DB
5198 * @par This API is for package-manager client application
5199 * @par Sync (or) Async : Synchronous API
5201 * @param[in] pkgid pointer to the package ID.
5202 * @return 0 if success, error code(<0) if fail
5203 * @retval PMINFO_R_OK success
5204 * @retval PMINFO_R_EINVAL invalid argument
5205 * @retval PMINFO_R_ERROR internal error
5209 static int delete_cert_info(const char *pkgid)
5212 ret = pkgmgrinfo_delete_certinfo(pkgid);
5213 if (ret != PMINFO_R_OK)
5219 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5220 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5223 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5224 * @brief This API creates the package cert information handle to set data in db.
5226 * @par This API is for package-manager client application
5227 * @par Sync (or) Async : Synchronous API
5229 * @param[out] handle pointer to the package cert handle.
5230 * @return 0 if success, error code(<0) if fail
5231 * @retval PMINFO_R_OK success
5232 * @retval PMINFO_R_EINVAL invalid argument
5233 * @retval PMINFO_R_ERROR internal error
5235 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5236 * @see pkgmgrinfo_set_cert_value()
5237 * @see pkgmgrinfo_save_certinfo()
5239 static int set_cert_in_db(const char *pkgid)
5242 pkgmgrinfo_instcertinfo_h handle;
5243 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5244 if (ret != PMINFO_R_OK)
5246 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5247 if (ret != PMINFO_R_OK) {
5248 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5251 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5252 if (ret != PMINFO_R_OK) {
5253 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5256 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5261 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5264 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5265 * @brief This API sets the package cert information in the handle.
5267 * @par This API is for package-manager client application
5268 * @par Sync (or) Async : Synchronous API
5270 * @param[in] handle pointer to the package cert handle.
5271 * @param[in] cert_type certificate type.
5272 * @param[in] cert_value certificate value.
5273 * @return 0 if success, error code(<0) if fail
5274 * @retval PMINFO_R_OK success
5275 * @retval PMINFO_R_EINVAL invalid argument
5276 * @retval PMINFO_R_ERROR internal error
5277 * @pre pkgmgrinfo_create_certinfo_set_handle()
5278 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5279 * @see pkgmgrinfo_save_certinfo()
5281 static int set_cert_in_db(const char *pkgid)
5284 pkgmgrinfo_instcertinfo_h handle;
5285 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5286 if (ret != PMINFO_R_OK)
5288 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5289 if (ret != PMINFO_R_OK) {
5290 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5293 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5294 if (ret != PMINFO_R_OK) {
5295 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5298 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5303 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5306 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5307 * @brief This API saves the package cert information in the DB.
5309 * @par This API is for package-manager client application
5310 * @par Sync (or) Async : Synchronous API
5312 * @param[in] pkgid pointer to the package ID.
5313 * @param[in] handle pointer to the package cert handle.
5314 * @return 0 if success, error code(<0) if fail
5315 * @retval PMINFO_R_OK success
5316 * @retval PMINFO_R_EINVAL invalid argument
5317 * @retval PMINFO_R_ERROR internal error
5318 * @pre pkgmgrinfo_create_certinfo_set_handle()
5319 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5320 * @see pkgmgrinfo_save_certinfo()
5322 static int set_cert_in_db(const char *pkgid)
5325 pkgmgrinfo_instcertinfo_h handle;
5326 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5327 if (ret != PMINFO_R_OK)
5329 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5330 if (ret != PMINFO_R_OK) {
5331 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5334 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5335 if (ret != PMINFO_R_OK) {
5336 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5339 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5344 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5347 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5348 * @brief This API destroys the package cert information handle freeing up all the resources.
5350 * @par This API is for package-manager client application
5351 * @par Sync (or) Async : Synchronous API
5353 * @param[in] handle pointer to the package cert handle.
5354 * @return 0 if success, error code(<0) if fail
5355 * @retval PMINFO_R_OK success
5356 * @retval PMINFO_R_EINVAL invalid argument
5357 * @retval PMINFO_R_ERROR internal error
5358 * @pre pkgmgrinfo_create_certinfo_set_handle()
5360 * @see pkgmgrinfo_save_certinfo()
5362 static int set_cert_in_db(const char *pkgid)
5365 pkgmgrinfo_instcertinfo_h handle;
5366 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5367 if (ret != PMINFO_R_OK)
5369 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5370 if (ret != PMINFO_R_OK) {
5371 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5374 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5375 if (ret != PMINFO_R_OK) {
5376 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5379 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5384 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5387 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5388 * @brief This API gets the datacontrol info
5390 * @par This API is for package-manager client application
5391 * @par Sync (or) Async : Synchronous API
5393 * @param[in] providerid pointer to the providerid of dataconltrol.
5394 * @param[in] type pointer to the type of dataconltrol.
5395 * @param[out] appid pointer to hold appid, need to free after using
5396 * @param[out] access pointer to hold access, need to free after using
5397 * @return 0 if success, error code(<0) if fail
5398 * @retval PMINFO_R_OK success
5399 * @retval PMINFO_R_EINVAL invalid argument
5400 * @retval PMINFO_R_ERROR internal error
5403 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5406 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5407 * @brief This API gets the application 'guest mode visibility' value from the DB
5409 * @par This API is for package-manager client application
5410 * @par Sync (or) Async : Synchronous API
5412 * @param[in] handle pointer to application info handle
5413 * @param[out] status pointer to hold app guest mode visibility value
5414 * @return 0 if success, error code(<0) if fail
5415 * @retval PMINFO_R_OK success
5416 * @retval PMINFO_R_EINVAL invalid argument
5417 * @retval PMINFO_R_ERROR internal error
5418 * @pre pkgmgrinfo_appinfo_get_appinfo()
5419 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5420 * @see pkgmgrinfo_appinfo_get_appid()
5421 * @see pkgmgrinfo_appinfo_is_multiple()
5423 static int get_app_guestmode_visibility(const char *appid)
5427 pkgmgrinfo_appinfo_h handle;
5428 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5429 if (ret != PMINFO_R_OK)
5431 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5432 if (ret != PMINFO_R_OK) {
5433 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5436 printf("app guest mode visibility: %d\n", status);
5437 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5442 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5445 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5446 * @brief This API sets the package 'installed_storage' value in db
5448 * @par This API is for package-manager client application
5449 * @par Sync (or) Async : Synchronous API
5451 * @param[in] pkgid pointer to the package ID.
5452 * @param[in] location package install location
5453 * @return 0 if success, error code(<0) if fail
5454 * @retval PMINFO_R_OK success
5455 * @retval PMINFO_R_EINVAL invalid argument
5456 * @retval PMINFO_R_ERROR internal error
5458 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5462 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5463 if (ret != PMINFO_R_OK) {
5470 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5471 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5478 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5479 int flag, void *user_data, uid_t uid);
5480 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5481 int flag, void *user_data);
5482 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5483 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5485 int pkgmgrinfo_appinfo_get_installed_list_full(
5486 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5489 * @pkgmgrinfo client API end
5497 #endif /* __PKG_INFO_H__ */