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"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
115 /** Integer property for filtering based on package info*/
116 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
145 /** Integer property for filtering app support mode */
146 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
148 /** Boolean property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
171 /** will be updated*/
172 /** string property for filtering based on pkg info*/
173 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
175 /* For multiuser support */
176 const char *getIconPath(uid_t uid, bool readonly);
177 char *getUserPkgParserDBPath(void);
178 char *getUserPkgParserDBPathUID(uid_t uid);
179 char *getUserPkgCertDBPath(void);
180 char *getUserPkgCertDBPathUID(uid_t uid);
181 const char *getUserManifestPath(uid_t uid, bool readonly);
184 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
185 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
186 * @brief This API gets list of installed packages
188 * @par This API is for package-manager client application
189 * @par Sync (or) Async : Synchronous API
190 * @param[in] pkg_list_cb iteration function for list
191 * @param[in] user_data user data to be passed to callback function
192 * @param[in] uid the addressee user id of the instruction
193 * @return 0 if success, error code(<0) if fail
194 * @retval PMINFO_R_OK success
195 * @retval PMINFO_R_EINVAL invalid argument
196 * @retval PMINFO_R_ERROR internal error
200 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
204 pkgid1 = (char *)user_data;
205 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
206 if (strcmp(pkgid1, pkgid2) == 0) {
213 static int list_pkgs()
216 char *name = "helloworld";
217 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
218 if (ret != PMINFO_R_OK) {
225 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
226 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
229 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
230 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
231 * @brief This API gets list of disabled packages
233 * @par This API is for package-manager client application
234 * @par Sync (or) Async : Synchronous API
235 * @param[in] pkg_list_cb iteration function for list
236 * @param[in] user_data user data to be passed to callback function
237 * @param[in] uid the addressee user id of the instruction
238 * @return 0 if success, error code(<0) if fail
239 * @retval PMINFO_R_OK success
240 * @retval PMINFO_R_EINVAL invalid argument
241 * @retval PMINFO_R_ERROR internal error
245 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
246 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
249 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
250 * @brief This API creates the package information handle from db which is not disabled
252 * @par This API is for package-manager client application
253 * @par Sync (or) Async : Synchronous API
255 * @param[in] pkgid pointer to package ID
256 * @param[in] uid the addressee user id of the instruction
257 * @param[out] handle pointer to the package info handle.
258 * @return 0 if success, error code(<0) if fail
259 * @retval PMINFO_R_OK success
260 * @retval PMINFO_R_EINVAL invalid argument
261 * @retval PMINFO_R_ERROR internal error
263 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
264 * @see pkgmgrinfo_pkginfo_get_pkgid()
265 * @see pkgmgrinfo_pkginfo_is_removable()
267 static int get_pkg_type(const char *pkgid)
271 pkgmgrinfo_pkginfo_h handle;
272 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
273 if (ret != PMINFO_R_OK)
275 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
276 if (ret != PMINFO_R_OK) {
277 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
280 printf("pkgtype: %s\n", type);
281 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
286 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
287 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
290 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
291 * @brief This API creates the disabled package information handle from db
293 * @par This API is for package-manager client application
294 * @par Sync (or) Async : Synchronous API
296 * @param[in] pkgid pointer to package ID
297 * @param[in] uid the addressee user id of the instruction
298 * @param[out] handle pointer to the package info handle.
299 * @return 0 if success, error code(<0) if fail
300 * @retval PMINFO_R_OK success
301 * @retval PMINFO_R_EINVAL invalid argument
302 * @retval PMINFO_R_ERROR internal error
304 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
305 * @see pkgmgrinfo_pkginfo_get_pkginfo()
307 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
308 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
311 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
312 * @brief This API creates the package information handle from db regardless of its disable or storage status
314 * @par This API is for package-manager client application
315 * @par Sync (or) Async : Synchronous API
317 * @param[in] pkgid pointer to package ID
318 * @param[in] uid the addressee user id of the instruction
319 * @param[out] handle pointer to the package info handle.
320 * @return 0 if success, error code(<0) if fail
321 * @retval PMINFO_R_OK success
322 * @retval PMINFO_R_EINVAL invalid argument
323 * @retval PMINFO_R_ERROR internal error
325 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
326 * @see pkgmgrinfo_pkginfo_get_pkgid()
327 * @see pkgmgrinfo_pkginfo_is_removable()
329 static int get_pkg_type(const char *pkgid)
333 pkgmgrinfo_pkginfo_h handle;
334 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
335 if (ret != PMINFO_R_OK)
337 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
338 if (ret != PMINFO_R_OK) {
339 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
342 printf("pkgtype: %s\n", type);
343 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
348 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
349 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
352 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
353 * @brief This API gets the package name from the package ID
355 * @par This API is for package-manager client application
356 * @par Sync (or) Async : Synchronous API
358 * @param[in] handle pointer to package info handle
359 * @param[out] pkg_name pointer to hold package name
360 * @return 0 if success, error code(<0) if fail
361 * @retval PMINFO_R_OK success
362 * @retval PMINFO_R_EINVAL invalid argument
363 * @retval PMINFO_R_ERROR internal error
364 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
365 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
366 * @see pkgmgrinfo_pkginfo_get_type()
367 * @see pkgmgrinfo_pkginfo_is_removable()
369 static int get_pkg_name(const char *pkgid)
372 char *pkgname = NULL;
373 pkgmgrinfo_pkginfo_h handle;
374 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
375 if (ret != PMINFO_R_OK)
377 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
378 if (ret != PMINFO_R_OK) {
379 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
382 printf("pkgname: %s\n", pkgname);
383 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
388 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
391 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
392 * @brief This API gets the package id from the package ID
394 * @par This API is for package-manager client application
395 * @par Sync (or) Async : Synchronous API
397 * @param[in] handle pointer to package info handle
398 * @param[out] pkgid pointer to hold package id
399 * @return 0 if success, error code(<0) if fail
400 * @retval PMINFO_R_OK success
401 * @retval PMINFO_R_EINVAL invalid argument
402 * @retval PMINFO_R_ERROR internal error
403 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
404 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
405 * @see pkgmgrinfo_pkginfo_get_type()
406 * @see pkgmgrinfo_pkginfo_is_removable()
408 static int get_pkgid(const char *pkgid)
412 pkgmgrinfo_pkginfo_h handle;
413 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
414 if (ret != PMINFO_R_OK)
416 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
417 if (ret != PMINFO_R_OK) {
418 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
421 printf("pkg id: %s\n", pkg_id);
422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
427 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
430 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
431 * @brief This API gets the package type from the package ID
433 * @par This API is for package-manager client application
434 * @par Sync (or) Async : Synchronous API
436 * @param[in] handle pointer to package info handle
437 * @param[out] type pointer to hold package type
438 * @return 0 if success, error code(<0) if fail
439 * @retval PMINFO_R_OK success
440 * @retval PMINFO_R_EINVAL invalid argument
441 * @retval PMINFO_R_ERROR internal error
442 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
443 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
444 * @see pkgmgrinfo_pkginfo_get_pkgid()
445 * @see pkgmgrinfo_pkginfo_is_removable()
447 static int get_pkg_type(const char *pkgid)
451 pkgmgrinfo_pkginfo_h handle;
452 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
453 if (ret != PMINFO_R_OK)
455 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
456 if (ret != PMINFO_R_OK) {
457 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
460 printf("pkgtype: %s\n", type);
461 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
466 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
469 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
470 * @brief This API gets the package version from the package ID
472 * @par This API is for package-manager client application
473 * @par Sync (or) Async : Synchronous API
475 * @param[in] handle pointer to package info handle
476 * @param[out] version pointer to hold package version
477 * @return 0 if success, error code(<0) if fail
478 * @retval PMINFO_R_OK success
479 * @retval PMINFO_R_EINVAL invalid argument
480 * @retval PMINFO_R_ERROR internal error
481 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
482 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
483 * @see pkgmgrinfo_pkginfo_get_pkgid()
484 * @see pkgmgrinfo_pkginfo_is_removable()
486 static int get_pkg_version(const char *pkgid)
489 char *version = NULL;
490 pkgmgrinfo_pkginfo_h handle;
491 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
492 if (ret != PMINFO_R_OK)
494 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
495 if (ret != PMINFO_R_OK) {
496 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
499 printf("pkg version: %s\n", version);
500 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
505 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
508 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
509 * @brief This API gets the package api_version from the package ID
511 * @par This API is for package-manager client application
512 * @par Sync (or) Async : Synchronous API
514 * @param[in] handle pointer to package info handle
515 * @param[out] api_version pointer to hold package api_version
516 * @return 0 if success, error code(<0) if fail
517 * @retval PMINFO_R_OK success
518 * @retval PMINFO_R_EINVAL invalid argument
519 * @retval PMINFO_R_ERROR internal error
520 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
521 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
522 * @see pkgmgrinfo_pkginfo_get_pkgid()
523 * @see pkgmgrinfo_pkginfo_is_removable()
525 static int get_pkg_api_version(const char *pkgid)
528 char *api_version = NULL;
529 pkgmgrinfo_pkginfo_h handle = NULL;
530 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
531 if (ret != PMINFO_R_OK)
533 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
534 if (ret != PMINFO_R_OK) {
535 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
538 printf("pkg api_version: %s\n", api_version);
539 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
544 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
547 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
548 * @brief This API gets tep(tizen expansion package) file name associated with the package
550 * @par This API is for package-manager client application
551 * @par Sync (or) Async : Synchronous API
553 * @param[in] handle pointer to the pkginfo handle.
554 * @param[out] tep_name pointer to hold tep name
555 * @return 0 if success, error code(<0) if fail
556 * @retval PMINFO_R_OK success
557 * @retval PMINFO_R_EINVAL invalid argument
558 * @retval PMINFO_R_ERROR internal error
559 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
560 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
561 * @see pkgmgrinfo_pkginfo_get_pkgid()
563 static int get_tep_name(const char *pkgid)
566 char *tep_name = NULL;
567 pkgmgrinfo_pkginfo_h handle = NULL;
568 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
569 if (ret != PMINFO_R_OK)
571 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
572 if (ret != PMINFO_R_OK) {
573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
576 printf("TEP name is: %s\n", tep_name);
577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
582 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
585 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
586 * @brief This API gets package mount point path associated with the package
587 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
589 * @par This API is for package-manager client application
590 * @par Sync (or) Async : Synchronous API
592 * @param[in] handle pointer to the pkginfo handle.
593 * @param[out] zip_mount_file pointer to hold zip mount file
594 * @return 0 if success, error code(<0) if fail
595 * @retval PMINFO_R_OK success
596 * @retval PMINFO_R_EINVAL invalid argument
597 * @retval PMINFO_R_ERROR internal error
598 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
599 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
600 * @see pkgmgrinfo_pkginfo_get_pkgid()
602 static int get_zip_mount_file(const char *pkgid)
605 char *zip_mount_file = NULL;
606 pkgmgrinfo_pkginfo_h handle = NULL;
607 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
608 if (ret != PMINFO_R_OK)
610 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
611 if (ret != PMINFO_R_OK) {
612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
615 if (zip_mount_file != NULL)
616 printf("Zip mount path is: %s\n", zip_mount_file);
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
622 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
625 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
626 * @brief This API gets package external image path associated with the package
627 * if package is installed in external storage.
628 * Otherwise, the return value will be PMINFO_R_ENOENT.
630 * @par This API is for package-manager client application
631 * @par Sync (or) Async : Synchronous API
633 * @param[in] handle pointer to the pkginfo handle.
634 * @param[out] ext_image_path pointer to hold external image path
635 * @return 0 if success, error code(<0) if fail
636 * @retval PMINFO_R_OK success
637 * @retval PMINFO_R_EINVAL invalid argument
638 * @retval PMINFO_R_ERROR internal error
639 * @revall PMINFO_R_ENOENT no valid data
640 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
641 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
642 * @see pkgmgrinfo_pkginfo_get_pkgid()
644 static int get_external_image_path(const char *pkgid)
647 char *ext_image_path = NULL;
648 pkgmgrinfo_pkginfo_h handle = NULL;
649 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
650 if (ret != PMINFO_R_OK)
652 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
653 if (ret != PMINFO_R_OK) {
654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
657 printf("external image path is: %s\n", ext_image_path);
658 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
663 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
666 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
667 * @brief This API gets the package install location from the package ID
669 * @par This API is for package-manager client application
670 * @par Sync (or) Async : Synchronous API
672 * @param[in] handle pointer to package info handle
673 * @param[out] location pointer to hold package install location
674 * @return 0 if success, error code(<0) if fail
675 * @retval PMINFO_R_OK success
676 * @retval PMINFO_R_EINVAL invalid argument
677 * @retval PMINFO_R_ERROR internal error
678 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
679 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
680 * @see pkgmgrinfo_pkginfo_get_pkgid()
681 * @see pkgmgrinfo_pkginfo_is_removable()
683 static int get_pkg_install_location(const char *pkgid)
686 pkgmgrinfo_install_location location;
687 pkgmgrinfo_pkginfo_h handle;
688 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
689 if (ret != PMINFO_R_OK)
691 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
692 if (ret != PMINFO_R_OK) {
693 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
696 printf("pkg install location: %d\n", location);
697 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
702 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
705 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
706 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
707 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
708 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
710 * @par This API is for package-manager client application
711 * @par Sync (or) Async : Synchronous API
713 * @param[in] handle pointer to package info handle
714 * @param[out] size pointer to hold package size
715 * @return 0 if success, error code(<0) if fail
716 * @retval PMINFO_R_OK success
717 * @retval PMINFO_R_EINVAL invalid argument
718 * @retval PMINFO_R_ERROR internal error
719 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
720 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
721 * @see pkgmgrinfo_pkginfo_get_pkgid()
722 * @see pkgmgrinfo_pkginfo_is_removable()
724 static int get_pkg_size(const char *pkgid)
728 pkgmgrinfo_pkginfo_h handle;
729 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
730 if (ret != PMINFO_R_OK)
732 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
733 if (ret != PMINFO_R_OK) {
734 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
737 printf("pkgsize: %d\n", size);
738 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
743 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
746 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
747 * @brief This API gets the package icon from the package ID
749 * @par This API is for package-manager client application
750 * @par Sync (or) Async : Synchronous API
752 * @param[in] handle pointer to package info handle
753 * @param[out] icon pointer to hold package icon
754 * @return 0 if success, error code(<0) if fail
755 * @retval PMINFO_R_OK success
756 * @retval PMINFO_R_EINVAL invalid argument
757 * @retval PMINFO_R_ERROR internal error
758 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
759 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
760 * @see pkgmgrinfo_pkginfo_get_pkgid()
761 * @see pkgmgrinfo_pkginfo_is_removable()
763 static int get_pkg_icon(const char *pkgid)
767 pkgmgrinfo_pkginfo_h handle;
768 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
769 if (ret != PMINFO_R_OK)
771 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
772 if (ret != PMINFO_R_OK) {
773 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
776 printf("pkg icon: %s\n", icon);
777 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
782 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
785 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
786 * @brief This API gets the package label from the package ID
788 * @par This API is for package-manager client application
789 * @par Sync (or) Async : Synchronous API
791 * @param[in] handle pointer to package info handle
792 * @param[out] label pointer to hold package label
793 * @return 0 if success, error code(<0) if fail
794 * @retval PMINFO_R_OK success
795 * @retval PMINFO_R_EINVAL invalid argument
796 * @retval PMINFO_R_ERROR internal error
797 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
798 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
799 * @see pkgmgrinfo_pkginfo_get_pkgid()
800 * @see pkgmgrinfo_pkginfo_is_removable()
802 static int get_pkg_label(const char *pkgid)
806 pkgmgrinfo_pkginfo_h handle;
807 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
808 if (ret != PMINFO_R_OK)
810 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
811 if (ret != PMINFO_R_OK) {
812 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
815 printf("pkg label: %s\n", label);
816 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
821 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
824 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
825 * @brief This API gets the package description from the package ID
827 * @par This API is for package-manager client application
828 * @par Sync (or) Async : Synchronous API
830 * @param[in] handle pointer to package info handle
831 * @param[out] description pointer to hold package description
832 * @return 0 if success, error code(<0) if fail
833 * @retval PMINFO_R_OK success
834 * @retval PMINFO_R_EINVAL invalid argument
835 * @retval PMINFO_R_ERROR internal error
836 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
837 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
838 * @see pkgmgrinfo_pkginfo_get_pkgid()
839 * @see pkgmgrinfo_pkginfo_is_removable()
841 static int get_pkg_description(const char *pkgid)
844 char *description = NULL;
845 pkgmgrinfo_pkginfo_h handle;
846 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
847 if (ret != PMINFO_R_OK)
849 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
850 if (ret != PMINFO_R_OK) {
851 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
854 printf("pkg description: %s\n", description);
855 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
860 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
863 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
864 * @brief This API gets the package's author name from the package ID
866 * @par This API is for package-manager client application
867 * @par Sync (or) Async : Synchronous API
869 * @param[in] handle pointer to package info handle
870 * @param[out] author_name pointer to hold package author name
871 * @return 0 if success, error code(<0) if fail
872 * @retval PMINFO_R_OK success
873 * @retval PMINFO_R_EINVAL invalid argument
874 * @retval PMINFO_R_ERROR internal error
875 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
876 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
877 * @see pkgmgrinfo_pkginfo_get_pkgid()
878 * @see pkgmgrinfo_pkginfo_is_removable()
880 static int get_pkg_author_name(const char *pkgid)
883 char *author_name = NULL;
884 pkgmgrinfo_pkginfo_h handle;
885 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
886 if (ret != PMINFO_R_OK)
888 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
889 if (ret != PMINFO_R_OK) {
890 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
893 printf("pkg author name: %s\n", author_name);
894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
899 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
902 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
903 * @brief This API gets the package's author email from the package ID
905 * @par This API is for package-manager client application
906 * @par Sync (or) Async : Synchronous API
908 * @param[in] handle pointer to package info handle
909 * @param[out] author_email pointer to hold package author email
910 * @return 0 if success, error code(<0) if fail
911 * @retval PMINFO_R_OK success
912 * @retval PMINFO_R_EINVAL invalid argument
913 * @retval PMINFO_R_ERROR internal error
914 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
915 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
916 * @see pkgmgrinfo_pkginfo_get_pkgid()
917 * @see pkgmgrinfo_pkginfo_is_removable()
919 static int get_pkg_author_email(const char *pkgid)
922 char *author_email = NULL;
923 pkgmgrinfo_pkginfo_h handle;
924 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
925 if (ret != PMINFO_R_OK)
927 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
928 if (ret != PMINFO_R_OK) {
929 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
932 printf("pkg author email: %s\n", author_email);
933 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
938 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
941 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
942 * @brief This API gets the package's author href from the package ID
944 * @par This API is for package-manager client application
945 * @par Sync (or) Async : Synchronous API
947 * @param[in] handle pointer to package info handle
948 * @param[out] author_href pointer to hold package author href
949 * @return 0 if success, error code(<0) if fail
950 * @retval PMINFO_R_OK success
951 * @retval PMINFO_R_EINVAL invalid argument
952 * @retval PMINFO_R_ERROR internal error
953 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
954 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
955 * @see pkgmgrinfo_pkginfo_get_pkgid()
956 * @see pkgmgrinfo_pkginfo_is_removable()
958 static int get_pkg_author_href(const char *pkgid)
961 char *author_href = NULL;
962 pkgmgrinfo_pkginfo_h handle;
963 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
964 if (ret != PMINFO_R_OK)
966 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
967 if (ret != PMINFO_R_OK) {
968 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
971 printf("pkg author href: %s\n", author_href);
972 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
977 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
980 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
981 * @brief This API gets the package installed storagae value from the package ID
983 * @par This API is for package-manager client application
984 * @par Sync (or) Async : Synchronous API
986 * @param[in] handle pointer to package info handle
987 * @param[out] storage pointer to hold package installed storage
988 * @return 0 if success, error code(<0) if fail
989 * @retval PMINFO_R_OK success
990 * @retval PMINFO_R_EINVAL invalid argument
991 * @retval PMINFO_R_ERROR internal error
992 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
993 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
994 * @see pkgmgrinfo_pkginfo_get_pkgid()
995 * @see pkgmgrinfo_pkginfo_is_removable()
997 static int get_pkg_installed_storage(const char *pkgid)
1000 pkgmgrinfo_installed_storage storage;
1001 pkgmgrinfo_pkginfo_h handle;
1002 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1003 if (ret != PMINFO_R_OK)
1005 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1006 if (ret != PMINFO_R_OK) {
1007 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1010 printf("pkg installed storage: %d\n", storage);
1011 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1016 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1019 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1020 * @brief This API gets the installed time of package from the package ID
1022 * @par This API is for package-manager client application
1023 * @par Sync (or) Async : Synchronous API
1025 * @param[in] handle pointer to package info handle
1026 * @param[out] installed_time pointer to hold installed time of package
1027 * @return 0 if success, error code(<0) if fail
1028 * @retval PMINFO_R_OK success
1029 * @retval PMINFO_R_EINVAL invalid argument
1030 * @retval PMINFO_R_ERROR internal error
1031 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1032 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1033 * @see pkgmgrinfo_pkginfo_get_pkgid()
1034 * @see pkgmgrinfo_pkginfo_is_removable()
1036 static int get_pkg_installed_time(const char *pkgid)
1039 int installed_time = 0;
1040 pkgmgrinfo_pkginfo_h handle;
1041 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1042 if (ret != PMINFO_R_OK)
1044 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1045 if (ret != PMINFO_R_OK) {
1046 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1049 printf("installed_time: %d\n", installed_time);
1050 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1055 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1058 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1059 * @brief This API creates the update info handle
1061 * @par This API is for package-manager client application
1062 * @par Sync (or) Async : Synchronous API
1064 * @param[out] handle pointer to package update info handle
1065 * @return 0 if success, error code(<0) if fail
1066 * @retval PMINFO_R_OK success
1067 * @retval PMINFO_R_EINVAL invalid argument
1068 * @retval PMINFO_R_ERROR internal error
1069 * @post pkgmgrinfo_updateinfo_destroy()
1070 * @see pkgmgrinfo_updateinfo_set_pkgid()
1071 * @see pkgmgrinfo_updateinfo_set_version()
1072 * @see pkgmgrinfo_updateinfo_set_type()
1073 * @see pkgmgr_client_register_pkg_updateinfo()
1075 static int updateinfo_handle_create()
1079 pkgmgrinfo_updateinfo_h handle;
1080 ret = pkgmgrinfo_updateinfo_create(&handle);
1081 if (ret != PMINFO_R_OK)
1083 pkgmgrinfo_update_infodestroy(handle);
1088 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1091 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1092 * @brief This API destroy the update info handle
1094 * @par This API is for package-manager client application
1095 * @par Sync (or) Async : Synchronous API
1097 * @param[in] handle pointer to package update info handle
1098 * @return 0 if success, error code(<0) if fail
1099 * @retval PMINFO_R_OK success
1100 * @retval PMINFO_R_EINVAL invalid argument
1101 * @pre pkgmgrinfo_updateinfo_create()
1102 * @see pkgmgr_client_register_pkg_updateinfo()
1104 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1108 ret = pkgmgrinfo_updateinfo_destroy(handle);
1109 if (ret != PMINFO_R_OK)
1115 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1118 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1119 * @brief This API creates the package update information handle from db
1121 * @par This API is for package-manager client application
1122 * @par Sync (or) Async : Synchronous API
1124 * @param[in] pkgid pointer to package ID
1125 * @param[in] uid the addressee user id of the instruction
1126 * @param[out] update_handle pointer to the package update info handle.
1127 * @return 0 if success, error code(<0) if fail
1128 * @retval PMINFO_R_OK success
1129 * @retval PMINFO_R_EINVAL invalid argument
1130 * @retval PMINFO_R_ERROR internal error
1132 * @post pkgmgrinfo_updateinfo_destroy()
1133 * @see pkgmgrinfo_updateinfo_get_pkgid()
1134 * @see pkgmgrinfo_updateinfo_get_version()
1135 * @see pkgmgrinfo_updateinfo_get_update_type()
1137 static int get_pkg_update_info(const char *pkgid)
1141 pkgmgrinfo_updateinfo_h handle;
1142 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1143 if (ret != PMINFO_R_OK)
1145 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1146 if (ret != PMINFO_R_OK) {
1147 pkgmgrinfo_updateinfo_destroy(handle);
1150 printf("pkg update version: %s\n", version
1151 pkgmgrinfo_updateinfo_destroy(handle);
1156 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1157 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1160 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1161 * @brief This API sets given pkgid into handle
1163 * @par This API is for package-manager client application
1164 * @par Sync (or) Async : Synchronous API
1166 * @param[in] handle pointer to package update info handle
1167 * @param[in] pkgid package id
1168 * @return 0 if success, error code(<0) if fail
1169 * @retval PMINFO_R_OK success
1170 * @retval PMINFO_R_EINVAL invalid argument
1171 * @retval PMINFO_R_ERROR internal error
1173 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1177 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1178 if (ret != PMINFO_R_OK)
1184 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1187 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1188 * @brief This API sets given version into handle
1190 * @par This API is for package-manager client application
1191 * @par Sync (or) Async : Synchronous API
1193 * @param[in] handle pointer to package update info handle
1194 * @param[in] version update version
1195 * @return 0 if success, error code(<0) if fail
1196 * @retval PMINFO_R_OK success
1197 * @retval PMINFO_R_EINVAL invalid argument
1198 * @retval PMINFO_R_ERROR internal error
1200 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1204 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1205 if (ret != PMINFO_R_OK)
1211 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1214 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1215 * @brief This API sets given update type into handle
1217 * @par This API is for package-manager client application
1218 * @par Sync (or) Async : Synchronous API
1220 * @param[in] handle pointer to package update info handle
1221 * @param[in] type update type
1222 * @return 0 if success, error code(<0) if fail
1223 * @retval PMINFO_R_OK success
1224 * @retval PMINFO_R_EINVAL invalid argument
1225 * @retval PMINFO_R_ERROR internal error
1227 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1231 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1232 if (ret != PMINFO_R_OK)
1238 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1241 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1242 * @brief This API retrieves the pkgid from given update info
1244 * @par This API is for package-manager client application
1245 * @par Sync (or) Async : Synchronous API
1247 * @param[in] handle pointer to package update info handle
1248 * @param[out] pkgid package id
1249 * @return 0 if success, error code(<0) if fail
1250 * @retval PMINFO_R_OK success
1251 * @retval PMINFO_R_EINVAL invalid argument
1252 * @retval PMINFO_R_ERROR internal error
1254 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1259 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1260 if (ret != PMINFO_R_OK)
1266 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1269 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1270 * @brief This API retrieves the version from given update info
1272 * @par This API is for package-manager client application
1273 * @par Sync (or) Async : Synchronous API
1275 * @param[in] handle pointer to package update info handle
1276 * @param[out] version update version
1277 * @return 0 if success, error code(<0) if fail
1278 * @retval PMINFO_R_OK success
1279 * @retval PMINFO_R_EINVAL invalid argument
1280 * @retval PMINFO_R_ERROR internal error
1282 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1287 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1288 if (ret != PMINFO_R_OK)
1294 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1297 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1298 * @brief This API retrieves the update type from given update info
1300 * @par This API is for package-manager client application
1301 * @par Sync (or) Async : Synchronous API
1303 * @param[in] handle pointer to package update info handle
1304 * @param[out] type update type
1305 * @return 0 if success, error code(<0) if fail
1306 * @retval PMINFO_R_OK success
1307 * @retval PMINFO_R_EINVAL invalid argument
1308 * @retval PMINFO_R_ERROR internal error
1310 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1313 pkgmgrinfo_updateinfo_update_type *type;
1315 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1316 if (ret != PMINFO_R_OK)
1322 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1326 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1327 * @brief This API retrieve the update informations and invoke given callback for it.
1329 * @par This API is for package-manager client application
1330 * @par Sync (or) Async : Synchronous API
1332 * @param[in] callback callback to be invoked for each retrieved informations
1333 * @param[in] user_data user data to be passed to callback
1334 * @return 0 if success, error code(<0) if fail
1335 * @retval PMINFO_R_OK success
1336 * @retval PMINFO_R_EINVAL invalid argument
1337 * @retval PMINFO_R_ERROR internal error
1339 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1343 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1344 if (ret != PMINFO_R_OK)
1350 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1351 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1354 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1355 * @brief This API gets the launch mode of package from the package ID
1357 * @par This API is for package-manager client application
1358 * @par Sync (or) Async : Synchronous API
1360 * @param[in] handle pointer to package info handle
1361 * @param[out] mode pointer to hold launch mode of package
1362 * @return 0 if success, error code(<0) if fail
1363 * @retval PMINFO_R_OK success
1364 * @retval PMINFO_R_EINVAL invalid argument
1365 * @retval PMINFO_R_ERROR internal error
1366 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1367 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1368 * @see pkgmgrinfo_pkginfo_get_pkgid()
1369 * @see pkgmgrinfo_pkginfo_is_removable()
1371 static int get_pkg_launch_mode(const char *pkgid)
1374 char *launch_mode = NULL;
1375 pkgmgrinfo_pkginfo_h handle;
1376 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1377 if (ret != PMINFO_R_OK)
1379 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1380 if (ret != PMINFO_R_OK) {
1381 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1384 printf("launch mode: %s\n", mode);
1385 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1390 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1393 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1394 * @brief This API gets the store client id of package from the package ID
1396 * @par This API is for package-manager client application
1397 * @par Sync (or) Async : Synchronous API
1399 * @param[in] handle pointer to package info handle
1400 * @param[out] storeclientid pointer to hold store client id of package
1401 * @return 0 if success, error code(<0) if fail
1402 * @retval PMINFO_R_OK success
1403 * @retval PMINFO_R_EINVAL invalid argument
1404 * @retval PMINFO_R_ERROR internal error
1405 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1406 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1407 * @see pkgmgrinfo_pkginfo_get_pkgid()
1408 * @see pkgmgrinfo_pkginfo_is_removable()
1410 static int get_pkg_storeclientid(const char *pkgid)
1413 char *storeclientid = 0;
1414 pkgmgrinfo_pkginfo_h handle;
1415 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1416 if (ret != PMINFO_R_OK)
1418 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1419 if (ret != PMINFO_R_OK) {
1420 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1423 printf(store client id: %s\n", storeclientid);
1424 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1429 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1432 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1433 * @brief This API gets the main app id of package from the package ID
1435 * @par This API is for package-manager client application
1436 * @par Sync (or) Async : Synchronous API
1438 * @param[in] handle pointer to package info handle
1439 * @param[out] mainappid pointer to hold main app id of package
1440 * @return 0 if success, error code(<0) if fail
1441 * @retval PMINFO_R_OK success
1442 * @retval PMINFO_R_EINVAL invalid argument
1443 * @retval PMINFO_R_ERROR internal error
1444 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1445 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1446 * @see pkgmgrinfo_pkginfo_get_pkgid()
1447 * @see pkgmgrinfo_pkginfo_is_removable()
1449 static int get_pkg_mainappid(const char *pkgid)
1452 char *mainappid = 0;
1453 pkgmgrinfo_pkginfo_h handle;
1454 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1455 if (ret != PMINFO_R_OK)
1457 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1458 if (ret != PMINFO_R_OK) {
1459 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1462 printf(main app id: %s\n", mainappid);
1463 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1468 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1471 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1472 * @brief This API gets the url of package from the package ID
1474 * @par This API is for package-manager client application
1475 * @par Sync (or) Async : Synchronous API
1477 * @param[in] handle pointer to package info handle
1478 * @param[out] url pointer to hold url of package
1479 * @return 0 if success, error code(<0) if fail
1480 * @retval PMINFO_R_OK success
1481 * @retval PMINFO_R_EINVAL invalid argument
1482 * @retval PMINFO_R_ERROR internal error
1483 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1484 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1485 * @see pkgmgrinfo_pkginfo_get_pkgid()
1486 * @see pkgmgrinfo_pkginfo_is_removable()
1488 static int get_pkg_url(const char *pkgid)
1492 pkgmgrinfo_pkginfo_h handle;
1493 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1494 if (ret != PMINFO_R_OK)
1496 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1497 if (ret != PMINFO_R_OK) {
1498 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1501 printf("url : %s\n", url);
1502 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1507 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1510 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1511 * @brief This API gets the root path of package
1513 * @par Sync (or) Async : Synchronous API
1515 * @param[in] handle pointer to package info handle
1516 * @param[out] path pointer to hold root path of package
1517 * @return 0 if success, error code(<0) if fail
1518 * @retval PMINFO_R_OK success
1519 * @retval PMINFO_R_EINVAL invalid argument
1520 * @retval PMINFO_R_ERROR internal error
1522 static int get_root_path(const char *pkgid)
1526 pkgmgrinfo_pkginfo_h handle;
1527 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1528 if (ret != PMINFO_R_OK)
1531 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1532 if (ret != PMINFO_R_OK) {
1533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1536 printf("path : %s\n", path);
1537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1543 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1547 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1548 * @brief This API gets the csc path of package
1550 * @par Sync (or) Async : Synchronous API
1552 * @param[in] handle pointer to package info handle
1553 * @param[out] path pointer to hold csc path of package
1554 * @return 0 if success, error code(<0) if fail
1555 * @retval PMINFO_R_OK success
1556 * @retval PMINFO_R_EINVAL invalid argument
1557 * @retval PMINFO_R_ERROR internal error
1559 static int get_csc_path(const char *pkgid)
1563 pkgmgrinfo_pkginfo_h handle;
1564 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1565 if (ret != PMINFO_R_OK)
1568 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1569 if (ret != PMINFO_R_OK) {
1570 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1573 printf("path : %s\n", path);
1574 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1580 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1583 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1584 * @brief This API gets the support_mode of package
1586 * @par Sync (or) Async : Synchronous API
1588 * @param[in] handle pointer to package info handle
1589 * @param[out] support_mode pointer to hold support_mode of package
1590 * @return 0 if success, error code(<0) if fail
1591 * @retval PMINFO_R_OK success
1592 * @retval PMINFO_R_EINVAL invalid argument
1593 * @retval PMINFO_R_ERROR internal error
1595 static int get_support_mode(const char *pkgid)
1598 int support_mode = 0;
1599 pkgmgrinfo_pkginfo_h handle = NULL;
1600 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1601 if (ret != PMINFO_R_OK)
1604 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1605 if (ret != PMINFO_R_OK) {
1606 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1609 printf("support_mode : %s\n", support_mode);
1610 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1616 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1619 * @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)
1620 * @brief This API compare the cert information from given package id
1622 * @par This API is for package-manager client application
1623 * @par Sync (or) Async : Synchronous API
1625 * @param[in] lhs_package_id pointer to first package ID
1626 * @param[in] rhs_package_id pointer to second package ID
1627 * @param[out] compare_result pointer to the compare result.
1628 * @return 0 if success, error code(<0) if fail
1629 * @retval PMINFO_R_OK success
1630 * @retval PMINFO_R_EINVAL invalid argument
1631 * @retval PMINFO_R_ERROR internal error
1633 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1634 * @see pkgmgrinfo_pkginfo_get_pkgid()
1635 * @see pkgmgrinfo_pkginfo_is_removable()
1637 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1640 pkgmgrinfo_cert_compare_result_type_e result;
1642 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1643 if (ret != PMINFO_R_OK) {
1646 printf("result: %d\n", result);
1651 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);
1652 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);
1654 * @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)
1655 * @brief This API compare the cert information from given app id
1657 * @par This API is for package-manager client application
1658 * @par Sync (or) Async : Synchronous API
1660 * @param[in] lhs_app_id pointer to first app ID
1661 * @param[in] rhs_app_id pointer to second app ID
1662 * @param[out] compare_result pointer to the compare result.
1663 * @return 0 if success, error code(<0) if fail
1664 * @retval PMINFO_R_OK success
1665 * @retval PMINFO_R_EINVAL invalid argument
1666 * @retval PMINFO_R_ERROR internal error
1668 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1669 * @see pkgmgrinfo_pkginfo_get_pkgid()
1670 * @see pkgmgrinfo_pkginfo_is_removable()
1672 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1675 pkgmgrinfo_cert_compare_result_type_e result;
1677 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1678 if (ret != PMINFO_R_OK) {
1681 printf("result: %d\n", result);
1686 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);
1687 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);
1689 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1690 * @brief This API gets the package 'removable' value from the package ID
1692 * @par This API is for package-manager client application
1693 * @par Sync (or) Async : Synchronous API
1695 * @param[in] handle pointer to package info handle
1696 * @param[out] removable pointer to hold package removable value
1697 * @return 0 if success, error code(<0) if fail
1698 * @retval PMINFO_R_OK success
1699 * @retval PMINFO_R_EINVAL invalid argument
1700 * @retval PMINFO_R_ERROR internal error
1701 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1702 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1703 * @see pkgmgrinfo_pkginfo_get_pkgid()
1704 * @see pkgmgrinfo_pkginfo_is_readonly()
1706 static int get_pkg_removable(const char *pkgid)
1710 pkgmgrinfo_pkginfo_h handle;
1711 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1712 if (ret != PMINFO_R_OK)
1714 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1715 if (ret != PMINFO_R_OK) {
1716 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1719 printf("pkg removable: %d\n", removable);
1720 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1725 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1728 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1729 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1731 * @par This API is for package-manager client application
1732 * @par Sync (or) Async : Synchronous API
1734 * @param[in] handle pointer to package info handle
1735 * @param[out] movable pointer to hold package movable state
1736 * @return 0 if success, error code(<0) if fail
1737 * @retval PMINFO_R_OK success
1738 * @retval PMINFO_R_EINVAL invalid argument
1739 * @retval PMINFO_R_ERROR internal error
1740 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1741 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1742 * @see pkgmgrinfo_pkginfo_get_pkgid()
1744 static int get_pkg_movable(const char *pkgid)
1748 pkgmgrinfo_pkginfo_h handle;
1749 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1750 if (ret != PMINFO_R_OK)
1752 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1753 if (ret != PMINFO_R_OK) {
1754 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1757 printf("pkg movable: %d\n", movable);
1758 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1763 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1766 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1767 * @brief This API gets the package 'preload' value from the package ID
1769 * @par This API is for package-manager client application
1770 * @par Sync (or) Async : Synchronous API
1772 * @param[in] handle pointer to package info handle
1773 * @param[out] preload pointer to hold package preload value
1774 * @return 0 if success, error code(<0) if fail
1775 * @retval PMINFO_R_OK success
1776 * @retval PMINFO_R_EINVAL invalid argument
1777 * @retval PMINFO_R_ERROR internal error
1778 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1779 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1780 * @see pkgmgrinfo_pkginfo_get_pkgid()
1781 * @see pkgmgrinfo_pkginfo_is_readonly()
1783 static int get_pkg_preload(const char *pkgid)
1787 pkgmgrinfo_pkginfo_h handle;
1788 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1789 if (ret != PMINFO_R_OK)
1791 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1792 if (ret != PMINFO_R_OK) {
1793 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1796 printf("pkg preload: %d\n", preload);
1797 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1802 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1805 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1806 * @brief This API gets the value for given handle is system or not
1808 * @par This API is for package-manager client application
1809 * @par Sync (or) Async : Synchronous API
1811 * @param[in] handle pointer to package info handle
1812 * @param[out] system pointer to hold system is or not
1813 * @return 0 if success, error code(<0) if fail
1814 * @retval PMINFO_R_OK success
1815 * @retval PMINFO_R_EINVAL invalid argument
1816 * @retval PMINFO_R_ERROR internal error
1817 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1818 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1819 * @see pkgmgrinfo_pkginfo_get_pkgid()
1820 * @see pkgmgrinfo_pkginfo_is_readonly()
1822 static int get_pkg_system(const char *pkgid)
1825 bool system = false;
1826 pkgmgrinfo_pkginfo_h handle = NULL;
1827 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1828 if (ret != PMINFO_R_OK)
1830 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1831 if (ret != PMINFO_R_OK) {
1832 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1835 printf("pkg system: %d\n", system);
1836 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1841 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1844 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1845 * @brief This API gets the package 'readonly' value from the package ID
1847 * @par This API is for package-manager client application
1848 * @par Sync (or) Async : Synchronous API
1850 * @param[in] handle pointer to package info handle
1851 * @param[out] readonly pointer to hold package readonly value
1852 * @return 0 if success, error code(<0) if fail
1853 * @retval PMINFO_R_OK success
1854 * @retval PMINFO_R_EINVAL invalid argument
1855 * @retval PMINFO_R_ERROR internal error
1856 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1857 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1858 * @see pkgmgrinfo_pkginfo_get_pkgid()
1859 * @see pkgmgrinfo_pkginfo_is_removable()
1861 static int get_pkg_readonly(const char *pkgid)
1865 pkgmgrinfo_pkginfo_h handle;
1866 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1867 if (ret != PMINFO_R_OK)
1869 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1870 if (ret != PMINFO_R_OK) {
1871 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1874 printf("pkg readonly: %d\n", readonly);
1875 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1880 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1884 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1885 * @brief This API gets the package 'upate' value from the package ID
1887 * @par This API is for package-manager client application
1888 * @par Sync (or) Async : Synchronous API
1890 * @param[in] handle pointer to package info handle
1891 * @param[out] update pointer to hold package update value
1892 * @return 0 if success, error code(<0) if fail
1893 * @retval PMINFO_R_OK success
1894 * @retval PMINFO_R_EINVAL invalid argument
1895 * @retval PMINFO_R_ERROR internal error
1896 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1897 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1898 * @see pkgmgrinfo_pkginfo_get_pkgid()
1900 static int get_pkg_update(const char *pkgid)
1904 pkgmgrinfo_pkginfo_h handle;
1905 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1906 if (ret != PMINFO_R_OK)
1908 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1909 if (ret != PMINFO_R_OK) {
1910 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1913 printf("pkg update: %d\n", update);
1914 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1919 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1922 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1923 * @brief This API gets the package 'support_disable' value from the package ID
1925 * @par This API is for package-manager client application
1926 * @par Sync (or) Async : Synchronous API
1928 * @param[in] handle pointer to package info handle
1929 * @param[out] support_disable pointer to hold package support_disable value
1930 * @return 0 if success, error code(<0) if fail
1931 * @retval PMINFO_R_OK success
1932 * @retval PMINFO_R_EINVAL invalid argument
1933 * @retval PMINFO_R_ERROR internal error
1934 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1935 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1936 * @see pkgmgrinfo_pkginfo_get_pkgid()
1938 static int get_pkg_support_disable(const char *pkgid)
1941 bool support_disable;
1942 pkgmgrinfo_pkginfo_h handle = NULL;
1943 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1944 if (ret != PMINFO_R_OK)
1946 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1947 if (ret != PMINFO_R_OK) {
1948 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1951 printf("pkg support_disable: %d\n", support_disable);
1952 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1957 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1960 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1961 * @brief This API gets whethere the given package is global package or user package
1963 * @par This API is for package-manager client application
1964 * @par Sync (or) Async : Synchronous API
1966 * @param[in] handle pointer to package info handle
1967 * @param[in] global pointer to hold package global value
1968 * @return 0 if success, error code(<0) if fail
1969 * @retval PMINFO_R_OK success
1970 * @retval PMINFO_R_EINVAL invalid argument
1971 * @retval PMINFO_R_ERROR internal error
1972 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1973 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1974 * @see pkgmgrinfo_pkginfo_get_pkgid()
1975 static int get_pkg_support_disable(const char *pkgid)
1979 pkgmgrinfo_pkginfo_h handle = NULL;
1980 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1981 if (ret != PMINFO_R_OK)
1983 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1984 if (ret != PMINFO_R_OK) {
1985 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1988 printf("pkg is_global: %d\n", global);
1989 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1994 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1997 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1998 * @brief This API gets the package 'accessible' value from the package ID
2000 * @par This API is for package-manager client application
2001 * @par Sync (or) Async : Synchronous API
2003 * @param[in] handle pointer to package info handle
2004 * @param[out] accessible pointer to hold package accessible value
2005 * @return 0 if success, error code(<0) if fail
2006 * @retval PMINFO_R_OK success
2007 * @retval PMINFO_R_EINVAL invalid argument
2008 * @retval PMINFO_R_ERROR internal error
2009 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2010 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2011 * @see pkgmgrinfo_pkginfo_get_pkgid()
2012 * @see pkgmgrinfo_pkginfo_is_readonly()
2014 static int get_pkg_accessible(const char *pkgid)
2018 pkgmgrinfo_pkginfo_h handle;
2019 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2020 if (ret != PMINFO_R_OK)
2022 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2023 if (ret != PMINFO_R_OK) {
2024 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2027 printf("pkg accessible: %d\n", accessible);
2028 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2033 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2036 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2037 * @brief This API destroys the package information handle freeing up all the resources
2039 * @par This API is for package-manager client application
2040 * @par Sync (or) Async : Synchronous API
2042 * @param[in] handle pointer to the package info handle
2043 * @return 0 if success, error code(<0) if fail
2044 * @retval PMINFO_R_OK success
2045 * @retval PMINFO_R_EINVAL invalid argument
2046 * @retval PMINFO_R_ERROR internal error
2047 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2049 * @see pkgmgrinfo_pkginfo_get_pkgid()
2050 * @see pkgmgrinfo_pkginfo_is_removable()
2052 static int get_pkg_type(const char *pkgid)
2056 pkgmgrinfo_pkginfo_h handle;
2057 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2058 if (ret != PMINFO_R_OK)
2060 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2061 if (ret != PMINFO_R_OK) {
2062 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2065 printf("pkgtype: %s\n", type);
2066 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2071 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2074 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2075 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2076 The query will search the entire package information collected from the manifest file of all the installed packages
2078 * @par This API is for package-manager client application
2079 * @par Sync (or) Async : Synchronous API
2081 * @param[out] handle pointer to the package info filter handle.
2082 * @return 0 if success, error code(<0) if fail
2083 * @retval PMINFO_R_OK success
2084 * @retval PMINFO_R_EINVAL invalid argument
2085 * @retval PMINFO_R_ERROR internal error
2087 * @post pkgmgrinfo_pkginfo_filter_destroy()
2088 * @see pkgmgrinfo_pkginfo_filter_count()
2089 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2091 static int get_tpk_pkg_count()
2095 pkgmgrinfo_pkginfo_filter_h handle;
2096 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2097 if (ret != PMINFO_R_OK)
2099 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2100 if (ret != PMINFO_R_OK) {
2101 pkgmgrinfo_pkginfo_filter_destroy(handle);
2104 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2105 if (ret != PMINFO_R_OK) {
2106 pkgmgrinfo_pkginfo_filter_destroy(handle);
2109 printf("No of tpk pkgs: %d\n", count);
2110 pkgmgrinfo_pkginfo_filter_destroy(handle);
2115 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2118 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2119 * @brief This API destroys the package information filter handle freeing up all the resources
2121 * @par This API is for package-manager client application
2122 * @par Sync (or) Async : Synchronous API
2124 * @param[in] handle pointer to the package info filter handle.
2125 * @return 0 if success, error code(<0) if fail
2126 * @retval PMINFO_R_OK success
2127 * @retval PMINFO_R_EINVAL invalid argument
2128 * @retval PMINFO_R_ERROR internal error
2129 * @pre pkgmgrinfo_pkginfo_filter_create()
2131 * @see pkgmgrinfo_pkginfo_filter_count()
2132 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2134 static int get_tpk_pkg_count()
2138 pkgmgrinfo_pkginfo_filter_h handle;
2139 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2140 if (ret != PMINFO_R_OK)
2142 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2143 if (ret != PMINFO_R_OK) {
2144 pkgmgrinfo_pkginfo_filter_destroy(handle);
2147 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2148 if (ret != PMINFO_R_OK) {
2149 pkgmgrinfo_pkginfo_filter_destroy(handle);
2152 printf("No of tpk pkgs: %d\n", count);
2153 pkgmgrinfo_pkginfo_filter_destroy(handle);
2158 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2161 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2162 * @brief This API adds a boolean filter property to the filter handle
2164 * @par This API is for package-manager client application
2165 * @par Sync (or) Async : Synchronous API
2167 * @param[in] handle pointer to the package info filter handle.
2168 * @param[in] property boolean property name.
2169 * @param[in] value value corresponding to the property.
2170 * @return 0 if success, error code(<0) if fail
2171 * @retval PMINFO_R_OK success
2172 * @retval PMINFO_R_EINVAL invalid argument
2173 * @retval PMINFO_R_ERROR internal error
2174 * @pre pkgmgrinfo_pkginfo_filter_create()
2175 * @post pkgmgrinfo_pkginfo_filter_destroy()
2176 * @see pkgmgrinfo_pkginfo_filter_count()
2177 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2179 static int get_preload_pkg_count()
2183 pkgmgrinfo_pkginfo_filter_h handle;
2184 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2185 if (ret != PMINFO_R_OK)
2187 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2188 if (ret != PMINFO_R_OK) {
2189 pkgmgrinfo_pkginfo_filter_destroy(handle);
2192 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2193 if (ret != PMINFO_R_OK) {
2194 pkgmgrinfo_pkginfo_filter_destroy(handle);
2197 printf("No of preload pkgs: %d\n", count);
2198 pkgmgrinfo_pkginfo_filter_destroy(handle);
2203 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2204 const char *property, const bool value);
2207 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2208 * @brief This API adds an integer filter property to the filter handle
2210 * @par This API is for package-manager client application
2211 * @par Sync (or) Async : Synchronous API
2213 * @param[in] handle pointer to the package info filter handle.
2214 * @param[in] property integer property name.
2215 * @param[in] value value corresponding to the property.
2216 * @return 0 if success, error code(<0) if fail
2217 * @retval PMINFO_R_OK success
2218 * @retval PMINFO_R_EINVAL invalid argument
2219 * @retval PMINFO_R_ERROR internal error
2220 * @pre pkgmgrinfo_pkginfo_filter_create()
2221 * @post pkgmgrinfo_pkginfo_filter_destroy()
2222 * @see pkgmgrinfo_pkginfo_filter_count()
2223 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2225 static int get_pkg_count()
2229 pkgmgrinfo_pkginfo_filter_h handle;
2230 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2231 if (ret != PMINFO_R_OK)
2233 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2234 if (ret != PMINFO_R_OK) {
2235 pkgmgrinfo_pkginfo_filter_destroy(handle);
2238 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2239 if (ret != PMINFO_R_OK) {
2240 pkgmgrinfo_pkginfo_filter_destroy(handle);
2243 printf("No of preload pkgs: %d\n", count);
2244 pkgmgrinfo_pkginfo_filter_destroy(handle);
2249 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2250 const char *property, const int value);
2253 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2254 * @brief This API adds a string filter property to the filter handle
2256 * @par This API is for package-manager client application
2257 * @par Sync (or) Async : Synchronous API
2259 * @param[in] handle pointer to the package info filter handle.
2260 * @param[in] property string property name.
2261 * @param[in] value value corresponding to the property.
2262 * @return 0 if success, error code(<0) if fail
2263 * @retval PMINFO_R_OK success
2264 * @retval PMINFO_R_EINVAL invalid argument
2265 * @retval PMINFO_R_ERROR internal error
2266 * @pre pkgmgrinfo_pkginfo_filter_create()
2267 * @post pkgmgrinfo_pkginfo_filter_destroy()
2268 * @see pkgmgrinfo_pkginfo_filter_count()
2269 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2271 static int get_tpk_pkg_count()
2275 pkgmgrinfo_pkginfo_filter_h handle;
2276 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2277 if (ret != PMINFO_R_OK)
2279 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2280 if (ret != PMINFO_R_OK) {
2281 pkgmgrinfo_pkginfo_filter_destroy(handle);
2284 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2285 if (ret != PMINFO_R_OK) {
2286 pkgmgrinfo_pkginfo_filter_destroy(handle);
2289 printf("No of tpk pkgs: %d\n", count);
2290 pkgmgrinfo_pkginfo_filter_destroy(handle);
2295 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2296 const char *property, const char *value);
2299 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2300 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2302 * @par This API is for package-manager client application
2303 * @par Sync (or) Async : Synchronous API
2305 * @param[in] handle pointer to the package info filter handle.
2306 * @param[in] pkg_cb callback function.
2307 * @param[in] user_data user data to be passed to the callback function
2308 * @return 0 if success, error code(<0) if fail
2309 * @retval PMINFO_R_OK success
2310 * @retval PMINFO_R_EINVAL invalid argument
2311 * @retval PMINFO_R_ERROR internal error
2312 * @pre pkgmgrinfo_pkginfo_filter_create()
2313 * @post pkgmgrinfo_pkginfo_filter_destroy()
2314 * @see pkgmgrinfo_pkginfo_filter_count()
2316 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2319 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2320 printf("pkg id : %s\n", pkgid);
2324 static int get_tpk_pkg_list()
2327 pkgmgrinfo_pkginfo_filter_h handle;
2328 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2329 if (ret != PMINFO_R_OK)
2331 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2332 if (ret != PMINFO_R_OK) {
2333 pkgmgrinfo_pkginfo_filter_destroy(handle);
2336 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2337 if (ret != PMINFO_R_OK) {
2338 pkgmgrinfo_pkginfo_filter_destroy(handle);
2341 pkgmgrinfo_pkginfo_filter_destroy(handle);
2346 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2347 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2348 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2349 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2352 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2353 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2354 * @brief This API counts the package that satisfy the filter conditions
2356 * @par This API is for package-manager client application
2357 * @par Sync (or) Async : Synchronous API
2359 * @param[in] handle pointer to the package info filter handle.
2360 * @param[in] count pointer to store the count value.
2361 * @param[in] uid the addressee user id of the instruction
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_pkginfo_filter_create()
2367 * @post pkgmgrinfo_pkginfo_filter_destroy()
2368 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2370 static int get_tpk_pkg_count()
2374 pkgmgrinfo_pkginfo_filter_h handle;
2375 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2376 if (ret != PMINFO_R_OK)
2378 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2379 if (ret != PMINFO_R_OK) {
2380 pkgmgrinfo_pkginfo_filter_destroy(handle);
2383 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2384 if (ret != PMINFO_R_OK) {
2385 pkgmgrinfo_pkginfo_filter_destroy(handle);
2388 printf("No of tpk pkgs: %d\n", count);
2389 pkgmgrinfo_pkginfo_filter_destroy(handle);
2394 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2395 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2398 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2399 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2400 * @brief This API gets the list of privilege for a particular package
2402 * @par This API is for package-manager client application
2403 * @par Sync (or) Async : Synchronous API
2404 * @param[in] handle pointer to the package info handle.
2405 * @param[in] privilege_func callback function for list
2406 * @param[in] user_data user data to be passed to callback function
2407 * @return 0 if success, error code(<0) if fail
2408 * @retval PMINFO_R_OK success
2409 * @retval PMINFO_R_EINVAL invalid argument
2410 * @retval PMINFO_R_ERROR internal error
2411 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2412 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2414 int privilege_func(const char *name, void *user_data)
2416 if (strcmp(name, (char *)user_data) == 0)
2422 static int list_privilege(const char *package, char *privilege)
2425 pkgmgrinfo_pkginfo_h handle;
2426 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2427 if (ret != PMINFO_R_OK)
2429 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2430 if (ret != PMINFO_R_OK) {
2431 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2434 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2439 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2440 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2443 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2444 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2445 * @brief This API gets the list of appdefined privilege for a particular package
2447 * @par This API is for package-manager client application
2448 * @par Sync (or) Async : Synchronous API
2449 * @param[in] handle pointer to the package info handle.
2450 * @param[in] privilege_func callback function for list
2451 * @param[in] user_data user data to be passed to callback function
2452 * @return 0 if success, error code(<0) if fail
2453 * @retval PMINFO_R_OK success
2454 * @retval PMINFO_R_EINVAL invalid argument
2455 * @retval PMINFO_R_ERROR internal error
2456 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2457 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2459 int privilege_func(const char *name, const char *license_path, void *user_data)
2461 printf("appdefined privilege : %s", name);
2463 printf("licensed privilege, lecense path : %s", license_path);
2467 static int list_appdefined_privilege(const char *package)
2470 pkgmgrinfo_pkginfo_h handle;
2471 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2472 if (ret != PMINFO_R_OK)
2474 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2475 if (ret != PMINFO_R_OK) {
2476 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2479 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2484 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2485 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2487 /* TODO: add doxygen comment here */
2488 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2491 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2492 * @brief This API copy the application information handle
2494 * @par This API is for package-manager client application
2495 * @par Sync (or) Async : Synchronous API
2497 * @param[in] handle pointer to the package info handle.
2498 * @param[out] handle pointer to the package info handle.
2499 * @return 0 if success, error code(<0) if fail
2500 * @retval PMINFO_R_OK success
2501 * @retval PMINFO_R_EINVAL invalid argument
2502 * @retval PMINFO_R_ERROR internal error
2504 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2506 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2510 pkgmgrinfo_pkginfo_h clone;
2512 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2513 if (ret != PMINFO_R_OK)
2517 printf("package: %s\n", clone->package);
2518 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2523 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2527 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2528 pkgmgrinfo_app_list_cb app_func, void *user_data)
2529 * @brief This API gets list of installed applications for a particular package
2531 * @par This API is for package-manager client application
2532 * @par Sync (or) Async : Synchronous API
2533 * @param[in] handle package info handle
2534 * @param[in] component application component
2535 * @param[in] app_func iteration function for list
2536 * @param[in] user_data user data to be passed to callback function
2537 * @return 0 if success, error code(<0) if fail
2538 * @retval PMINFO_R_OK success
2539 * @retval PMINFO_R_EINVAL invalid argument
2540 * @retval PMINFO_R_ERROR internal error
2541 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2542 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2544 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2547 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2548 printf("appid : %s\n", appid);
2552 static int list_apps(const char *pkgid)
2555 pkgmgrinfo_pkginfo_h handle;
2556 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2557 if (ret != PMINFO_R_OK)
2559 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2560 if (ret != PMINFO_R_OK) {
2561 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2564 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2569 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2570 pkgmgrinfo_app_list_cb app_func, void *user_data);
2571 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2572 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2575 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2576 * @brief This API gets list of installed applications from all packages with minimum informaion.
2578 * @par This API is for package-manager client application
2579 * @par Sync (or) Async : Synchronous API
2580 * @param[in] app_func iteration function for list
2581 * @param[in] user_data user data to be passed to callback function
2582 * @return 0 if success, error code(<0) if fail
2583 * @retval PMINFO_R_OK success
2584 * @retval PMINFO_R_EINVAL invalid argument
2585 * @retval PMINFO_R_ERROR internal error
2589 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2591 char *pkgid1 = NULL;
2592 char *pkgid2 = NULL;
2593 pkgid1 = (char *)user_data;
2594 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2595 if (strcmp(pkgid1, pkgid2) == 0) {
2602 static int list_apps()
2605 char *name = "helloworld";
2606 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2607 if (ret != PMINFO_R_OK) {
2614 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2615 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2618 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2619 * @brief This API gets list of installed applications from all packages.
2621 * @par This API is for package-manager client application
2622 * @par Sync (or) Async : Synchronous API
2623 * @param[in] app_func iteration function for list
2624 * @param[in] user_data user data to be passed to callback function
2625 * @return 0 if success, error code(<0) if fail
2626 * @retval PMINFO_R_OK success
2627 * @retval PMINFO_R_EINVAL invalid argument
2628 * @retval PMINFO_R_ERROR internal error
2632 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2634 char *pkgid1 = NULL;
2635 char *pkgid2 = NULL;
2636 pkgid1 = (char *)user_data;
2637 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2638 if (strcmp(pkgid1, pkgid2) == 0) {
2645 static int list_apps()
2648 char *name = "helloworld";
2649 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2650 if (ret != PMINFO_R_OK) {
2657 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2658 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2661 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2662 * @brief This API creates the disabled application information handle from db
2664 * @par This API is for package-manager client application
2665 * @par Sync (or) Async : Synchronous API
2667 * @param[in] appid pointer to appid
2668 * @param[out] handle pointer to the application info handle.
2669 * @return 0 if success, error code(<0) if fail
2670 * @retval PMINFO_R_OK success
2671 * @retval PMINFO_R_EINVAL invalid argument
2672 * @retval PMINFO_R_ERROR internal error
2674 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2675 * @see pkgmgrinfo_appinfo_get_pkgid()
2676 * @see pkgmgrinfo_appinfo_is_multiple()
2678 static int get_disabled_app_type(const char *appid)
2682 pkgmgrinfo_appinfo_h handle;
2683 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2684 if (ret != PMINFO_R_OK)
2686 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2687 if (ret != PMINFO_R_OK) {
2688 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2691 printf("apptype: %s\n", type);
2692 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2697 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2698 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2701 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2702 * @brief This API creates the application information handle from db
2704 * @par This API is for package-manager client application
2705 * @par Sync (or) Async : Synchronous API
2707 * @param[in] appid pointer to appid
2708 * @param[out] handle pointer to the application info handle.
2709 * @return 0 if success, error code(<0) if fail
2710 * @retval PMINFO_R_OK success
2711 * @retval PMINFO_R_EINVAL invalid argument
2712 * @retval PMINFO_R_ERROR internal error
2714 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2715 * @see pkgmgrinfo_appinfo_get_pkgid()
2716 * @see pkgmgrinfo_appinfo_is_multiple()
2718 static int get_app_type(const char *appid)
2722 pkgmgrinfo_appinfo_h handle;
2723 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2724 if (ret != PMINFO_R_OK)
2726 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2727 if (ret != PMINFO_R_OK) {
2728 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2731 printf("apptype: %s\n", type);
2732 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2737 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2738 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2741 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2742 * @brief This API creates the application information handle from db regardless of its disable or storage status
2744 * @par This API is for package-manager client application
2745 * @par Sync (or) Async : Synchronous API
2747 * @param[in] appid pointer to appid
2748 * @param[out] handle pointer to the application info handle.
2749 * @return 0 if success, error code(<0) if fail
2750 * @retval PMINFO_R_OK success
2751 * @retval PMINFO_R_EINVAL invalid argument
2752 * @retval PMINFO_R_ERROR internal error
2754 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2755 * @see pkgmgrinfo_appinfo_get_pkgid()
2756 * @see pkgmgrinfo_appinfo_is_multiple()
2758 static int get_app_type(const char *appid)
2762 pkgmgrinfo_appinfo_h handle;
2763 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2764 if (ret != PMINFO_R_OK)
2766 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2767 if (ret != PMINFO_R_OK) {
2768 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2771 printf("apptype: %s\n", type);
2772 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2777 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2778 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2781 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2782 * @brief This API gets the application ID
2784 * @par This API is for package-manager client application
2785 * @par Sync (or) Async : Synchronous API
2787 * @param[in] handle pointer to the application info handle.
2788 * @param[out] appid pointer to hold appid
2789 * @return 0 if success, error code(<0) if fail
2790 * @retval PMINFO_R_OK success
2791 * @retval PMINFO_R_EINVAL invalid argument
2792 * @retval PMINFO_R_ERROR internal error
2793 * @pre pkgmgrinfo_appinfo_get_appinfo()
2794 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2795 * @see pkgmgrinfo_appinfo_get_pkgid()
2796 * @see pkgmgrinfo_appinfo_is_multiple()
2798 static int get_app_id(const char *appid)
2801 char *app_id = NULL;
2802 pkgmgrinfo_appinfo_h handle;
2803 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2804 if (ret != PMINFO_R_OK)
2806 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2807 if (ret != PMINFO_R_OK) {
2808 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2811 printf("app id: %s\n", app_id);
2812 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2817 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2820 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2821 * @brief This API gets the package name of the application
2823 * @par This API is for package-manager client application
2824 * @par Sync (or) Async : Synchronous API
2826 * @param[in] handle pointer to the application info handle.
2827 * @param[out] pkg_name pointer to hold package name
2828 * @return 0 if success, error code(<0) if fail
2829 * @retval PMINFO_R_OK success
2830 * @retval PMINFO_R_EINVAL invalid argument
2831 * @retval PMINFO_R_ERROR internal error
2832 * @pre pkgmgrinfo_appinfo_get_appinfo()
2833 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2834 * @see pkgmgrinfo_appinfo_get_appid()
2835 * @see pkgmgrinfo_appinfo_is_multiple()
2837 static int get_app_pkgname(const char *appid)
2840 char *pkgname = NULL;
2841 pkgmgrinfo_appinfo_h handle;
2842 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2843 if (ret != PMINFO_R_OK)
2845 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2846 if (ret != PMINFO_R_OK) {
2847 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2850 printf("pkg name: %s\n", pkgname);
2851 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2856 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2859 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2860 * @brief This API gets the package id of the application
2862 * @par This API is for package-manager client application
2863 * @par Sync (or) Async : Synchronous API
2865 * @param[in] handle pointer to the application info handle.
2866 * @param[out] pkgid pointer to hold package id
2867 * @return 0 if success, error code(<0) if fail
2868 * @retval PMINFO_R_OK success
2869 * @retval PMINFO_R_EINVAL invalid argument
2870 * @retval PMINFO_R_ERROR internal error
2871 * @pre pkgmgrinfo_appinfo_get_appinfo()
2872 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2873 * @see pkgmgrinfo_appinfo_get_appid()
2874 * @see pkgmgrinfo_appinfo_is_multiple()
2876 static int get_app_pkgid(const char *appid)
2880 pkgmgrinfo_appinfo_h handle;
2881 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2882 if (ret != PMINFO_R_OK)
2884 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2885 if (ret != PMINFO_R_OK) {
2886 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2889 printf("pkg id: %s\n", pkgid);
2890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2895 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2898 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2899 * @brief This API gets the package type of the application
2901 * @par This API is for package-manager client application
2902 * @par Sync (or) Async : Synchronous API
2904 * @param[in] handle pointer to the application info handle.
2905 * @param[out] pkgtype pointer to hold package type
2906 * @return 0 if success, error code(<0) if fail
2907 * @retval PMINFO_R_OK success
2908 * @retval PMINFO_R_EINVAL invalid argument
2909 * @retval PMINFO_R_ERROR internal error
2910 * @pre pkgmgrinfo_appinfo_get_appinfo()
2911 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2912 * @see pkgmgrinfo_appinfo_get_appid()
2913 * @see pkgmgrinfo_appinfo_is_multiple()
2915 static int get_app_pkgtype(const char *appid)
2918 char *pkgtype = NULL;
2919 pkgmgrinfo_appinfo_h handle = NULL;
2920 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2921 if (ret != PMINFO_R_OK)
2923 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2924 if (ret != PMINFO_R_OK) {
2925 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2928 printf("pkgtype: %s\n", pkgtype);
2929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2934 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2937 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2938 * @brief This API gets the executable name of the application
2940 * @par This API is for package-manager client application
2941 * @par Sync (or) Async : Synchronous API
2943 * @param[in] handle pointer to the application info handle.
2944 * @param[out] exec pointer to hold app exec name
2945 * @return 0 if success, error code(<0) if fail
2946 * @retval PMINFO_R_OK success
2947 * @retval PMINFO_R_EINVAL invalid argument
2948 * @retval PMINFO_R_ERROR internal error
2949 * @pre pkgmgrinfo_appinfo_get_appinfo()
2950 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2951 * @see pkgmgrinfo_appinfo_get_appid()
2952 * @see pkgmgrinfo_appinfo_is_multiple()
2954 static int get_app_exec(const char *appid)
2958 pkgmgrinfo_appinfo_h handle;
2959 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2960 if (ret != PMINFO_R_OK)
2962 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2963 if (ret != PMINFO_R_OK) {
2964 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2967 printf("exec name: %s\n", exec);
2968 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2973 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2976 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2977 * @brief This API gets the icon name of the application
2979 * @par This API is for package-manager client application
2980 * @par Sync (or) Async : Synchronous API
2982 * @param[in] handle pointer to the application info handle.
2983 * @param[out] icon pointer to hold app icon name
2984 * @return 0 if success, error code(<0) if fail
2985 * @retval PMINFO_R_OK success
2986 * @retval PMINFO_R_EINVAL invalid argument
2987 * @retval PMINFO_R_ERROR internal error
2988 * @pre pkgmgrinfo_appinfo_get_appinfo()
2989 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2990 * @see pkgmgrinfo_appinfo_get_appid()
2991 * @see pkgmgrinfo_appinfo_is_multiple()
2993 static int get_app_icon(const char *appid)
2997 pkgmgrinfo_appinfo_h handle;
2998 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2999 if (ret != PMINFO_R_OK)
3001 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3002 if (ret != PMINFO_R_OK) {
3003 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3006 printf("icon name: %s\n", icon);
3007 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3012 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3015 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3016 * @brief This API gets the label of the application
3018 * @par This API is for package-manager client application
3019 * @par Sync (or) Async : Synchronous API
3021 * @param[in] handle pointer to the application info handle.
3022 * @param[out] label pointer to hold app label
3023 * @return 0 if success, error code(<0) if fail
3024 * @retval PMINFO_R_OK success
3025 * @retval PMINFO_R_EINVAL invalid argument
3026 * @retval PMINFO_R_ERROR internal error
3027 * @pre pkgmgrinfo_appinfo_get_appinfo()
3028 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3029 * @see pkgmgrinfo_appinfo_get_appid()
3030 * @see pkgmgrinfo_appinfo_is_multiple()
3032 static int get_app_label(const char *appid)
3036 pkgmgrinfo_appinfo_h handle;
3037 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3038 if (ret != PMINFO_R_OK)
3040 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3041 if (ret != PMINFO_R_OK) {
3042 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3045 printf("label : %s\n", label);
3046 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3051 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3054 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3055 * @brief This API gets exactly matched label by given appid and locale
3057 * @par This API is for package-manager client application
3058 * @par Sync (or) Async : Synchronous API
3060 * @param[in] appid pointer to appid
3061 * @param[in] locale pointer to locale
3062 * @param[out] label pointer to hold app label
3063 * @return 0 if success, error code(<0) if fail
3064 * @retval PMINFO_R_OK success
3065 * @retval PMINFO_R_EINVAL invalid argument
3066 * @retval PMINFO_R_ERROR internal error
3068 static int get_localed_label(const char *appid, const char *locale)
3073 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3074 if (ret != PMINFO_R_OK)
3077 printf("localed label: %s\n", label);
3085 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3086 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3089 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3090 * @brief This API gets metadata value by given metadata key
3092 * @par This API is for package-manager client application
3093 * @par Sync (or) Async : Synchronous API
3095 * @param[in] handle pointer to the application info handle
3096 * @param[in] metadata_key metadata key
3097 * @param[out] metadata_value pointer to hold metadata value
3098 * @return 0 if success, error code(<0) if fail
3099 * @retval PMINFO_R_OK success
3100 * @retval PMINFO_R_EINVAL invalid argument
3102 static int get_metadata_value(const char *appid, const char *metadata_key)
3105 pkgmgrinfo_appinfo_h handle = NULL;
3106 char *metadata_value = NULL;
3108 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3109 if (ret != PMINFO_R_OK)
3112 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3113 if (ret != PMINFO_R_OK) {
3114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3118 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3123 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3126 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3127 * @brief This API gets the component of the application
3129 * @par This API is for package-manager client application
3130 * @par Sync (or) Async : Synchronous API
3132 * @param[in] handle pointer to the application info handle.
3133 * @param[out] component pointer to hold app component
3134 * @return 0 if success, error code(<0) if fail
3135 * @retval PMINFO_R_OK success
3136 * @retval PMINFO_R_EINVAL invalid argument
3137 * @retval PMINFO_R_ERROR internal error
3138 * @pre pkgmgrinfo_appinfo_get_appinfo()
3139 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3140 * @see pkgmgrinfo_appinfo_get_appid()
3141 * @see pkgmgrinfo_appinfo_is_multiple()
3143 static int get_app_component(const char *appid)
3146 pkgmgrinfo_app_component component;
3147 pkgmgrinfo_appinfo_h handle;
3148 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3149 if (ret != PMINFO_R_OK)
3151 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3152 if (ret != PMINFO_R_OK) {
3153 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3156 printf("component : %s\n", component);
3157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3162 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3165 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3166 * @brief This API gets the apptype of the application
3168 * @par This API is for package-manager client application
3169 * @par Sync (or) Async : Synchronous API
3171 * @param[in] handle pointer to the application info handle.
3172 * @param[out] app_type pointer to hold apptype
3173 * @return 0 if success, error code(<0) if fail
3174 * @retval PMINFO_R_OK success
3175 * @retval PMINFO_R_EINVAL invalid argument
3176 * @retval PMINFO_R_ERROR internal error
3177 * @pre pkgmgrinfo_appinfo_get_appinfo()
3178 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3179 * @see pkgmgrinfo_appinfo_get_appid()
3180 * @see pkgmgrinfo_appinfo_is_multiple()
3182 static int get_app_type(const char *appid)
3185 char *apptype = NULL;
3186 pkgmgrinfo_appinfo_h handle;
3187 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3188 if (ret != PMINFO_R_OK)
3190 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3191 if (ret != PMINFO_R_OK) {
3192 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3195 printf("apptype : %s\n", apptype);
3196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3201 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3204 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3205 int *operation_count, char ***operation)
3206 * @brief This API gets the list of operation of the application
3208 * @par This API is for package-manager client application
3209 * @par Sync (or) Async : Synchronous API
3211 * @param[in] handle pointer to the appcontrol handle.
3212 * @param[out] operation_count pointer to hold number of operations
3213 * @param[out] operation pointer to hold list of operations
3214 * @return 0 if success, error code(<0) if fail
3215 * @retval PMINFO_R_OK success
3216 * @retval PMINFO_R_EINVAL invalid argument
3217 * @retval PMINFO_R_ERROR internal error
3218 * @pre pkgmgrinfo_appinfo_get_appinfo()
3219 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3220 * @see pkgmgrinfo_appinfo_get_uri()
3221 * @see pkgmgrinfo_appinfo_get_mime()
3223 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3228 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3229 for (i = 0; i < oc; i++) {
3230 if (strcmp(operation[i], (char *)user_data) == 0)
3237 static int check_operation(const char *appid, char *operation)
3240 pkgmgrinfo_appinfo_h handle;
3241 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3242 if (ret != PMINFO_R_OK)
3244 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3245 if (ret != PMINFO_R_OK) {
3246 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3249 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3254 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3255 int *operation_count, char ***operation);
3258 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3259 int *uri_count, char ***uri)
3260 * @brief This API gets the list of uri of the application
3262 * @par This API is for package-manager client application
3263 * @par Sync (or) Async : Synchronous API
3265 * @param[in] handle pointer to the appcontrol handle.
3266 * @param[out] uri_count pointer to hold number of uris
3267 * @param[out] uri pointer to hold list of uris
3268 * @return 0 if success, error code(<0) if fail
3269 * @retval PMINFO_R_OK success
3270 * @retval PMINFO_R_EINVAL invalid argument
3271 * @retval PMINFO_R_ERROR internal error
3272 * @pre pkgmgrinfo_appinfo_get_appinfo()
3273 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3274 * @see pkgmgrinfo_appinfo_get_operation()
3275 * @see pkgmgrinfo_appinfo_get_mime()
3277 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3282 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
3283 for (i = 0; i < uc; i++) {
3284 if (strcmp(uri[i], (char *)user_data) == 0)
3291 static int check_uri(const char *appid, char *uri)
3294 pkgmgrinfo_appinfo_h handle;
3295 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3296 if (ret != PMINFO_R_OK)
3298 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
3299 if (ret != PMINFO_R_OK) {
3300 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3303 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3308 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3309 int *uri_count, char ***uri);
3312 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3313 int *mime_count, char ***mime)
3314 * @brief This API gets the list of mime of the application
3316 * @par This API is for package-manager client application
3317 * @par Sync (or) Async : Synchronous API
3319 * @param[in] handle pointer to the appcontrol handle.
3320 * @param[out] mime_count pointer to hold number of mimes
3321 * @param[out] mime pointer to hold list of mimes
3322 * @return 0 if success, error code(<0) if fail
3323 * @retval PMINFO_R_OK success
3324 * @retval PMINFO_R_EINVAL invalid argument
3325 * @retval PMINFO_R_ERROR internal error
3326 * @pre pkgmgrinfo_appinfo_get_appinfo()
3327 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3328 * @see pkgmgrinfo_appinfo_get_uri()
3329 * @see pkgmgrinfo_appinfo_get_operation()
3331 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3336 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
3337 for (i = 0; i < mc; i++) {
3338 if (strcmp(mime[i], (char *)user_data) == 0)
3345 static int check_mime(const char *appid, char *mime)
3348 pkgmgrinfo_appinfo_h handle;
3349 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3350 if (ret != PMINFO_R_OK)
3352 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3353 if (ret != PMINFO_R_OK) {
3354 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3357 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3362 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3363 int *mime_count, char ***mime);
3366 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3367 int *subapp_count, char ***subapp)
3368 * @brief This API gets the list of subapp of the application
3370 * @par This API is for package-manager client application
3371 * @par Sync (or) Async : Synchronous API
3373 * @param[in] handle pointer to the appcontrol handle.
3374 * @param[out] subapp_count pointer to hold number of subapp
3375 * @param[out] subapp pointer to hold list of subapp
3376 * @return 0 if success, error code(<0) if fail
3377 * @retval PMINFO_R_OK success
3378 * @retval PMINFO_R_EINVAL invalid argument
3379 * @retval PMINFO_R_ERROR internal error
3380 * @pre pkgmgrinfo_appinfo_get_appinfo()
3381 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3382 * @see pkgmgrinfo_appinfo_get_uri()
3383 * @see pkgmgrinfo_appinfo_get_operation()
3385 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3389 char **subapp = NULL;
3390 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3391 for (i = 0; i < sc; i++) {
3392 if (strcmp(subapp[i], (char *)user_data) == 0)
3399 static int check_subapp(const char *appid, char *subapp)
3402 pkgmgrinfo_appinfo_h handle = NULL;
3403 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3404 if (ret != PMINFO_R_OK)
3406 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3407 if (ret != PMINFO_R_OK) {
3408 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3411 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3416 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3417 int *subapp_count, char ***subapp);
3420 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3421 * @brief This API gets the notification icon of the application
3423 * @par This API is for package-manager client application
3424 * @par Sync (or) Async : Synchronous API
3426 * @param[in] handle pointer to the application info handle.
3427 * @param[out] path pointer to hold notification icon
3428 * @return 0 if success, error code(<0) if fail
3429 * @retval PMINFO_R_OK success
3430 * @retval PMINFO_R_EINVAL invalid argument
3431 * @retval PMINFO_R_ERROR internal error
3432 * @pre pkgmgrinfo_appinfo_get_appinfo()
3433 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3434 * @see pkgmgrinfo_appinfo_get_appid()
3435 * @see pkgmgrinfo_appinfo_is_multiple()
3437 static int get_app_notification_icon(const char *appid)
3440 char *notification_icon = NULL;
3441 pkgmgrinfo_appinfo_h handle;
3442 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3443 if (ret != PMINFO_R_OK)
3445 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3446 if (ret != PMINFO_R_OK) {
3447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3450 printf("notification icon : %s\n", notification_icon);
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3459 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3460 * @brief This API gets the setting icon of the application
3462 * @par This API is for package-manager client application
3463 * @par Sync (or) Async : Synchronous API
3465 * @param[in] handle pointer to the application info handle.
3466 * @param[out] path pointer to hold setting icon
3467 * @return 0 if success, error code(<0) if fail
3468 * @retval PMINFO_R_OK success
3469 * @retval PMINFO_R_EINVAL invalid argument
3470 * @retval PMINFO_R_ERROR internal error
3471 * @pre pkgmgrinfo_appinfo_get_appinfo()
3472 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3473 * @see pkgmgrinfo_appinfo_get_appid()
3474 * @see pkgmgrinfo_appinfo_is_multiple()
3476 static int get_app_setting_icon(const char *appid)
3479 char *setting_icon = NULL;
3480 pkgmgrinfo_appinfo_h handle;
3481 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3482 if (ret != PMINFO_R_OK)
3484 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3485 if (ret != PMINFO_R_OK) {
3486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3489 printf("setting icon : %s\n", setting_icon);
3490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3495 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3498 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3499 * @brief This API gets the type of recent image on app-tray
3501 * @par This API is for package-manager client application
3502 * @par Sync (or) Async : Synchronous API
3504 * @param[in] handle pointer to the application info handle.
3505 * @param[out] type pointer to hold image type
3506 * @return 0 if success, error code(<0) if fail
3507 * @retval PMINFO_R_OK success
3508 * @retval PMINFO_R_EINVAL invalid argument
3509 * @retval PMINFO_R_ERROR internal error
3510 * @pre pkgmgrinfo_appinfo_get_appinfo()
3511 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3512 * @see pkgmgrinfo_appinfo_get_appid()
3513 * @see pkgmgrinfo_appinfo_is_multiple()
3515 static int get_app_recent_image_type(const char *appid)
3518 pkgmgrinfo_app_recentimage type;
3519 pkgmgrinfo_appinfo_h handle;
3520 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3521 if (ret != PMINFO_R_OK)
3523 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3524 if (ret != PMINFO_R_OK) {
3525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3528 printf("recent image type: %d\n", type);
3529 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3534 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3538 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3539 * @brief This API gets the preview image of application
3541 * @par Sync (or) Async : Synchronous API
3543 * @param[in] handle pointer to the application info handle.
3544 * @param[out] preview_img pointer to hold preview image path
3545 * @return 0 if success, error code(<0) if fail
3546 * @retval PMINFO_R_OK success
3547 * @retval PMINFO_R_EINVAL invalid argument
3548 * @retval PMINFO_R_ERROR internal error
3549 * @pre pkgmgrinfo_appinfo_get_appinfo()
3550 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3551 * @see pkgmgrinfo_appinfo_get_appid()
3553 static int get_app_previewimage(const char *appid)
3556 char *preview = NULL;
3557 pkgmgrinfo_appinfo_h handle = NULL;
3558 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3559 if (ret != PMINFO_R_OK)
3561 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3562 if (ret != PMINFO_R_OK) {
3563 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3566 printf("preview image path : %s\n", preview);
3567 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3572 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3576 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3577 * @brief This API gets the package permission type of the application
3579 * @par This API is for package-manager client application
3580 * @par Sync (or) Async : Synchronous API
3582 * @param[in] handle pointer to the application info handle.
3583 * @param[out] permission pointer to hold package permission
3584 * @return 0 if success, error code(<0) if fail
3585 * @retval PMINFO_R_OK success
3586 * @retval PMINFO_R_EINVAL invalid argument
3587 * @retval PMINFO_R_ERROR internal error
3588 * @pre pkgmgrinfo_appinfo_get_appinfo()
3589 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3590 * @see pkgmgrinfo_appinfo_get_appid()
3592 static int get_app_permission(const char *appid)
3595 pkgmgrinfo_permission_type permission = 0;
3596 pkgmgrinfo_appinfo_h handle;
3598 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3599 if (ret != PMINFO_R_OK)
3601 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3602 if (ret != PMINFO_R_OK) {
3603 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3606 printf("permission type: %d\n", permission);
3607 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3612 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3615 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3616 * @brief This API gets the component_type
3618 * @par This API is for package-manager client application
3619 * @par Sync (or) Async : Synchronous API
3621 * @param[in] handle pointer to the application info handle.
3622 * @param[out] component_type pointer to hold component_type
3623 * @return 0 if success, error code(<0) if fail
3624 * @retval PMINFO_R_OK success
3625 * @retval PMINFO_R_EINVAL invalid argument
3626 * @retval PMINFO_R_ERROR internal error
3627 * @pre pkgmgrinfo_appinfo_get_appinfo()
3628 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3629 * @see pkgmgrinfo_appinfo_get_pkgid()
3630 * @see pkgmgrinfo_appinfo_is_multiple()
3632 static int get_component_type(const char *appid)
3635 char *component_type = NULL;
3636 pkgmgrinfo_appinfo_h handle;
3637 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3638 if (ret != PMINFO_R_OK)
3640 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3641 if (ret != PMINFO_R_OK) {
3642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3645 printf("component_type: %s\n", component_type);
3646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3651 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3654 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3655 * @brief This API gets the application 'hwacceleration' value from the app ID
3657 * @par This API is for package-manager client application
3658 * @par Sync (or) Async : Synchronous API
3660 * @param[in] handle pointer to application info handle
3661 * @param[out] hwacceleration pointer to hold package hwacceleration value
3662 * @return 0 if success, error code(<0) if fail
3663 * @retval PMINFO_R_OK success
3664 * @retval PMINFO_R_EINVAL invalid argument
3665 * @retval PMINFO_R_ERROR internal error
3666 * @pre pkgmgrinfo_appinfo_get_appinfo()
3667 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3668 * @see pkgmgrinfo_appinfo_get_appid()
3669 * @see pkgmgrinfo_appinfo_is_multiple()
3671 static int get_app_hwacceleration(const char *appid)
3674 pkgmgrinfo_app_hwacceleration hwacceleration;
3675 pkgmgrinfo_appinfo_h handle;
3676 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3677 if (ret != PMINFO_R_OK)
3679 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3680 if (ret != PMINFO_R_OK) {
3681 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3684 printf("app hwacceleration: %d\n", hwacceleration);
3685 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3690 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3693 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3694 * @brief This API gets the application 'screenreader' value from the app ID
3696 * @par This API is for package-manager client application
3697 * @par Sync (or) Async : Synchronous API
3699 * @param[in] handle pointer to application info handle
3700 * @param[out] screenreader pointer to hold package accessibility value
3701 * @return 0 if success, error code(<0) if fail
3702 * @retval PMINFO_R_OK success
3703 * @retval PMINFO_R_EINVAL invalid argument
3704 * @retval PMINFO_R_ERROR internal error
3705 * @pre pkgmgrinfo_appinfo_get_appinfo()
3706 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3707 * @see pkgmgrinfo_appinfo_get_appid()
3708 * @see pkgmgrinfo_appinfo_is_multiple()
3710 static int get_app_screenreader(const char *appid)
3713 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3714 pkgmgrinfo_appinfo_h handle = NULL;
3715 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3716 if (ret != PMINFO_R_OK)
3718 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3719 if (ret != PMINFO_R_OK) {
3720 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3723 printf("app screenreader: %d\n", screenreader);
3724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3729 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3732 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3733 * @brief This API gets the application's landscape & portrait effect images
3735 * @par This API is for package-manager client application
3736 * @par Sync (or) Async : Synchronous API
3738 * @param[in] handle pointer to application info handle
3739 * @param[out] portrait_img contains portrait mode effect image
3740 * @param[out] landscape_img contains landscape mode effect image
3741 * @return 0 if success, error code(<0) if fail
3742 * @retval PMINFO_R_OK success
3743 * @retval PMINFO_R_EINVAL invalid argument
3744 * @retval PMINFO_R_ERROR internal error
3745 * @pre pkgmgrinfo_appinfo_get_appinfo()
3746 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3747 * @see pkgmgrinfo_appinfo_get_appid()
3748 * @see pkgmgrinfo_appinfo_is_nodisplay()
3750 static int get_app_effectimages(const char *appid)
3753 char *portraitimg = NULL;
3754 char *landscapeimg = NULL;
3755 pkgmgrinfo_appinfo_h handle;
3756 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3757 if (ret != PMINFO_R_OK)
3759 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3760 if (ret != PMINFO_R_OK) {
3761 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3764 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3765 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3770 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3773 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3774 * @brief This API gets the application's effect image type
3776 * @par This API is for package-manager client application
3777 * @par Sync (or) Async : Synchronous API
3779 * @param[in] handle pointer to application info handle
3780 * @param[out] effectimg_type contains effect image type
3781 * @return 0 if success, error code(<0) if fail
3782 * @retval PMINFO_R_OK success
3783 * @retval PMINFO_R_EINVAL invalid argument
3784 * @retval PMINFO_R_ERROR internal error
3785 * @pre pkgmgrinfo_appinfo_get_appinfo()
3786 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3787 * @see pkgmgrinfo_appinfo_get_appid()
3788 * @see pkgmgrinfo_appinfo_is_nodisplay()
3790 static int get_app_effectimage_type(const char *appid)
3793 char *effectimg_type = NULL;
3794 pkgmgrinfo_appinfo_h handle = NULL;
3795 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3796 if (ret != PMINFO_R_OK)
3798 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3799 if (ret != PMINFO_R_OK) {
3800 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3803 printf("app effect image type: %s\n", effectimg_type);
3804 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3809 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3812 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3813 * @brief This API gets the submode_mainid of the application
3815 * @par This API is for package-manager client application
3816 * @par Sync (or) Async : Synchronous API
3818 * @param[in] handle pointer to the application info handle.
3819 * @param[out] submode_mainid pointer to hold package name
3820 * @return 0 if success, error code(<0) if fail
3821 * @retval PMINFO_R_OK success
3822 * @retval PMINFO_R_EINVAL invalid argument
3823 * @retval PMINFO_R_ERROR internal error
3824 * @pre pkgmgrinfo_appinfo_get_appinfo()
3825 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3826 * @see pkgmgrinfo_appinfo_get_appid()
3827 * @see pkgmgrinfo_appinfo_is_multiple()
3829 static int get_app_submode_mainid(const char *appid)
3832 char *submode_mainid = NULL;
3833 pkgmgrinfo_appinfo_h handle = NULL;
3834 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3835 if (ret != PMINFO_R_OK)
3837 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3838 if (ret != PMINFO_R_OK) {
3839 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3842 printf("submode_mainid: %s\n", submode_mainid);
3843 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3848 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3851 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3852 * @brief This API gets the datacontrol info
3854 * @par This API is for package-manager client application
3855 * @par Sync (or) Async : Synchronous API
3857 * @param[in] providerid pointer to the providerid of dataconltrol.
3858 * @param[in] type pointer to the type of dataconltrol.
3859 * @param[out] appid pointer to hold appid, need to free after using
3860 * @param[out] access pointer to hold access, need to free after using
3861 * @return 0 if success, error code(<0) if fail
3862 * @retval PMINFO_R_OK success
3863 * @retval PMINFO_R_EINVAL invalid argument
3864 * @retval PMINFO_R_ERROR internal error
3867 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3868 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3871 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3872 * @brief This API gets the appid of datacontrol
3874 * @par This API is for package-manager client application
3875 * @par Sync (or) Async : Synchronous API
3877 * @param[in] providerid pointer to the providerid of dataconltrol.
3878 * @param[out] appid pointer to hold appid, need to free after using
3879 * @return 0 if success, error code(<0) if fail
3880 * @retval PMINFO_R_OK success
3881 * @retval PMINFO_R_EINVAL invalid argument
3882 * @retval PMINFO_R_ERROR internal error
3885 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3886 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3889 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3890 * @brief This API gets the information about trusted datacontrol
3892 * @par This API is for package-manager client application
3893 * @par Sync (or) Async : Synchronous API
3895 * @param[in] providerid pointer to the providerid of datacontrol.
3896 * @param[out] appid pointer to hold appid, need to free after using
3897 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3898 * @return 0 if success, error code(<0) if fail
3899 * @retval PMINFO_R_OK success
3900 * @retval PMINFO_R_EINVAL invalid argument
3901 * @retval PMINFO_R_ERROR internal error
3904 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3905 const char *type, char **appid, bool *is_trusted);
3906 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3907 const char *type, uid_t uid, char **appid, bool *is_trusted);
3910 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3911 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3912 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3914 * @par This API is for package-manager client application
3915 * @par Sync (or) Async : Synchronous API
3917 * @param[in] providerid pointer to the providerid of datacontrol.
3918 * @param[in] type pointer to the type of dataconltrol.
3919 * @param[in] privilege_func callback function for list
3920 * @param[in] user_data user data to be passed to callback function
3921 * @return 0 if success, error code(<0) if fail
3922 * @retval PMINFO_R_OK success
3923 * @retval PMINFO_R_EINVAL invalid argument
3924 * @retval PMINFO_R_ERROR internal error
3926 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3927 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3928 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3929 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3932 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3933 * @brief This API gets the alias_appid of the application
3935 * @par This API is for package-manager client application
3936 * @par Sync (or) Async : Synchronous API
3938 * @param[in] handle pointer to the application info handle.
3939 * @param[out] alias_appid pointer to hold app alias_appid
3940 * @return 0 if success, error code(<0) if fail
3941 * @retval PMINFO_R_OK success
3942 * @retval PMINFO_R_EINVAL invalid argument
3943 * @retval PMINFO_R_ERROR internal error
3944 * @pre pkgmgrinfo_appinfo_get_appinfo()
3945 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3946 * @see pkgmgrinfo_appinfo_get_appid()
3948 static int get_alias_appid(const char *appid)
3951 char *alias_appid= 0;
3952 pkgmgrinfo_appinfo_h handle = NULL;
3953 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3954 if (ret != PMINFO_R_OK)
3956 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3957 if (ret != PMINFO_R_OK) {
3958 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3961 printf("alias_appid: %s\n", alias_appid);
3962 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3967 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3970 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3971 * @brief This API gets the effective_appid of the application
3973 * @par This API is for package-manager client application
3974 * @par Sync (or) Async : Synchronous API
3976 * @param[in] handle pointer to the application info handle.
3977 * @param[out] effective_appid pointer to hold app effective_appid
3978 * @return 0 if success, error code(<0) if fail
3979 * @retval PMINFO_R_OK success
3980 * @retval PMINFO_R_EINVAL invalid argument
3981 * @retval PMINFO_R_ERROR internal error
3982 * @pre pkgmgrinfo_appinfo_get_appinfo()
3983 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3984 * @see pkgmgrinfo_appinfo_get_appid()
3986 static int get_effective_appid(const char *appid)
3989 char *effective_appid= 0;
3990 pkgmgrinfo_appinfo_h handle = NULL;
3991 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3992 if (ret != PMINFO_R_OK)
3994 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3995 if (ret != PMINFO_R_OK) {
3996 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3999 printf("effective_appid: %s\n", effective_appid);
4000 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4005 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
4008 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
4009 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
4011 * @par This API is for package-manager client application
4012 * @par Sync (or) Async : Synchronous API
4014 * @param[in] handle pointer to the appinfo handle.
4015 * @param[out] tep_name pointer to hold tep name
4016 * @return 0 if success, error code(<0) if fail
4017 * @retval PMINFO_R_OK success
4018 * @retval PMINFO_R_EINVAL invalid argument
4019 * @retval PMINFO_R_ERROR internal error
4020 * @pre pkgmgrinfo_appinfo_get_appinfo()
4021 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4022 * @see pkgmgrinfo_appinfo_get_appid()
4024 static int get_tep_name(const char *appid)
4027 char *tep_name = NULL;
4028 pkgmgrinfo_appinfo_h handle = NULL;
4029 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4030 if (ret != PMINFO_R_OK)
4032 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
4033 if (ret != PMINFO_R_OK) {
4034 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4037 printf("TEP name is: %s\n", tep_name);
4038 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4043 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4046 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4047 * @brief This API gets zip mount file name associated with the package which contain given application
4048 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4050 * @par This API is for package-manager client application
4051 * @par Sync (or) Async : Synchronous API
4053 * @param[in] handle pointer to the appinfo handle.
4054 * @param[out] zip_mount_file pointer to hold zip mount file name
4055 * @return 0 if success, error code(<0) if fail
4056 * @retval PMINFO_R_OK success
4057 * @retval PMINFO_R_EINVAL invalid argument
4058 * @retval PMINFO_R_ERROR internal error
4059 * @pre pkgmgrinfo_appinfo_get_appinfo()
4060 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4061 * @see pkgmgrinfo_appinfo_get_appid()
4063 static int get_zip_mount_file(const char *appid)
4066 char *zip_mount_file = NULL;
4067 pkgmgrinfo_appinfo_h handle = NULL;
4068 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4069 if (ret != PMINFO_R_OK)
4071 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4072 if (ret != PMINFO_R_OK) {
4073 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4076 printf("Mount file name is: %s\n", zip_mount_file);
4077 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4082 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4085 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4086 * @brief This API gets the root path of application
4088 * @par Sync (or) Async : Synchronous API
4090 * @param[in] handle pointer to appinfo handle
4091 * @param[out] path pointer to hold root path of application
4092 * @return 0 if success, error code(<0) if fail
4093 * @retval PMINFO_R_OK success
4094 * @retval PMINFO_R_EINVAL invalid argument
4095 * @retval PMINFO_R_ERROR internal error
4097 static int get_root_path(const char *appid)
4101 pkgmgrinfo_appinfo_h handle;
4102 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4103 if (ret != PMINFO_R_OK)
4106 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4107 if (ret != PMINFO_R_OK) {
4108 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4111 printf("path : %s\n", path);
4112 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4118 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4121 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4122 * @brief This API gets the application api_version from the application ID
4124 * @par This API is for package-manager client application
4125 * @par Sync (or) Async : Synchronous API
4127 * @param[in] handle pointer to appinfo handle
4128 * @param[out] api_version pointer to hold application api_version
4129 * @return 0 if success, error code(<0) if fail
4130 * @retval PMINFO_R_OK success
4131 * @retval PMINFO_R_EINVAL invalid argument
4132 * @retval PMINFO_R_ERROR internal error
4133 * @pre pkgmgrinfo_appinfo_get_appinfo()
4134 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4135 * @see pkgmgrinfo_appinfo_get_appid()
4137 static int get_app_api_version(const char *appid)
4140 char *api_version = NULL;
4141 pkgmgrinfo_appinfo_h handle = NULL;
4142 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4143 if (ret != PMINFO_R_OK)
4145 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4146 if (ret != PMINFO_R_OK) {
4147 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4150 printf("app api_version: %s\n", api_version);
4151 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4156 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4159 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4160 * @brief This API gets the installed_time of the application
4162 * @par This API is for package-manager client application
4163 * @par Sync (or) Async : Synchronous API
4165 * @param[in] handle pointer to the application info handle.
4166 * @param[out] installed_time pointer to hold installed_time
4167 * @return 0 if success, error code(<0) if fail
4168 * @retval PMINFO_R_OK success
4169 * @retval PMINFO_R_EINVAL invalid argument
4170 * @retval PMINFO_R_ERROR internal error
4171 * @pre pkgmgrinfo_appinfo_get_appinfo()
4172 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4173 * @see pkgmgrinfo_appinfo_get_appid()
4174 * @see pkgmgrinfo_appinfo_is_multiple()
4176 static int get_app_installed_time(const char *appid)
4179 int installed_time = 0;
4180 pkgmgrinfo_appinfo_h handle = NULL;
4181 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4182 if (ret != PMINFO_R_OK)
4184 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4185 if (ret != PMINFO_R_OK) {
4186 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4189 printf("installed_time: %d\n", installed_time);
4190 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4195 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4198 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4199 * @brief This API gets the support_mode of the application
4201 * @par This API is for package-manager client application
4202 * @par Sync (or) Async : Synchronous API
4204 * @param[in] handle pointer to the application info handle.
4205 * @param[out] support_mode pointer to hold app support_mode
4206 * @return 0 if success, error code(<0) if fail
4207 * @retval PMINFO_R_OK success
4208 * @retval PMINFO_R_EINVAL invalid argument
4209 * @retval PMINFO_R_ERROR internal error
4210 * @pre pkgmgrinfo_appinfo_get_appinfo()
4211 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4212 * @see pkgmgrinfo_appinfo_get_appid()
4214 static int get_app_support_mode(const char *appid)
4217 int support_mode = 0;
4218 pkgmgrinfo_appinfo_h handle = NULL;
4219 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4220 if (ret != PMINFO_R_OK)
4222 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4223 if (ret != PMINFO_R_OK) {
4224 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4227 printf("support_mode: %s\n", support_mode);
4228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4233 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4237 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4238 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4239 * @brief This API gets the list of category for a particular application
4241 * @par This API is for package-manager client application
4242 * @par Sync (or) Async : Synchronous API
4243 * @param[in] handle pointer to the application info handle.
4244 * @param[in] category_func callback function for list
4245 * @param[in] user_data user data to be passed to callback function
4246 * @return 0 if success, error code(<0) if fail
4247 * @retval PMINFO_R_OK success
4248 * @retval PMINFO_R_EINVAL invalid argument
4249 * @retval PMINFO_R_ERROR internal error
4250 * @pre pkgmgrinfo_appinfo_get_appinfo()
4251 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4253 int category_func(const char *name, void *user_data)
4255 if (strcmp(name, (char *)user_data) == 0)
4261 static int list_category(const char *appid, char *category)
4264 pkgmgrinfo_appinfo_h handle;
4265 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4266 if (ret != PMINFO_R_OK)
4268 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4269 if (ret != PMINFO_R_OK) {
4270 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4273 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4278 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4279 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4282 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4283 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4284 * @brief This API gets the list of metadata for a particular application
4286 * @par This API is for package-manager client application
4287 * @par Sync (or) Async : Synchronous API
4288 * @param[in] handle pointer to the application info handle.
4289 * @param[in] metadata_func callback function for list
4290 * @param[in] user_data user data to be passed to callback function
4291 * @return 0 if success, error code(<0) if fail
4292 * @retval PMINFO_R_OK success
4293 * @retval PMINFO_R_EINVAL invalid argument
4294 * @retval PMINFO_R_ERROR internal error
4295 * @pre pkgmgrinfo_appinfo_get_appinfo()
4296 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4298 int metadata_func(const char *key, const char *value, void *user_data)
4300 if (strcmp(key, (char *)user_data) == 0) {
4301 printf("Value is %s\n", value);
4308 static int list_metadata(const char *appid, char *key)
4311 pkgmgrinfo_appinfo_h handle;
4312 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4313 if (ret != PMINFO_R_OK)
4315 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4316 if (ret != PMINFO_R_OK) {
4317 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4320 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4325 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4326 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4329 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4330 * const char *operation, const char *uri, const char *mime,
4331 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4333 * @brief This API gets the list of privileges for a particular
4334 * appllication's app_control
4336 * @par This API is for package-manager client application
4337 * @par Sync (or) Async : Synchronous API
4338 * @param[in] appid application id
4339 * @param[in] operation operation of appcontrol
4340 * @param[in] uri uri of appcontrol
4341 * @param[in] mime mime of appcontrol
4342 * @param[in] privilege_func callback function for list
4343 * @param[in] user_data user data to be passed to callback function
4344 * @return 0 if success, error code(<0) if fail
4345 * @retval PMINFO_R_OK success
4346 * @retval PMINFO_R_EINVAL invalid argument
4347 * @retval PMINFO_R_ERROR internal error
4349 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4350 const char *operation, const char *uri, const char *mime,
4351 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4352 void *user_data, uid_t uid);
4353 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4354 const char *operation, const char *uri, const char *mime,
4355 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4359 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4360 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4361 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4362 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4363 * @brief This API gets the list of app-control for a particular application
4365 * @par This API is for package-manager client application
4366 * @par Sync (or) Async : Synchronous API
4367 * @param[in] handle pointer to the application info handle.
4368 * @param[in] appcontrol_func callback function for list
4369 * @param[in] user_data user data to be passed to callback function
4370 * @param[in] uid the addressee user id of the instruction
4371 * @return 0 if success, error code(<0) if fail
4372 * @retval PMINFO_R_OK success
4373 * @retval PMINFO_R_EINVAL invalid argument
4374 * @retval PMINFO_R_ERROR internal error
4375 * @pre pkgmgrinfo_appinfo_get_appinfo()
4376 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4378 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4383 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4384 for (i = 0; i < oc; i++) {
4385 if (strcmp(operation[i], (char *)user_data) == 0)
4392 static int check_operation(const char *appid, char *operation)
4395 pkgmgrinfo_appinfo_h handle;
4396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4397 if (ret != PMINFO_R_OK)
4399 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4400 if (ret != PMINFO_R_OK) {
4401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4404 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4409 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4410 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4415 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4416 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4419 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4420 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4421 * @brief This API gets the list of splashscreen for a particular application
4423 * @par This API is for package-manager client application
4424 * @par Sync (or) Async : Synchronous API
4425 * @param[in] handle pointer to the application info handle.
4426 * @param[in] splash_screen_func callback function for list
4427 * @param[in] user_data user data to be passed to callback function
4428 * @return 0 if success, error code(<0) if fail
4429 * @retval PMINFO_R_OK success
4430 * @retval PMINFO_R_EINVAL invalid argument
4431 * @retval PMINFO_R_ERROR internal error
4432 * @pre pkgmgrinfo_appinfo_get_appinfo()
4433 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4436 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4437 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4440 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4441 * @brief This API gets the application 'nodisplay' value from the app ID
4443 * @par This API is for package-manager client application
4444 * @par Sync (or) Async : Synchronous API
4446 * @param[in] handle pointer to application info handle
4447 * @param[out] nodisplay pointer to hold package nodisplay value
4448 * @return 0 if success, error code(<0) if fail
4449 * @retval PMINFO_R_OK success
4450 * @retval PMINFO_R_EINVAL invalid argument
4451 * @retval PMINFO_R_ERROR internal error
4452 * @pre pkgmgrinfo_appinfo_get_appinfo()
4453 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4454 * @see pkgmgrinfo_appinfo_get_appid()
4455 * @see pkgmgrinfo_appinfo_is_multiple()
4457 static int get_app_nodisplay(const char *appid)
4461 pkgmgrinfo_appinfo_h handle;
4462 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4463 if (ret != PMINFO_R_OK)
4465 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4466 if (ret != PMINFO_R_OK) {
4467 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4470 printf("app nodisplay: %d\n", nodisplay);
4471 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4476 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4479 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4480 * @brief This API gets the application 'multiple' value from the app ID
4482 * @par This API is for package-manager client application
4483 * @par Sync (or) Async : Synchronous API
4485 * @param[in] handle pointer to application info handle
4486 * @param[out] multiple pointer to hold package multiple value
4487 * @return 0 if success, error code(<0) if fail
4488 * @retval PMINFO_R_OK success
4489 * @retval PMINFO_R_EINVAL invalid argument
4490 * @retval PMINFO_R_ERROR internal error
4491 * @pre pkgmgrinfo_appinfo_get_appinfo()
4492 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4493 * @see pkgmgrinfo_appinfo_get_appid()
4494 * @see pkgmgrinfo_appinfo_is_nodisplay()
4496 static int get_app_multiple(const char *appid)
4500 pkgmgrinfo_appinfo_h handle;
4501 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4502 if (ret != PMINFO_R_OK)
4504 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4505 if (ret != PMINFO_R_OK) {
4506 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4509 printf("app multiple: %d\n", multiple);
4510 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4515 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4518 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4519 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4520 * application launching effect. If fales, indicator will be hidden during application launching effect
4522 * @par This API is for package-manager client application
4523 * @par Sync (or) Async : Synchronous API
4525 * @param[in] handle pointer to application info handle
4526 * @param[out] indicator_disp contains indicator display status for application launching effect
4527 * @return 0 if success, error code(<0) if fail
4528 * @retval PMINFO_R_OK success
4529 * @retval PMINFO_R_EINVAL invalid argument
4530 * @retval PMINFO_R_ERROR internal error
4531 * @pre pkgmgrinfo_appinfo_get_appinfo()
4532 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4533 * @see pkgmgrinfo_appinfo_get_appid()
4534 * @see pkgmgrinfo_appinfo_is_nodisplay()
4536 static int get_app_indicator_display(const char *appid)
4539 bool indicator_disp;
4540 pkgmgrinfo_appinfo_h handle;
4541 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4542 if (ret != PMINFO_R_OK)
4544 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4545 if (ret != PMINFO_R_OK){
4546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4549 printf("app indicator disp : %d\n", indicator_disp);
4550 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4555 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4558 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4559 * @brief This API gets the application 'taskmanage' value from the app ID
4561 * @par This API is for package-manager client application
4562 * @par Sync (or) Async : Synchronous API
4564 * @param[in] handle pointer to application info handle
4565 * @param[out] taskmanage pointer to hold package taskmanage value
4566 * @return 0 if success, error code(<0) if fail
4567 * @retval PMINFO_R_OK success
4568 * @retval PMINFO_R_EINVAL invalid argument
4569 * @retval PMINFO_R_ERROR internal error
4570 * @pre pkgmgrinfo_appinfo_get_appinfo()
4571 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4572 * @see pkgmgrinfo_appinfo_get_appid()
4573 * @see pkgmgrinfo_appinfo_is_multiple()
4575 static int get_app_taskmanage(const char *appid)
4579 pkgmgrinfo_appinfo_h handle;
4580 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4581 if (ret != PMINFO_R_OK)
4583 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4584 if (ret != PMINFO_R_OK) {
4585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4588 printf("app taskmanage: %d\n", taskmanage);
4589 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4594 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4597 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4598 * @brief This API gets the application 'taskmanage' value from the app ID
4600 * @par This API is for package-manager client application
4601 * @par Sync (or) Async : Synchronous API
4603 * @param[in] handle pointer to application info handle
4604 * @param[out] enabled pointer to hold package enabled value
4605 * @return 0 if success, error code(<0) if fail
4606 * @retval PMINFO_R_OK success
4607 * @retval PMINFO_R_EINVAL invalid argument
4608 * @retval PMINFO_R_ERROR internal error
4609 * @pre pkgmgrinfo_appinfo_get_appinfo()
4610 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4611 * @see pkgmgrinfo_appinfo_get_appid()
4612 * @see pkgmgrinfo_appinfo_is_multiple()
4614 static int get_app_enabled(const char *appid)
4618 pkgmgrinfo_appinfo_h handle;
4619 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4620 if (ret != PMINFO_R_OK)
4622 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4623 if (ret != PMINFO_R_OK) {
4624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4627 printf("app enabled: %d\n", enabled);
4628 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4633 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4636 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4637 * @brief This API gets the application 'onboot' value from the app ID
4639 * @par This API is for package-manager client application
4640 * @par Sync (or) Async : Synchronous API
4642 * @param[in] handle pointer to application info handle
4643 * @param[out] onboot pointer to hold package onboot value
4644 * @return 0 if success, error code(<0) if fail
4645 * @retval PMINFO_R_OK success
4646 * @retval PMINFO_R_EINVAL invalid argument
4647 * @retval PMINFO_R_ERROR internal error
4648 * @pre pkgmgrinfo_appinfo_get_appinfo()
4649 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4650 * @see pkgmgrinfo_appinfo_get_appid()
4651 * @see pkgmgrinfo_appinfo_is_multiple()
4653 static int get_app_onboot(const char *appid)
4657 pkgmgrinfo_appinfo_h handle;
4658 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4659 if (ret != PMINFO_R_OK)
4661 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4662 if (ret != PMINFO_R_OK) {
4663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4666 printf("app onboot: %d\n", onboot);
4667 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4672 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4675 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4676 * @brief This API gets the application 'autorestart' value from the app ID
4678 * @par This API is for package-manager client application
4679 * @par Sync (or) Async : Synchronous API
4681 * @param[in] handle pointer to application info handle
4682 * @param[out] autorestart pointer to hold package autorestart value
4683 * @return 0 if success, error code(<0) if fail
4684 * @retval PMINFO_R_OK success
4685 * @retval PMINFO_R_EINVAL invalid argument
4686 * @retval PMINFO_R_ERROR internal error
4687 * @pre pkgmgrinfo_appinfo_get_appinfo()
4688 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4689 * @see pkgmgrinfo_appinfo_get_appid()
4690 * @see pkgmgrinfo_appinfo_is_multiple()
4692 static int get_app_autorestart(const char *appid)
4696 pkgmgrinfo_appinfo_h handle;
4697 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4698 if (ret != PMINFO_R_OK)
4700 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4701 if (ret != PMINFO_R_OK) {
4702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4705 printf("app autorestart: %d\n", autorestart);
4706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4711 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4714 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4715 * @brief This API gets the value for given application is main app or not from handle
4717 * @par This API is for package-manager client application
4718 * @par Sync (or) Async : Synchronous API
4720 * @param[in] handle pointer to application info handle
4721 * @param[out] mainapp pointer to hold package mainapp is or not
4722 * @return 0 if success, error code(<0) if fail
4723 * @retval PMINFO_R_OK success
4724 * @retval PMINFO_R_EINVAL invalid argument
4725 * @retval PMINFO_R_ERROR internal error
4726 * @pre pkgmgrinfo_appinfo_get_appinfo()
4727 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4728 * @see pkgmgrinfo_appinfo_get_appid()
4729 * @see pkgmgrinfo_appinfo_is_multiple()
4731 static int get_app_mainapp(const char *appid)
4735 pkgmgrinfo_appinfo_h handle;
4736 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4737 if (ret != PMINFO_R_OK)
4739 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4740 if (ret != PMINFO_R_OK) {
4741 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4744 printf("mainapp: %d\n", mainapp);
4745 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4750 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4754 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4755 * @brief This API gets the value for given application is preload or not from handle
4757 * @par This API is for package-manager client application
4758 * @par Sync (or) Async : Synchronous API
4760 * @param[in] handle pointer to application info handle
4761 * @param[out] preload pointer to hold preload is or not
4762 * @return 0 if success, error code(<0) if fail
4763 * @retval PMINFO_R_OK success
4764 * @retval PMINFO_R_EINVAL invalid argument
4765 * @retval PMINFO_R_ERROR internal error
4766 * @pre pkgmgrinfo_appinfo_get_appinfo()
4767 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4768 * @see pkgmgrinfo_appinfo_get_appid()
4769 * @see pkgmgrinfo_appinfo_is_multiple()
4771 static int get_app_preload(const char *appid)
4775 pkgmgrinfo_appinfo_h handle = NULL;
4776 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4777 if (ret != PMINFO_R_OK)
4779 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4780 if (ret != PMINFO_R_OK) {
4781 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4784 printf("preload: %d\n", preload);
4785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4790 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4793 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4794 * @brief This API gets the value for given application is submode or not from handle
4796 * @par This API is for package-manager client application
4797 * @par Sync (or) Async : Synchronous API
4799 * @param[in] handle pointer to application info handle
4800 * @param[out] submode pointer to hold submode is or not
4801 * @return 0 if success, error code(<0) if fail
4802 * @retval PMINFO_R_OK success
4803 * @retval PMINFO_R_EINVAL invalid argument
4804 * @retval PMINFO_R_ERROR internal error
4805 * @pre pkgmgrinfo_appinfo_get_appinfo()
4806 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4807 * @see pkgmgrinfo_appinfo_get_appid()
4808 * @see pkgmgrinfo_appinfo_is_multiple()
4810 static int get_app_submode(const char *appid)
4814 pkgmgrinfo_appinfo_h handle = NULL;
4815 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4816 if (ret != PMINFO_R_OK)
4818 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4819 if (ret != PMINFO_R_OK) {
4820 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4823 printf("submode: %d\n", submode);
4824 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4829 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4832 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4833 * @brief This API gets the value for given application is process_pool or not from handle
4835 * @par This API is for package-manager client application
4836 * @par Sync (or) Async : Synchronous API
4838 * @param[in] handle pointer to application info handle
4839 * @param[out] process_pool pointer to hold process_pool is or not
4840 * @return 0 if success, error code(<0) if fail
4841 * @retval PMINFO_R_OK success
4842 * @retval PMINFO_R_EINVAL invalid argument
4843 * @retval PMINFO_R_ERROR internal error
4844 * @pre pkgmgrinfo_appinfo_get_appinfo()
4845 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4846 * @see pkgmgrinfo_appinfo_get_appid()
4848 static int get_app_process_pool(const char *appid)
4851 bool process_pool = 0;
4852 pkgmgrinfo_appinfo_h handle = NULL;
4853 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4854 if (ret != PMINFO_R_OK)
4856 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4857 if (ret != PMINFO_R_OK) {
4858 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4861 printf("process_pool: %d\n", process_pool);
4862 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4867 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4870 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4871 * @brief This API gets the installed storage location of the application
4873 * @par This API is for package-manager client application
4874 * @par Sync (or) Async : Synchronous API
4876 * @param[in] handle pointer to the application info handle.
4877 * @param[out] app_type pointer to hold installed storage location
4878 * @return 0 if success, error code(<0) if fail
4879 * @retval PMINFO_R_OK success
4880 * @retval PMINFO_R_EINVAL invalid argument
4881 * @retval PMINFO_R_ERROR internal error
4882 * @pre pkgmgrinfo_appinfo_get_appinfo()
4883 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4884 * @see pkgmgrinfo_appinfo_get_appid()
4886 static int get_app_installed_location(const char *appid)
4889 pkgmgrinfo_installed_storage storage;
4890 pkgmgrinfo_appinfo_h handle = NULL;
4891 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4892 if (ret != PMINFO_R_OK)
4894 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4895 if (ret != PMINFO_R_OK) {
4896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4899 printf("Installed storage location : %d\n", storage);
4900 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4905 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4909 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4910 * @brief This API checks if the application has the given category
4912 * @par This API is for package-manager client application
4913 * @par Sync (or) Async : Synchronous API
4915 * @param[in] handle pointer to the application info handle
4916 * @param[in] category category
4917 * @param[out] exist value Gets whether the application has the given category
4918 * @return 0 if success, error code(<0) if fail
4919 * @retval PMINFO_R_OK success
4920 * @retval PMINFO_R_EINVAL invalid argument
4921 * @retval PMINFO_R_ERROR internal error
4923 static int is_category_exist(const char *appid, const char *category)
4926 pkgmgrinfo_appinfo_h handle;
4929 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4930 if (ret != PMINFO_R_OK)
4933 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4934 if (ret != PMINFO_R_OK) {
4935 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4939 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4944 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4947 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4948 * @brief This API gets the application 'ui_gadget' value from the app ID
4950 * @par This API is for package-manager client application
4951 * @par Sync (or) Async : Synchronous API
4953 * @param[in] handle pointer to application info handle
4954 * @param[out] ui_gadget pointer to hold package ui_gadget value
4955 * @return 0 if success, error code(<0) if fail
4956 * @retval PMINFO_R_OK success
4957 * @retval PMINFO_R_EINVAL invalid argument
4958 * @pre pkgmgrinfo_appinfo_get_appinfo()
4959 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4961 static int get_app_ui_gadget(const char *appid)
4965 pkgmgrinfo_appinfo_h handle = NULL;
4966 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4967 if (ret != PMINFO_R_OK)
4969 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4970 if (ret != PMINFO_R_OK) {
4971 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4974 printf("app ui_gadget: %d\n", ui_gadget);
4975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4980 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4983 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4984 * @brief This API gets the application 'support_disable' value from the app ID
4986 * @par This API is for package-manager client application
4987 * @par Sync (or) Async : Synchronous API
4989 * @param[in] handle pointer to application info handle
4990 * @param[out] support_disable pointer to hold package support_disable value
4991 * @return 0 if success, error code(<0) if fail
4992 * @retval PMINFO_R_OK success
4993 * @retval PMINFO_R_EINVAL invalid argument
4994 * @pre pkgmgrinfo_appinfo_get_appinfo()
4995 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4997 static int get_app_support_disable(const char *appid)
5000 bool support_disable;
5001 pkgmgrinfo_appinfo_h handle = NULL;
5002 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5003 if (ret != PMINFO_R_OK)
5005 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
5006 if (ret != PMINFO_R_OK) {
5007 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5010 printf("app support_disable: %d\n", support_disable);
5011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5016 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
5019 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
5020 * @brief This API gets the application 'removable' value from the app ID
5022 * @par This API is for package-manager client application
5023 * @par Sync (or) Async : Synchronous API
5025 * @param[in] handle pointer to application info handle
5026 * @param[out] removable pointer to hold package removable value
5027 * @return 0 if success, error code(<0) if fail
5028 * @retval PMINFO_R_OK success
5029 * @retval PMINFO_R_EINVAL invalid argument
5030 * @retval PMINFO_R_ERROR internal error
5031 * @pre pkgmgrinfo_appinfo_get_appinfo()
5032 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5033 * @see pkgmgrinfo_appinfo_get_appid()
5035 static int get_app_removable(const char *appid)
5039 pkgmgrinfo_appinfo_h handle = NULL;
5040 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5041 if (ret != PMINFO_R_OK)
5043 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5044 if (ret != PMINFO_R_OK) {
5045 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5048 printf("app removable: %d\n", removable);
5049 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5054 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5057 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5058 * @brief This API gets the application 'system' value from the app ID
5060 * @par This API is for package-manager client application
5061 * @par Sync (or) Async : Synchronous API
5063 * @param[in] handle pointer to application info handle
5064 * @param[out] system pointer to hold package system value
5065 * @return 0 if success, error code(<0) if fail
5066 * @retval PMINFO_R_OK success
5067 * @retval PMINFO_R_EINVAL invalid argument
5068 * @retval PMINFO_R_ERROR internal error
5069 * @pre pkgmgrinfo_appinfo_get_appinfo()
5070 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5071 * @see pkgmgrinfo_appinfo_get_appid()
5073 static int get_app_system(const char *appid)
5076 bool system = false;
5077 pkgmgrinfo_appinfo_h handle = NULL;
5078 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5079 if (ret != PMINFO_R_OK)
5081 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5082 if (ret != PMINFO_R_OK) {
5083 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5086 printf("app system: %d\n", system);
5087 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5092 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5096 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5097 * @brief This API gets the application 'is_disable' value from the app ID
5099 * @par This API is for package-manager client application
5100 * @par Sync (or) Async : Synchronous API
5102 * @param[in] handle pointer to application info handle
5103 * @param[out] disabled pointer to hold application is_disabled value
5104 * @return 0 if success, error code(<0) if fail
5105 * @retval PMINFO_R_OK success
5106 * @retval PMINFO_R_EINVAL invalid argument
5107 * @pre pkgmgrinfo_appinfo_get_appinfo()
5108 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5110 static int get_app_is_disable(const char *appid)
5114 pkgmgrinfo_appinfo_h handle = NULL;
5115 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5116 if (ret != PMINFO_R_OK)
5118 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5119 if (ret != PMINFO_R_OK) {
5120 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5123 printf("app is_disable: %d\n", is_disable);
5124 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5129 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5132 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5133 * @brief This API gets whethere the given application is global application or user application
5135 * @par This API is for package-manager client application
5136 * @par Sync (or) Async : Synchronous API
5138 * @param[in] handle pointer to application info handle
5139 * @param[in] global pointer to hold application global value
5140 * @return 0 if success, error code(<0) if fail
5141 * @retval PMINFO_R_OK success
5142 * @retval PMINFO_R_EINVAL invalid argument
5143 * @retval PMINFO_R_ERROR internal error
5144 * @pre pkgmgrinfo_appinfo_get_appinfo()
5145 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5146 * @see pkgmgrinfo_appinfo_get_appid()
5147 static int get_app_is_global(const char *appid)
5151 pkgmgrinfo_appinfo_h handle = NULL;
5152 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5153 if (ret != PMINFO_R_OK)
5155 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5156 if (ret != PMINFO_R_OK) {
5157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5160 printf("app is_global: %d\n", global);
5161 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5166 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5169 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5170 * @brief This API gets the application 'splash_screen_display' value from the app ID
5172 * @par This API is for package-manager client application
5173 * @par Sync (or) Async : Synchronous API
5175 * @param[in] handle pointer to application info handle
5176 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5177 * @return 0 if success, error code(<0) if fail
5178 * @retval PMINFO_R_OK success
5179 * @retval PMINFO_R_EINVAL invalid argument
5180 * @retval PMINFO_R_ERROR internal error
5182 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5185 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5186 * @brief This API gets the application 'setup_appid' value from the app ID
5188 * @par This API is for package-manager client application
5189 * @par Sync (or) Async : Synchronous API
5191 * @param[in] handle pointer to application info handle
5192 * @param[out] setup_appid pointer to hold package setup_appid value
5193 * @return 0 if success, error code(<0) if fail
5194 * @retval PMINFO_R_OK success
5195 * @retval PMINFO_R_EINVAL invalid argument
5196 * @retval PMINFO_R_ERROR internal error
5198 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5201 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5202 * @brief This API gets the application 'support_ambient' value from the app ID
5204 * @par This API is for package-manager client application
5205 * @par Sync (or) Async : Synchronous API
5207 * @param[in] handle pointer to application info handle
5208 * @param[out] support_ambient pointer to hold package support_ambient value
5209 * @return 0 if success, error code(<0) if fail
5210 * @retval PMINFO_R_OK success
5211 * @retval PMINFO_R_EINVAL invalid argument
5212 * @retval PMINFO_R_ERROR internal error
5214 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5217 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5218 * @brief This API destroys the application information handle freeing up all the resources
5220 * @par This API is for package-manager client application
5221 * @par Sync (or) Async : Synchronous API
5223 * @param[in] handle pointer to the application info handle.
5224 * @return 0 if success, error code(<0) if fail
5225 * @retval PMINFO_R_OK success
5226 * @retval PMINFO_R_EINVAL invalid argument
5227 * @retval PMINFO_R_ERROR internal error
5228 * @pre pkgmgrinfo_appinfo_get_appinfo()
5230 * @see pkgmgrinfo_appinfo_get_pkgid()
5231 * @see pkgmgrinfo_appinfo_is_multiple()
5233 static int get_app_type(const char *appid)
5237 pkgmgrinfo_appinfo_h handle;
5238 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5239 if (ret != PMINFO_R_OK)
5241 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5242 if (ret != PMINFO_R_OK) {
5243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5246 printf("apptype: %s\n", type);
5247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5252 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5255 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5256 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5257 The query will search the entire application information collected from the manifest file of all the installed packages
5259 * @par This API is for package-manager client application
5260 * @par Sync (or) Async : Synchronous API
5262 * @param[out] handle pointer to the application info filter handle.
5263 * @return 0 if success, error code(<0) if fail
5264 * @retval PMINFO_R_OK success
5265 * @retval PMINFO_R_EINVAL invalid argument
5266 * @retval PMINFO_R_ERROR internal error
5268 * @post pkgmgrinfo_appinfo_filter_destroy()
5269 * @see pkgmgrinfo_appinfo_filter_count()
5270 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5272 static int get_capp_count()
5276 pkgmgrinfo_appinfo_filter_h handle;
5277 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5278 if (ret != PMINFO_R_OK)
5280 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5281 if (ret != PMINFO_R_OK) {
5282 pkgmgrinfo_appinfo_filter_destroy(handle);
5285 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5286 if (ret != PMINFO_R_OK) {
5287 pkgmgrinfo_appinfo_filter_destroy(handle);
5290 printf("No of capp: %d\n", count);
5291 pkgmgrinfo_appinfo_filter_destroy(handle);
5296 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5299 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5300 * @brief This API destroys the application information filter handle freeing up all the resources
5302 * @par This API is for package-manager client application
5303 * @par Sync (or) Async : Synchronous API
5305 * @param[in] handle pointer to the application info filter handle.
5306 * @return 0 if success, error code(<0) if fail
5307 * @retval PMINFO_R_OK success
5308 * @retval PMINFO_R_EINVAL invalid argument
5309 * @retval PMINFO_R_ERROR internal error
5310 * @pre pkgmgrinfo_appinfo_filter_create()
5312 * @see pkgmgrinfo_appinfo_filter_count()
5313 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5315 static int get_capp_count()
5319 pkgmgrinfo_appinfo_filter_h handle;
5320 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5321 if (ret != PMINFO_R_OK)
5323 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5324 if (ret != PMINFO_R_OK) {
5325 pkgmgrinfo_appinfo_filter_destroy(handle);
5328 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5329 if (ret != PMINFO_R_OK) {
5330 pkgmgrinfo_appinfo_filter_destroy(handle);
5333 printf("No of capp: %d\n", count);
5334 pkgmgrinfo_appinfo_filter_destroy(handle);
5339 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5342 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5343 * @brief This API adds a boolean filter property to the filter handle
5345 * @par This API is for package-manager client application
5346 * @par Sync (or) Async : Synchronous API
5348 * @param[in] handle pointer to the application info filter handle.
5349 * @param[in] property boolean property name.
5350 * @param[in] value value corresponding to the property.
5351 * @return 0 if success, error code(<0) if fail
5352 * @retval PMINFO_R_OK success
5353 * @retval PMINFO_R_EINVAL invalid argument
5354 * @retval PMINFO_R_ERROR internal error
5355 * @pre pkgmgrinfo_appinfo_filter_create()
5356 * @post pkgmgrinfo_appinfo_filter_destroy()
5357 * @see pkgmgrinfo_appinfo_filter_count()
5358 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5360 static int get_taskmanageable_app_count()
5364 pkgmgrinfo_appinfo_filter_h handle;
5365 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5366 if (ret != PMINFO_R_OK)
5368 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5369 if (ret != PMINFO_R_OK) {
5370 pkgmgrinfo_appinfo_filter_destroy(handle);
5373 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5374 if (ret != PMINFO_R_OK) {
5375 pkgmgrinfo_appinfo_filter_destroy(handle);
5378 printf("No of taskmanageable apps: %d\n", count);
5379 pkgmgrinfo_appinfo_filter_destroy(handle);
5384 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5385 const char *property, const bool value);
5388 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5389 * @brief This API adds an integer filter property to the filter handle
5391 * @par This API is for package-manager client application
5392 * @par Sync (or) Async : Synchronous API
5394 * @param[in] handle pointer to the application info filter handle.
5395 * @param[in] property integer property name.
5396 * @param[in] value value corresponding to the property.
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
5401 * @pre pkgmgrinfo_appinfo_filter_create()
5402 * @post pkgmgrinfo_appinfo_filter_destroy()
5403 * @see pkgmgrinfo_appinfo_filter_count()
5404 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5406 static int get_taskmanageable_app_count()
5410 pkgmgrinfo_appinfo_filter_h handle;
5411 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5412 if (ret != PMINFO_R_OK)
5414 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5415 if (ret != PMINFO_R_OK) {
5416 pkgmgrinfo_appinfo_filter_destroy(handle);
5419 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5420 if (ret != PMINFO_R_OK) {
5421 pkgmgrinfo_appinfo_filter_destroy(handle);
5424 printf("No of apps: %d\n", count);
5425 pkgmgrinfo_appinfo_filter_destroy(handle);
5430 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5431 const char *property, const int value);
5434 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5435 * @brief This API adds a string filter property to the filter handle
5437 * @par This API is for package-manager client application
5438 * @par Sync (or) Async : Synchronous API
5440 * @param[in] handle pointer to the application info filter handle.
5441 * @param[in] property string property name.
5442 * @param[in] value value corresponding to the property.
5443 * @return 0 if success, error code(<0) if fail
5444 * @retval PMINFO_R_OK success
5445 * @retval PMINFO_R_EINVAL invalid argument
5446 * @retval PMINFO_R_ERROR internal error
5447 * @pre pkgmgrinfo_appinfo_filter_create()
5448 * @post pkgmgrinfo_appinfo_filter_destroy()
5449 * @see pkgmgrinfo_appinfo_filter_count()
5450 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5452 static int get_capp_count()
5456 pkgmgrinfo_appinfo_filter_h handle;
5457 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5458 if (ret != PMINFO_R_OK)
5460 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5461 if (ret != PMINFO_R_OK) {
5462 pkgmgrinfo_appinfo_filter_destroy(handle);
5465 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5466 if (ret != PMINFO_R_OK) {
5467 pkgmgrinfo_appinfo_filter_destroy(handle);
5470 printf("No of capp: %d\n", count);
5471 pkgmgrinfo_appinfo_filter_destroy(handle);
5476 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5477 const char *property, const char *value);
5480 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5481 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5483 * @par This API is for package-manager client application
5484 * @par Sync (or) Async : Synchronous API
5486 * @param[in] handle pointer to the application info filter handle.
5487 * @param[in] app_cb callback function.
5488 * @param[in] user_data user data to be passed to the callback function
5489 * @return 0 if success, error code(<0) if fail
5490 * @retval PMINFO_R_OK success
5491 * @retval PMINFO_R_EINVAL invalid argument
5492 * @retval PMINFO_R_ERROR internal error
5493 * @pre pkgmgrinfo_appinfo_filter_create()
5494 * @post pkgmgrinfo_appinfo_filter_destroy()
5495 * @see pkgmgrinfo_appinfo_filter_count()
5497 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5500 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5501 printf("appid : %s\n", appid);
5505 static int get_capp_list()
5508 pkgmgrinfo_appinfo_filter_h handle;
5509 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5510 if (ret != PMINFO_R_OK)
5512 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5513 if (ret != PMINFO_R_OK) {
5514 pkgmgrinfo_appinfo_filter_destroy(handle);
5517 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5518 if (ret != PMINFO_R_OK) {
5519 pkgmgrinfo_appinfo_filter_destroy(handle);
5522 pkgmgrinfo_appinfo_filter_destroy(handle);
5527 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5528 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5529 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5530 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5533 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5534 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5535 * @brief This API counts the application that satisfy the filter conditions
5537 * @par This API is for package-manager client application
5538 * @par Sync (or) Async : Synchronous API
5540 * @param[in] handle pointer to the application info filter handle.
5541 * @param[in] count pointer to store count value
5542 * @param[in] uid the addressee user id of the instruction
5543 * @return 0 if success, error code(<0) if fail
5544 * @retval PMINFO_R_OK success
5545 * @retval PMINFO_R_EINVAL invalid argument
5546 * @retval PMINFO_R_ERROR internal error
5547 * @pre pkgmgrinfo_appinfo_filter_create()
5548 * @post pkgmgrinfo_appinfo_filter_destroy()
5549 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5551 static int get_capp_count()
5555 pkgmgrinfo_appinfo_filter_h handle;
5556 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5557 if (ret != PMINFO_R_OK)
5559 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5560 if (ret != PMINFO_R_OK) {
5561 pkgmgrinfo_appinfo_filter_destroy(handle);
5564 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5565 if (ret != PMINFO_R_OK) {
5566 pkgmgrinfo_appinfo_filter_destroy(handle);
5569 printf("No of capp: %d\n", count);
5570 pkgmgrinfo_appinfo_filter_destroy(handle);
5575 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5576 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5578 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5579 * @brief This API creates the application's metadata information filter handle from db.
5581 * @par This API is for package-manager client application
5582 * @par Sync (or) Async : Synchronous API
5584 * @param[out] handle pointer to the application metadata info filter handle.
5585 * @return 0 if success, error code(<0) if fail
5586 * @retval PMINFO_R_OK success
5587 * @retval PMINFO_R_EINVAL invalid argument
5588 * @retval PMINFO_R_ERROR internal error
5590 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5591 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5593 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5596 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5597 printf("appid : %s\n", appid);
5601 static int get_app_list(const char *mkey, const char *mvalue)
5604 pkgmgrinfo_appinfo_metadata_filter_h handle;
5605 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5606 if (ret != PMINFO_R_OK)
5608 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5609 if (ret != PMINFO_R_OK) {
5610 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5613 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5614 if (ret != PMINFO_R_OK) {
5615 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5618 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5623 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5626 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5627 * @brief This API destroys the application's metadata information filter handle.
5629 * @par This API is for package-manager client application
5630 * @par Sync (or) Async : Synchronous API
5632 * @param[in] handle pointer to the application metadata info filter handle.
5633 * @return 0 if success, error code(<0) if fail
5634 * @retval PMINFO_R_OK success
5635 * @retval PMINFO_R_EINVAL invalid argument
5636 * @retval PMINFO_R_ERROR internal error
5637 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5639 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5641 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5644 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5645 printf("appid : %s\n", appid);
5649 static int get_app_list(const char *mkey, const char *mvalue)
5652 pkgmgrinfo_appinfo_metadata_filter_h handle;
5653 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5654 if (ret != PMINFO_R_OK)
5656 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5657 if (ret != PMINFO_R_OK) {
5658 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5661 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5662 if (ret != PMINFO_R_OK) {
5663 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5666 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5671 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5674 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5675 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5676 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5678 * @par This API is for package-manager client application
5679 * @par Sync (or) Async : Synchronous API
5681 * @param[in] handle pointer to the application metadata info filter handle.
5682 * @param[in] key pointer to metadata key
5683 * @param[in] value pointer to metadata value
5684 * @return 0 if success, error code(<0) if fail
5685 * @retval PMINFO_R_OK success
5686 * @retval PMINFO_R_EINVAL invalid argument
5687 * @retval PMINFO_R_ERROR internal error
5688 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5689 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5690 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5692 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5695 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5696 printf("appid : %s\n", appid);
5700 static int get_app_list(const char *mkey, const char *mvalue)
5703 pkgmgrinfo_appinfo_metadata_filter_h handle;
5704 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5705 if (ret != PMINFO_R_OK)
5707 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5708 if (ret != PMINFO_R_OK) {
5709 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5712 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5713 if (ret != PMINFO_R_OK) {
5714 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5717 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5722 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5723 const char *key, const char *value);
5726 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5727 * @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)
5728 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5729 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5730 * negative value, no more callbacks will be called and API will return.
5732 * @par This API is for package-manager client application
5733 * @par Sync (or) Async : Synchronous API
5735 * @param[in] handle pointer to the application metadata info filter handle.
5736 * @param[in] app_cb function pointer to callback
5737 * @param[in] user_data pointer to user data
5738 * @param[in] uid the addressee user id of the instruction
5739 * @return 0 if success, error code(<0) if fail
5740 * @retval PMINFO_R_OK success
5741 * @retval PMINFO_R_EINVAL invalid argument
5742 * @retval PMINFO_R_ERROR internal error
5743 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5744 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5746 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5749 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5750 printf("appid : %s\n", appid);
5754 static int get_app_list(const char *mkey, const char *mvalue)
5757 pkgmgrinfo_appinfo_metadata_filter_h handle;
5758 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5759 if (ret != PMINFO_R_OK)
5761 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5762 if (ret != PMINFO_R_OK) {
5763 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5766 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5767 if (ret != PMINFO_R_OK) {
5768 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5771 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5776 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5777 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5778 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5779 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5781 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5782 * @brief This API creates the package cert information handle to get data from db.
5784 * @par This API is for package-manager client application
5785 * @par Sync (or) Async : Synchronous API
5787 * @param[out] handle pointer to the package cert handle.
5788 * @return 0 if success, error code(<0) if fail
5789 * @retval PMINFO_R_OK success
5790 * @retval PMINFO_R_EINVAL invalid argument
5791 * @retval PMINFO_R_ERROR internal error
5793 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5794 * @see pkgmgrinfo_pkginfo_get_cert_value()
5795 * @see pkgmgrinfo_pkginfo_load_certinfo()
5797 static int get_cert_info(const char *pkgid)
5800 pkgmgrinfo_certinfo_h handle;
5801 char *auth_cert = NULL;
5802 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5803 if (ret != PMINFO_R_OK)
5805 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5806 if (ret != PMINFO_R_OK) {
5807 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5810 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5811 if (ret != PMINFO_R_OK) {
5812 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5815 printf("Author root certificate: %s\n", auth_root);
5816 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5821 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5824 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5825 * @brief This API loads the package cert information handle with data from db.
5827 * @par This API is for package-manager client application
5828 * @par Sync (or) Async : Synchronous API
5830 * @param[in] pkgid pointer to the package ID.
5831 * @param[in] handle pointer to the package cert handle.
5832 * @return 0 if success, error code(<0) if fail
5833 * @retval PMINFO_R_OK success
5834 * @retval PMINFO_R_EINVAL invalid argument
5835 * @retval PMINFO_R_ERROR internal error
5836 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5837 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5838 * @see pkgmgrinfo_pkginfo_get_cert_value()
5840 static int get_cert_info(const char *pkgid)
5843 pkgmgrinfo_certinfo_h handle;
5844 char *auth_cert = NULL;
5845 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5846 if (ret != PMINFO_R_OK)
5848 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5849 if (ret != PMINFO_R_OK) {
5850 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5853 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5854 if (ret != PMINFO_R_OK) {
5855 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5858 printf("Author root certificate: %s\n", auth_root);
5859 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5864 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5867 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5868 * @brief This API gets the package cert information from the handle
5870 * @par This API is for package-manager client application
5871 * @par Sync (or) Async : Synchronous API
5873 * @param[in] handle pointer to the package cert handle.
5874 * @param[in] cert_type certificate type
5875 * @param[out] cert_value pointer to hold certificate value
5876 * @return 0 if success, error code(<0) if fail
5877 * @retval PMINFO_R_OK success
5878 * @retval PMINFO_R_EINVAL invalid argument
5879 * @retval PMINFO_R_ERROR internal error
5880 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5881 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5882 * @see pkgmgrinfo_pkginfo_load_certinfo()
5884 static int get_cert_info(const char *pkgid)
5887 pkgmgrinfo_certinfo_h handle;
5888 char *auth_cert = NULL;
5889 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5890 if (ret != PMINFO_R_OK)
5892 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5893 if (ret != PMINFO_R_OK) {
5894 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5897 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5898 if (ret != PMINFO_R_OK) {
5899 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5902 printf("Author root certificate: %s\n", auth_root);
5903 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5908 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5911 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5912 * @brief This API destroys the package cert information handle freeing up all the resources
5914 * @par This API is for package-manager client application
5915 * @par Sync (or) Async : Synchronous API
5917 * @param[in] handle pointer to the package cert handle.
5918 * @return 0 if success, error code(<0) if fail
5919 * @retval PMINFO_R_OK success
5920 * @retval PMINFO_R_EINVAL invalid argument
5921 * @retval PMINFO_R_ERROR internal error
5922 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5924 * @see pkgmgrinfo_pkginfo_load_certinfo()
5926 static int get_cert_info(const char *pkgid)
5929 pkgmgrinfo_certinfo_h handle;
5930 char *auth_cert = NULL;
5931 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5932 if (ret != PMINFO_R_OK)
5934 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5935 if (ret != PMINFO_R_OK) {
5936 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5939 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5940 if (ret != PMINFO_R_OK) {
5941 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5944 printf("Author root certificate: %s\n", auth_root);
5945 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5950 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5953 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5954 * @brief This API deletes the package cert information from DB
5956 * @par This API is for package-manager client application
5957 * @par Sync (or) Async : Synchronous API
5959 * @param[in] pkgid pointer to the package ID.
5960 * @return 0 if success, error code(<0) if fail
5961 * @retval PMINFO_R_OK success
5962 * @retval PMINFO_R_EINVAL invalid argument
5963 * @retval PMINFO_R_ERROR internal error
5967 static int delete_cert_info(const char *pkgid)
5970 ret = pkgmgrinfo_delete_certinfo(pkgid);
5971 if (ret != PMINFO_R_OK)
5977 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5978 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5981 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5982 * @brief This API creates the package cert information handle to set data in db.
5984 * @par This API is for package-manager client application
5985 * @par Sync (or) Async : Synchronous API
5987 * @param[out] handle pointer to the package cert handle.
5988 * @return 0 if success, error code(<0) if fail
5989 * @retval PMINFO_R_OK success
5990 * @retval PMINFO_R_EINVAL invalid argument
5991 * @retval PMINFO_R_ERROR internal error
5993 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5994 * @see pkgmgrinfo_set_cert_value()
5995 * @see pkgmgrinfo_save_certinfo()
5997 static int set_cert_in_db(const char *pkgid)
6000 pkgmgrinfo_instcertinfo_h handle;
6001 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6002 if (ret != PMINFO_R_OK)
6004 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6005 if (ret != PMINFO_R_OK) {
6006 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6009 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6010 if (ret != PMINFO_R_OK) {
6011 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6014 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6019 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
6022 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
6023 * @brief This API sets the package cert information in the handle.
6025 * @par This API is for package-manager client application
6026 * @par Sync (or) Async : Synchronous API
6028 * @param[in] handle pointer to the package cert handle.
6029 * @param[in] cert_type certificate type.
6030 * @param[in] cert_value certificate value.
6031 * @return 0 if success, error code(<0) if fail
6032 * @retval PMINFO_R_OK success
6033 * @retval PMINFO_R_EINVAL invalid argument
6034 * @retval PMINFO_R_ERROR internal error
6035 * @pre pkgmgrinfo_create_certinfo_set_handle()
6036 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6037 * @see pkgmgrinfo_save_certinfo()
6039 static int set_cert_in_db(const char *pkgid)
6042 pkgmgrinfo_instcertinfo_h handle;
6043 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6044 if (ret != PMINFO_R_OK)
6046 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6047 if (ret != PMINFO_R_OK) {
6048 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6051 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6052 if (ret != PMINFO_R_OK) {
6053 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6056 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6061 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6064 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6065 * @brief This API saves the package cert information in the DB.
6067 * @par This API is for package-manager client application
6068 * @par Sync (or) Async : Synchronous API
6070 * @param[in] pkgid pointer to the package ID.
6071 * @param[in] handle pointer to the package cert handle.
6072 * @return 0 if success, error code(<0) if fail
6073 * @retval PMINFO_R_OK success
6074 * @retval PMINFO_R_EINVAL invalid argument
6075 * @retval PMINFO_R_ERROR internal error
6076 * @pre pkgmgrinfo_create_certinfo_set_handle()
6077 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6078 * @see pkgmgrinfo_save_certinfo()
6080 static int set_cert_in_db(const char *pkgid)
6083 pkgmgrinfo_instcertinfo_h handle;
6084 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6085 if (ret != PMINFO_R_OK)
6087 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6088 if (ret != PMINFO_R_OK) {
6089 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6092 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6093 if (ret != PMINFO_R_OK) {
6094 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6097 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6102 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6105 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6106 * @brief This API destroys the package cert information handle freeing up all the resources.
6108 * @par This API is for package-manager client application
6109 * @par Sync (or) Async : Synchronous API
6111 * @param[in] handle pointer to the package cert handle.
6112 * @return 0 if success, error code(<0) if fail
6113 * @retval PMINFO_R_OK success
6114 * @retval PMINFO_R_EINVAL invalid argument
6115 * @retval PMINFO_R_ERROR internal error
6116 * @pre pkgmgrinfo_create_certinfo_set_handle()
6118 * @see pkgmgrinfo_save_certinfo()
6120 static int set_cert_in_db(const char *pkgid)
6123 pkgmgrinfo_instcertinfo_h handle;
6124 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6125 if (ret != PMINFO_R_OK)
6127 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6128 if (ret != PMINFO_R_OK) {
6129 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6132 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6133 if (ret != PMINFO_R_OK) {
6134 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6137 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6142 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6145 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6146 * @brief This API gets the datacontrol info
6148 * @par This API is for package-manager client application
6149 * @par Sync (or) Async : Synchronous API
6151 * @param[in] providerid pointer to the providerid of dataconltrol.
6152 * @param[in] type pointer to the type of dataconltrol.
6153 * @param[out] appid pointer to hold appid, need to free after using
6154 * @param[out] access pointer to hold access, need to free after using
6155 * @return 0 if success, error code(<0) if fail
6156 * @retval PMINFO_R_OK success
6157 * @retval PMINFO_R_EINVAL invalid argument
6158 * @retval PMINFO_R_ERROR internal error
6161 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6164 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6165 * @brief This API gets the application 'guest mode visibility' value from the DB
6167 * @par This API is for package-manager client application
6168 * @par Sync (or) Async : Synchronous API
6170 * @param[in] handle pointer to application info handle
6171 * @param[out] status pointer to hold app guest mode visibility value
6172 * @return 0 if success, error code(<0) if fail
6173 * @retval PMINFO_R_OK success
6174 * @retval PMINFO_R_EINVAL invalid argument
6175 * @retval PMINFO_R_ERROR internal error
6176 * @pre pkgmgrinfo_appinfo_get_appinfo()
6177 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6178 * @see pkgmgrinfo_appinfo_get_appid()
6179 * @see pkgmgrinfo_appinfo_is_multiple()
6181 static int get_app_guestmode_visibility(const char *appid)
6185 pkgmgrinfo_appinfo_h handle;
6186 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6187 if (ret != PMINFO_R_OK)
6189 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6190 if (ret != PMINFO_R_OK) {
6191 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6194 printf("app guest mode visibility: %d\n", status);
6195 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6200 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6203 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6204 * @brief This API sets the package 'installed_storage' value in db
6206 * @par This API is for package-manager client application
6207 * @par Sync (or) Async : Synchronous API
6209 * @param[in] pkgid pointer to the package ID.
6210 * @param[in] location package install location
6211 * @param[in] external_pkg_path image path if pkg has installed at external storage
6212 * @return 0 if success, error code(<0) if fail
6213 * @retval PMINFO_R_OK success
6214 * @retval PMINFO_R_EINVAL invalid argument
6215 * @retval PMINFO_R_ERROR internal error
6217 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6221 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6222 if (ret != PMINFO_R_OK) {
6229 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6230 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6232 /* version compare */
6233 int pkgmgrinfo_compare_package_version(const char *current_version,
6234 const char *target_version, pkgmgrinfo_version_compare_type *res);
6241 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6242 int flag, void *user_data, uid_t uid);
6243 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6244 int flag, void *user_data);
6245 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6246 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6248 int pkgmgrinfo_appinfo_get_installed_list_full(
6249 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6252 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6253 pkgmgrinfo_archiveinfo_h *handle);
6254 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6255 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6256 const char **pkgid);
6257 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6259 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6260 const char **version);
6261 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6262 const char **api_version);
6263 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6264 const char **description);
6265 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6266 const char **label);
6267 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6268 const char **author);
6269 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6270 const unsigned char **icon, size_t *size);
6273 * @pkgmgrinfo client API end
6281 #endif /* __PKG_INFO_H__ */