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_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
117 /** Integer property for filtering based on package info*/
118 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_PRIVILEGE "PMINFO_APPINFO_PROP_PRIVILEGE"
149 /** Integer property for filtering app support mode */
150 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
175 /** will be updated*/
176 /** string property for filtering based on pkg info*/
177 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
179 /* For multiuser support */
180 const char *getIconPath(uid_t uid, bool readonly);
181 char *getUserPkgParserDBPath(void);
182 char *getUserPkgParserDBPathUID(uid_t uid);
183 char *getUserPkgCertDBPath(void);
184 char *getUserPkgCertDBPathUID(uid_t uid);
185 const char *getUserManifestPath(uid_t uid, bool readonly);
188 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
189 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
190 * @brief This API gets list of installed packages
192 * @par This API is for package-manager client application
193 * @par Sync (or) Async : Synchronous API
194 * @param[in] pkg_list_cb iteration function for list
195 * @param[in] user_data user data to be passed to callback function
196 * @param[in] uid the addressee user id of the instruction
197 * @return 0 if success, error code(<0) if fail
198 * @retval PMINFO_R_OK success
199 * @retval PMINFO_R_EINVAL invalid argument
200 * @retval PMINFO_R_ERROR internal error
204 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
208 pkgid1 = (char *)user_data;
209 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
210 if (strcmp(pkgid1, pkgid2) == 0) {
217 static int list_pkgs()
220 char *name = "helloworld";
221 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
222 if (ret != PMINFO_R_OK) {
229 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
230 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
233 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
234 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
235 * @brief This API gets list of disabled packages
237 * @par This API is for package-manager client application
238 * @par Sync (or) Async : Synchronous API
239 * @param[in] pkg_list_cb iteration function for list
240 * @param[in] user_data user data to be passed to callback function
241 * @param[in] uid the addressee user id of the instruction
242 * @return 0 if success, error code(<0) if fail
243 * @retval PMINFO_R_OK success
244 * @retval PMINFO_R_EINVAL invalid argument
245 * @retval PMINFO_R_ERROR internal error
249 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
250 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
253 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
254 * @brief This API creates the package information handle from db which is not disabled
256 * @par This API is for package-manager client application
257 * @par Sync (or) Async : Synchronous API
259 * @param[in] pkgid pointer to package ID
260 * @param[in] uid the addressee user id of the instruction
261 * @param[out] handle pointer to the package info handle.
262 * @return 0 if success, error code(<0) if fail
263 * @retval PMINFO_R_OK success
264 * @retval PMINFO_R_EINVAL invalid argument
265 * @retval PMINFO_R_ERROR internal error
267 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
268 * @see pkgmgrinfo_pkginfo_get_pkgid()
269 * @see pkgmgrinfo_pkginfo_is_removable()
271 static int get_pkg_type(const char *pkgid)
275 pkgmgrinfo_pkginfo_h handle;
276 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
277 if (ret != PMINFO_R_OK)
279 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
280 if (ret != PMINFO_R_OK) {
281 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
284 printf("pkgtype: %s\n", type);
285 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
290 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
291 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
294 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
295 * @brief This API creates the disabled package information handle from db
297 * @par This API is for package-manager client application
298 * @par Sync (or) Async : Synchronous API
300 * @param[in] pkgid pointer to package ID
301 * @param[in] uid the addressee user id of the instruction
302 * @param[out] handle pointer to the package info handle.
303 * @return 0 if success, error code(<0) if fail
304 * @retval PMINFO_R_OK success
305 * @retval PMINFO_R_EINVAL invalid argument
306 * @retval PMINFO_R_ERROR internal error
308 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
309 * @see pkgmgrinfo_pkginfo_get_pkginfo()
311 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
312 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
315 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
316 * @brief This API creates the package information handle from db regardless of its disable or storage status
318 * @par This API is for package-manager client application
319 * @par Sync (or) Async : Synchronous API
321 * @param[in] pkgid pointer to package ID
322 * @param[in] uid the addressee user id of the instruction
323 * @param[out] handle pointer to the package info handle.
324 * @return 0 if success, error code(<0) if fail
325 * @retval PMINFO_R_OK success
326 * @retval PMINFO_R_EINVAL invalid argument
327 * @retval PMINFO_R_ERROR internal error
329 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
330 * @see pkgmgrinfo_pkginfo_get_pkgid()
331 * @see pkgmgrinfo_pkginfo_is_removable()
333 static int get_pkg_type(const char *pkgid)
337 pkgmgrinfo_pkginfo_h handle;
338 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
339 if (ret != PMINFO_R_OK)
341 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
342 if (ret != PMINFO_R_OK) {
343 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
346 printf("pkgtype: %s\n", type);
347 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
352 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
353 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
356 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
357 * @brief This API gets the package name from the package ID
359 * @par This API is for package-manager client application
360 * @par Sync (or) Async : Synchronous API
362 * @param[in] handle pointer to package info handle
363 * @param[out] pkg_name pointer to hold package name
364 * @return 0 if success, error code(<0) if fail
365 * @retval PMINFO_R_OK success
366 * @retval PMINFO_R_EINVAL invalid argument
367 * @retval PMINFO_R_ERROR internal error
368 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
369 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
370 * @see pkgmgrinfo_pkginfo_get_type()
371 * @see pkgmgrinfo_pkginfo_is_removable()
373 static int get_pkg_name(const char *pkgid)
376 char *pkgname = NULL;
377 pkgmgrinfo_pkginfo_h handle;
378 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
379 if (ret != PMINFO_R_OK)
381 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
382 if (ret != PMINFO_R_OK) {
383 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
386 printf("pkgname: %s\n", pkgname);
387 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
392 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
395 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
396 * @brief This API gets the package id from the package ID
398 * @par This API is for package-manager client application
399 * @par Sync (or) Async : Synchronous API
401 * @param[in] handle pointer to package info handle
402 * @param[out] pkgid pointer to hold package id
403 * @return 0 if success, error code(<0) if fail
404 * @retval PMINFO_R_OK success
405 * @retval PMINFO_R_EINVAL invalid argument
406 * @retval PMINFO_R_ERROR internal error
407 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
408 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
409 * @see pkgmgrinfo_pkginfo_get_type()
410 * @see pkgmgrinfo_pkginfo_is_removable()
412 static int get_pkgid(const char *pkgid)
416 pkgmgrinfo_pkginfo_h handle;
417 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
418 if (ret != PMINFO_R_OK)
420 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
421 if (ret != PMINFO_R_OK) {
422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
425 printf("pkg id: %s\n", pkg_id);
426 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
431 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
434 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
435 * @brief This API gets the package type from the package ID
437 * @par This API is for package-manager client application
438 * @par Sync (or) Async : Synchronous API
440 * @param[in] handle pointer to package info handle
441 * @param[out] type pointer to hold package type
442 * @return 0 if success, error code(<0) if fail
443 * @retval PMINFO_R_OK success
444 * @retval PMINFO_R_EINVAL invalid argument
445 * @retval PMINFO_R_ERROR internal error
446 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
447 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
448 * @see pkgmgrinfo_pkginfo_get_pkgid()
449 * @see pkgmgrinfo_pkginfo_is_removable()
451 static int get_pkg_type(const char *pkgid)
455 pkgmgrinfo_pkginfo_h handle;
456 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
457 if (ret != PMINFO_R_OK)
459 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
460 if (ret != PMINFO_R_OK) {
461 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
464 printf("pkgtype: %s\n", type);
465 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
470 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
473 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
474 * @brief This API gets the package version from the package ID
476 * @par This API is for package-manager client application
477 * @par Sync (or) Async : Synchronous API
479 * @param[in] handle pointer to package info handle
480 * @param[out] version pointer to hold package version
481 * @return 0 if success, error code(<0) if fail
482 * @retval PMINFO_R_OK success
483 * @retval PMINFO_R_EINVAL invalid argument
484 * @retval PMINFO_R_ERROR internal error
485 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
486 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
487 * @see pkgmgrinfo_pkginfo_get_pkgid()
488 * @see pkgmgrinfo_pkginfo_is_removable()
490 static int get_pkg_version(const char *pkgid)
493 char *version = NULL;
494 pkgmgrinfo_pkginfo_h handle;
495 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
496 if (ret != PMINFO_R_OK)
498 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
499 if (ret != PMINFO_R_OK) {
500 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
503 printf("pkg version: %s\n", version);
504 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
509 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
512 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
513 * @brief This API gets the package api_version from the package ID
515 * @par This API is for package-manager client application
516 * @par Sync (or) Async : Synchronous API
518 * @param[in] handle pointer to package info handle
519 * @param[out] api_version pointer to hold package api_version
520 * @return 0 if success, error code(<0) if fail
521 * @retval PMINFO_R_OK success
522 * @retval PMINFO_R_EINVAL invalid argument
523 * @retval PMINFO_R_ERROR internal error
524 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
525 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
526 * @see pkgmgrinfo_pkginfo_get_pkgid()
527 * @see pkgmgrinfo_pkginfo_is_removable()
529 static int get_pkg_api_version(const char *pkgid)
532 char *api_version = NULL;
533 pkgmgrinfo_pkginfo_h handle = NULL;
534 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
535 if (ret != PMINFO_R_OK)
537 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
538 if (ret != PMINFO_R_OK) {
539 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
542 printf("pkg api_version: %s\n", api_version);
543 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
548 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
551 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
552 * @brief This API gets tep(tizen expansion package) file name associated with the package
554 * @par This API is for package-manager client application
555 * @par Sync (or) Async : Synchronous API
557 * @param[in] handle pointer to the pkginfo handle.
558 * @param[out] tep_name pointer to hold tep name
559 * @return 0 if success, error code(<0) if fail
560 * @retval PMINFO_R_OK success
561 * @retval PMINFO_R_EINVAL invalid argument
562 * @retval PMINFO_R_ERROR internal error
563 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
564 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
565 * @see pkgmgrinfo_pkginfo_get_pkgid()
567 static int get_tep_name(const char *pkgid)
570 char *tep_name = NULL;
571 pkgmgrinfo_pkginfo_h handle = NULL;
572 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
573 if (ret != PMINFO_R_OK)
575 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
576 if (ret != PMINFO_R_OK) {
577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
580 printf("TEP name is: %s\n", tep_name);
581 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
586 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
589 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
590 * @brief This API gets package mount point path associated with the package
591 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
593 * @par This API is for package-manager client application
594 * @par Sync (or) Async : Synchronous API
596 * @param[in] handle pointer to the pkginfo handle.
597 * @param[out] zip_mount_file pointer to hold zip mount file
598 * @return 0 if success, error code(<0) if fail
599 * @retval PMINFO_R_OK success
600 * @retval PMINFO_R_EINVAL invalid argument
601 * @retval PMINFO_R_ERROR internal error
602 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
603 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
604 * @see pkgmgrinfo_pkginfo_get_pkgid()
606 static int get_zip_mount_file(const char *pkgid)
609 char *zip_mount_file = NULL;
610 pkgmgrinfo_pkginfo_h handle = NULL;
611 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
612 if (ret != PMINFO_R_OK)
614 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
615 if (ret != PMINFO_R_OK) {
616 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
619 if (zip_mount_file != NULL)
620 printf("Zip mount path is: %s\n", zip_mount_file);
621 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
626 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
629 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
630 * @brief This API gets package external image path associated with the package
631 * if package is installed in external storage.
632 * Otherwise, the return value will be PMINFO_R_ENOENT.
634 * @par This API is for package-manager client application
635 * @par Sync (or) Async : Synchronous API
637 * @param[in] handle pointer to the pkginfo handle.
638 * @param[out] ext_image_path pointer to hold external image path
639 * @return 0 if success, error code(<0) if fail
640 * @retval PMINFO_R_OK success
641 * @retval PMINFO_R_EINVAL invalid argument
642 * @retval PMINFO_R_ERROR internal error
643 * @revall PMINFO_R_ENOENT no valid data
644 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
645 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
646 * @see pkgmgrinfo_pkginfo_get_pkgid()
648 static int get_external_image_path(const char *pkgid)
651 char *ext_image_path = NULL;
652 pkgmgrinfo_pkginfo_h handle = NULL;
653 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
654 if (ret != PMINFO_R_OK)
656 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
657 if (ret != PMINFO_R_OK) {
658 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
661 printf("external image path is: %s\n", ext_image_path);
662 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
667 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
670 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
671 * @brief This API gets the package install location from the package ID
673 * @par This API is for package-manager client application
674 * @par Sync (or) Async : Synchronous API
676 * @param[in] handle pointer to package info handle
677 * @param[out] location pointer to hold package install location
678 * @return 0 if success, error code(<0) if fail
679 * @retval PMINFO_R_OK success
680 * @retval PMINFO_R_EINVAL invalid argument
681 * @retval PMINFO_R_ERROR internal error
682 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
683 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
684 * @see pkgmgrinfo_pkginfo_get_pkgid()
685 * @see pkgmgrinfo_pkginfo_is_removable()
687 static int get_pkg_install_location(const char *pkgid)
690 pkgmgrinfo_install_location location;
691 pkgmgrinfo_pkginfo_h handle;
692 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
693 if (ret != PMINFO_R_OK)
695 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
696 if (ret != PMINFO_R_OK) {
697 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
700 printf("pkg install location: %d\n", location);
701 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
706 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
709 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
710 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
711 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
712 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
714 * @par This API is for package-manager client application
715 * @par Sync (or) Async : Synchronous API
717 * @param[in] handle pointer to package info handle
718 * @param[out] size pointer to hold package size
719 * @return 0 if success, error code(<0) if fail
720 * @retval PMINFO_R_OK success
721 * @retval PMINFO_R_EINVAL invalid argument
722 * @retval PMINFO_R_ERROR internal error
723 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
724 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
725 * @see pkgmgrinfo_pkginfo_get_pkgid()
726 * @see pkgmgrinfo_pkginfo_is_removable()
728 static int get_pkg_size(const char *pkgid)
732 pkgmgrinfo_pkginfo_h handle;
733 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
734 if (ret != PMINFO_R_OK)
736 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
737 if (ret != PMINFO_R_OK) {
738 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
741 printf("pkgsize: %d\n", size);
742 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
747 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
750 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
751 * @brief This API gets the package icon from the package ID
753 * @par This API is for package-manager client application
754 * @par Sync (or) Async : Synchronous API
756 * @param[in] handle pointer to package info handle
757 * @param[out] icon pointer to hold package icon
758 * @return 0 if success, error code(<0) if fail
759 * @retval PMINFO_R_OK success
760 * @retval PMINFO_R_EINVAL invalid argument
761 * @retval PMINFO_R_ERROR internal error
762 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
763 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
764 * @see pkgmgrinfo_pkginfo_get_pkgid()
765 * @see pkgmgrinfo_pkginfo_is_removable()
767 static int get_pkg_icon(const char *pkgid)
771 pkgmgrinfo_pkginfo_h handle;
772 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
773 if (ret != PMINFO_R_OK)
775 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
776 if (ret != PMINFO_R_OK) {
777 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
780 printf("pkg icon: %s\n", icon);
781 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
786 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
789 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
790 * @brief This API gets the package label from the package ID
792 * @par This API is for package-manager client application
793 * @par Sync (or) Async : Synchronous API
795 * @param[in] handle pointer to package info handle
796 * @param[out] label pointer to hold package label
797 * @return 0 if success, error code(<0) if fail
798 * @retval PMINFO_R_OK success
799 * @retval PMINFO_R_EINVAL invalid argument
800 * @retval PMINFO_R_ERROR internal error
801 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
802 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
803 * @see pkgmgrinfo_pkginfo_get_pkgid()
804 * @see pkgmgrinfo_pkginfo_is_removable()
806 static int get_pkg_label(const char *pkgid)
810 pkgmgrinfo_pkginfo_h handle;
811 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
812 if (ret != PMINFO_R_OK)
814 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
815 if (ret != PMINFO_R_OK) {
816 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
819 printf("pkg label: %s\n", label);
820 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
825 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
828 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
829 * @brief This API gets the package description from the package ID
831 * @par This API is for package-manager client application
832 * @par Sync (or) Async : Synchronous API
834 * @param[in] handle pointer to package info handle
835 * @param[out] description pointer to hold package description
836 * @return 0 if success, error code(<0) if fail
837 * @retval PMINFO_R_OK success
838 * @retval PMINFO_R_EINVAL invalid argument
839 * @retval PMINFO_R_ERROR internal error
840 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
841 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
842 * @see pkgmgrinfo_pkginfo_get_pkgid()
843 * @see pkgmgrinfo_pkginfo_is_removable()
845 static int get_pkg_description(const char *pkgid)
848 char *description = NULL;
849 pkgmgrinfo_pkginfo_h handle;
850 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
851 if (ret != PMINFO_R_OK)
853 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
854 if (ret != PMINFO_R_OK) {
855 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
858 printf("pkg description: %s\n", description);
859 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
864 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
867 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
868 * @brief This API gets the package's author name from the package ID
870 * @par This API is for package-manager client application
871 * @par Sync (or) Async : Synchronous API
873 * @param[in] handle pointer to package info handle
874 * @param[out] author_name pointer to hold package author name
875 * @return 0 if success, error code(<0) if fail
876 * @retval PMINFO_R_OK success
877 * @retval PMINFO_R_EINVAL invalid argument
878 * @retval PMINFO_R_ERROR internal error
879 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
880 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
881 * @see pkgmgrinfo_pkginfo_get_pkgid()
882 * @see pkgmgrinfo_pkginfo_is_removable()
884 static int get_pkg_author_name(const char *pkgid)
887 char *author_name = NULL;
888 pkgmgrinfo_pkginfo_h handle;
889 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
890 if (ret != PMINFO_R_OK)
892 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
893 if (ret != PMINFO_R_OK) {
894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
897 printf("pkg author name: %s\n", author_name);
898 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
903 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
906 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
907 * @brief This API gets the package's author email from the package ID
909 * @par This API is for package-manager client application
910 * @par Sync (or) Async : Synchronous API
912 * @param[in] handle pointer to package info handle
913 * @param[out] author_email pointer to hold package author email
914 * @return 0 if success, error code(<0) if fail
915 * @retval PMINFO_R_OK success
916 * @retval PMINFO_R_EINVAL invalid argument
917 * @retval PMINFO_R_ERROR internal error
918 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
919 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
920 * @see pkgmgrinfo_pkginfo_get_pkgid()
921 * @see pkgmgrinfo_pkginfo_is_removable()
923 static int get_pkg_author_email(const char *pkgid)
926 char *author_email = NULL;
927 pkgmgrinfo_pkginfo_h handle;
928 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
929 if (ret != PMINFO_R_OK)
931 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
932 if (ret != PMINFO_R_OK) {
933 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
936 printf("pkg author email: %s\n", author_email);
937 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
942 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
945 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
946 * @brief This API gets the package's author href from the package ID
948 * @par This API is for package-manager client application
949 * @par Sync (or) Async : Synchronous API
951 * @param[in] handle pointer to package info handle
952 * @param[out] author_href pointer to hold package author href
953 * @return 0 if success, error code(<0) if fail
954 * @retval PMINFO_R_OK success
955 * @retval PMINFO_R_EINVAL invalid argument
956 * @retval PMINFO_R_ERROR internal error
957 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
958 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
959 * @see pkgmgrinfo_pkginfo_get_pkgid()
960 * @see pkgmgrinfo_pkginfo_is_removable()
962 static int get_pkg_author_href(const char *pkgid)
965 char *author_href = NULL;
966 pkgmgrinfo_pkginfo_h handle;
967 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
968 if (ret != PMINFO_R_OK)
970 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
971 if (ret != PMINFO_R_OK) {
972 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
975 printf("pkg author href: %s\n", author_href);
976 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
981 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
984 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
985 * @brief This API gets the package installed storagae value from the package ID
987 * @par This API is for package-manager client application
988 * @par Sync (or) Async : Synchronous API
990 * @param[in] handle pointer to package info handle
991 * @param[out] storage pointer to hold package installed storage
992 * @return 0 if success, error code(<0) if fail
993 * @retval PMINFO_R_OK success
994 * @retval PMINFO_R_EINVAL invalid argument
995 * @retval PMINFO_R_ERROR internal error
996 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
997 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
998 * @see pkgmgrinfo_pkginfo_get_pkgid()
999 * @see pkgmgrinfo_pkginfo_is_removable()
1001 static int get_pkg_installed_storage(const char *pkgid)
1004 pkgmgrinfo_installed_storage storage;
1005 pkgmgrinfo_pkginfo_h handle;
1006 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1007 if (ret != PMINFO_R_OK)
1009 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1010 if (ret != PMINFO_R_OK) {
1011 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1014 printf("pkg installed storage: %d\n", storage);
1015 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1020 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1023 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1024 * @brief This API gets the installed time of package from the package ID
1026 * @par This API is for package-manager client application
1027 * @par Sync (or) Async : Synchronous API
1029 * @param[in] handle pointer to package info handle
1030 * @param[out] installed_time pointer to hold installed time of package
1031 * @return 0 if success, error code(<0) if fail
1032 * @retval PMINFO_R_OK success
1033 * @retval PMINFO_R_EINVAL invalid argument
1034 * @retval PMINFO_R_ERROR internal error
1035 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1036 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1037 * @see pkgmgrinfo_pkginfo_get_pkgid()
1038 * @see pkgmgrinfo_pkginfo_is_removable()
1040 static int get_pkg_installed_time(const char *pkgid)
1043 int installed_time = 0;
1044 pkgmgrinfo_pkginfo_h handle;
1045 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1046 if (ret != PMINFO_R_OK)
1048 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1049 if (ret != PMINFO_R_OK) {
1050 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1053 printf("installed_time: %d\n", installed_time);
1054 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1059 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1062 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1063 * @brief This API creates the update info handle
1065 * @par This API is for package-manager client application
1066 * @par Sync (or) Async : Synchronous API
1068 * @param[out] handle pointer to package update info handle
1069 * @return 0 if success, error code(<0) if fail
1070 * @retval PMINFO_R_OK success
1071 * @retval PMINFO_R_EINVAL invalid argument
1072 * @retval PMINFO_R_ERROR internal error
1073 * @post pkgmgrinfo_updateinfo_destroy()
1074 * @see pkgmgrinfo_updateinfo_set_pkgid()
1075 * @see pkgmgrinfo_updateinfo_set_version()
1076 * @see pkgmgrinfo_updateinfo_set_type()
1077 * @see pkgmgr_client_register_pkg_updateinfo()
1079 static int updateinfo_handle_create()
1083 pkgmgrinfo_updateinfo_h handle;
1084 ret = pkgmgrinfo_updateinfo_create(&handle);
1085 if (ret != PMINFO_R_OK)
1087 pkgmgrinfo_update_infodestroy(handle);
1092 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1095 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1096 * @brief This API destroy the update info handle
1098 * @par This API is for package-manager client application
1099 * @par Sync (or) Async : Synchronous API
1101 * @param[in] handle pointer to package update info handle
1102 * @return 0 if success, error code(<0) if fail
1103 * @retval PMINFO_R_OK success
1104 * @retval PMINFO_R_EINVAL invalid argument
1105 * @pre pkgmgrinfo_updateinfo_create()
1106 * @see pkgmgr_client_register_pkg_updateinfo()
1108 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1112 ret = pkgmgrinfo_updateinfo_destroy(handle);
1113 if (ret != PMINFO_R_OK)
1119 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1122 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1123 * @brief This API creates the package update information handle from db
1125 * @par This API is for package-manager client application
1126 * @par Sync (or) Async : Synchronous API
1128 * @param[in] pkgid pointer to package ID
1129 * @param[in] uid the addressee user id of the instruction
1130 * @param[out] update_handle pointer to the package update info handle.
1131 * @return 0 if success, error code(<0) if fail
1132 * @retval PMINFO_R_OK success
1133 * @retval PMINFO_R_EINVAL invalid argument
1134 * @retval PMINFO_R_ERROR internal error
1136 * @post pkgmgrinfo_updateinfo_destroy()
1137 * @see pkgmgrinfo_updateinfo_get_pkgid()
1138 * @see pkgmgrinfo_updateinfo_get_version()
1139 * @see pkgmgrinfo_updateinfo_get_update_type()
1141 static int get_pkg_update_info(const char *pkgid)
1145 pkgmgrinfo_updateinfo_h handle;
1146 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1147 if (ret != PMINFO_R_OK)
1149 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1150 if (ret != PMINFO_R_OK) {
1151 pkgmgrinfo_updateinfo_destroy(handle);
1154 printf("pkg update version: %s\n", version
1155 pkgmgrinfo_updateinfo_destroy(handle);
1160 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1161 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1164 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1165 * @brief This API sets given pkgid into handle
1167 * @par This API is for package-manager client application
1168 * @par Sync (or) Async : Synchronous API
1170 * @param[in] handle pointer to package update info handle
1171 * @param[in] pkgid package id
1172 * @return 0 if success, error code(<0) if fail
1173 * @retval PMINFO_R_OK success
1174 * @retval PMINFO_R_EINVAL invalid argument
1175 * @retval PMINFO_R_ERROR internal error
1177 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1181 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1182 if (ret != PMINFO_R_OK)
1188 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1191 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1192 * @brief This API sets given version into handle
1194 * @par This API is for package-manager client application
1195 * @par Sync (or) Async : Synchronous API
1197 * @param[in] handle pointer to package update info handle
1198 * @param[in] version update version
1199 * @return 0 if success, error code(<0) if fail
1200 * @retval PMINFO_R_OK success
1201 * @retval PMINFO_R_EINVAL invalid argument
1202 * @retval PMINFO_R_ERROR internal error
1204 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1208 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1209 if (ret != PMINFO_R_OK)
1215 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1218 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1219 * @brief This API sets given update type into handle
1221 * @par This API is for package-manager client application
1222 * @par Sync (or) Async : Synchronous API
1224 * @param[in] handle pointer to package update info handle
1225 * @param[in] type update type
1226 * @return 0 if success, error code(<0) if fail
1227 * @retval PMINFO_R_OK success
1228 * @retval PMINFO_R_EINVAL invalid argument
1229 * @retval PMINFO_R_ERROR internal error
1231 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1235 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1236 if (ret != PMINFO_R_OK)
1242 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1245 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1246 * @brief This API retrieves the pkgid from given update info
1248 * @par This API is for package-manager client application
1249 * @par Sync (or) Async : Synchronous API
1251 * @param[in] handle pointer to package update info handle
1252 * @param[out] pkgid package id
1253 * @return 0 if success, error code(<0) if fail
1254 * @retval PMINFO_R_OK success
1255 * @retval PMINFO_R_EINVAL invalid argument
1256 * @retval PMINFO_R_ERROR internal error
1258 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1263 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1264 if (ret != PMINFO_R_OK)
1270 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1273 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1274 * @brief This API retrieves the version from given update info
1276 * @par This API is for package-manager client application
1277 * @par Sync (or) Async : Synchronous API
1279 * @param[in] handle pointer to package update info handle
1280 * @param[out] version update version
1281 * @return 0 if success, error code(<0) if fail
1282 * @retval PMINFO_R_OK success
1283 * @retval PMINFO_R_EINVAL invalid argument
1284 * @retval PMINFO_R_ERROR internal error
1286 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1291 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1292 if (ret != PMINFO_R_OK)
1298 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1301 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1302 * @brief This API retrieves the update type from given update info
1304 * @par This API is for package-manager client application
1305 * @par Sync (or) Async : Synchronous API
1307 * @param[in] handle pointer to package update info handle
1308 * @param[out] type update type
1309 * @return 0 if success, error code(<0) if fail
1310 * @retval PMINFO_R_OK success
1311 * @retval PMINFO_R_EINVAL invalid argument
1312 * @retval PMINFO_R_ERROR internal error
1314 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1317 pkgmgrinfo_updateinfo_update_type *type;
1319 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1320 if (ret != PMINFO_R_OK)
1326 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1330 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1331 * @brief This API retrieve the update informations and invoke given callback for it.
1333 * @par This API is for package-manager client application
1334 * @par Sync (or) Async : Synchronous API
1336 * @param[in] callback callback to be invoked for each retrieved informations
1337 * @param[in] user_data user data to be passed to callback
1338 * @return 0 if success, error code(<0) if fail
1339 * @retval PMINFO_R_OK success
1340 * @retval PMINFO_R_EINVAL invalid argument
1341 * @retval PMINFO_R_ERROR internal error
1343 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1347 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1348 if (ret != PMINFO_R_OK)
1354 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1355 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1358 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1359 * @brief This API gets the launch mode of package from the package ID
1361 * @par This API is for package-manager client application
1362 * @par Sync (or) Async : Synchronous API
1364 * @param[in] handle pointer to package info handle
1365 * @param[out] mode pointer to hold launch mode of package
1366 * @return 0 if success, error code(<0) if fail
1367 * @retval PMINFO_R_OK success
1368 * @retval PMINFO_R_EINVAL invalid argument
1369 * @retval PMINFO_R_ERROR internal error
1370 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1371 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1372 * @see pkgmgrinfo_pkginfo_get_pkgid()
1373 * @see pkgmgrinfo_pkginfo_is_removable()
1375 static int get_pkg_launch_mode(const char *pkgid)
1378 char *launch_mode = NULL;
1379 pkgmgrinfo_pkginfo_h handle;
1380 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1381 if (ret != PMINFO_R_OK)
1383 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1384 if (ret != PMINFO_R_OK) {
1385 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1388 printf("launch mode: %s\n", mode);
1389 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1394 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1397 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1398 * @brief This API gets the store client id of package from the package ID
1400 * @par This API is for package-manager client application
1401 * @par Sync (or) Async : Synchronous API
1403 * @param[in] handle pointer to package info handle
1404 * @param[out] storeclientid pointer to hold store client id of package
1405 * @return 0 if success, error code(<0) if fail
1406 * @retval PMINFO_R_OK success
1407 * @retval PMINFO_R_EINVAL invalid argument
1408 * @retval PMINFO_R_ERROR internal error
1409 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1410 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1411 * @see pkgmgrinfo_pkginfo_get_pkgid()
1412 * @see pkgmgrinfo_pkginfo_is_removable()
1414 static int get_pkg_storeclientid(const char *pkgid)
1417 char *storeclientid = 0;
1418 pkgmgrinfo_pkginfo_h handle;
1419 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1420 if (ret != PMINFO_R_OK)
1422 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1423 if (ret != PMINFO_R_OK) {
1424 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1427 printf(store client id: %s\n", storeclientid);
1428 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1433 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1436 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1437 * @brief This API gets the main app id of package from the package ID
1439 * @par This API is for package-manager client application
1440 * @par Sync (or) Async : Synchronous API
1442 * @param[in] handle pointer to package info handle
1443 * @param[out] mainappid pointer to hold main app id of package
1444 * @return 0 if success, error code(<0) if fail
1445 * @retval PMINFO_R_OK success
1446 * @retval PMINFO_R_EINVAL invalid argument
1447 * @retval PMINFO_R_ERROR internal error
1448 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1449 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1450 * @see pkgmgrinfo_pkginfo_get_pkgid()
1451 * @see pkgmgrinfo_pkginfo_is_removable()
1453 static int get_pkg_mainappid(const char *pkgid)
1456 char *mainappid = 0;
1457 pkgmgrinfo_pkginfo_h handle;
1458 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1459 if (ret != PMINFO_R_OK)
1461 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1462 if (ret != PMINFO_R_OK) {
1463 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1466 printf(main app id: %s\n", mainappid);
1467 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1472 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1475 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1476 * @brief This API gets the url of package from the package ID
1478 * @par This API is for package-manager client application
1479 * @par Sync (or) Async : Synchronous API
1481 * @param[in] handle pointer to package info handle
1482 * @param[out] url pointer to hold url of package
1483 * @return 0 if success, error code(<0) if fail
1484 * @retval PMINFO_R_OK success
1485 * @retval PMINFO_R_EINVAL invalid argument
1486 * @retval PMINFO_R_ERROR internal error
1487 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1488 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1489 * @see pkgmgrinfo_pkginfo_get_pkgid()
1490 * @see pkgmgrinfo_pkginfo_is_removable()
1492 static int get_pkg_url(const char *pkgid)
1496 pkgmgrinfo_pkginfo_h handle;
1497 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1498 if (ret != PMINFO_R_OK)
1500 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1501 if (ret != PMINFO_R_OK) {
1502 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1505 printf("url : %s\n", url);
1506 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1511 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1514 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1515 * @brief This API gets the root path of package
1517 * @par Sync (or) Async : Synchronous API
1519 * @param[in] handle pointer to package info handle
1520 * @param[out] path pointer to hold root path of package
1521 * @return 0 if success, error code(<0) if fail
1522 * @retval PMINFO_R_OK success
1523 * @retval PMINFO_R_EINVAL invalid argument
1524 * @retval PMINFO_R_ERROR internal error
1526 static int get_root_path(const char *pkgid)
1530 pkgmgrinfo_pkginfo_h handle;
1531 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1532 if (ret != PMINFO_R_OK)
1535 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1536 if (ret != PMINFO_R_OK) {
1537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1540 printf("path : %s\n", path);
1541 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1547 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1551 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1552 * @brief This API gets the csc path of package
1554 * @par Sync (or) Async : Synchronous API
1556 * @param[in] handle pointer to package info handle
1557 * @param[out] path pointer to hold csc path of package
1558 * @return 0 if success, error code(<0) if fail
1559 * @retval PMINFO_R_OK success
1560 * @retval PMINFO_R_EINVAL invalid argument
1561 * @retval PMINFO_R_ERROR internal error
1563 static int get_csc_path(const char *pkgid)
1567 pkgmgrinfo_pkginfo_h handle;
1568 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1569 if (ret != PMINFO_R_OK)
1572 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1573 if (ret != PMINFO_R_OK) {
1574 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1577 printf("path : %s\n", path);
1578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1584 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1587 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1588 * @brief This API gets the support_mode of package
1590 * @par Sync (or) Async : Synchronous API
1592 * @param[in] handle pointer to package info handle
1593 * @param[out] support_mode pointer to hold support_mode of package
1594 * @return 0 if success, error code(<0) if fail
1595 * @retval PMINFO_R_OK success
1596 * @retval PMINFO_R_EINVAL invalid argument
1597 * @retval PMINFO_R_ERROR internal error
1599 static int get_support_mode(const char *pkgid)
1602 int support_mode = 0;
1603 pkgmgrinfo_pkginfo_h handle = NULL;
1604 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1605 if (ret != PMINFO_R_OK)
1608 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1609 if (ret != PMINFO_R_OK) {
1610 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 printf("support_mode : %s\n", support_mode);
1614 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1620 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1623 * @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)
1624 * @brief This API compare the cert information from given package id
1626 * @par This API is for package-manager client application
1627 * @par Sync (or) Async : Synchronous API
1629 * @param[in] lhs_package_id pointer to first package ID
1630 * @param[in] rhs_package_id pointer to second package ID
1631 * @param[out] compare_result pointer to the compare result.
1632 * @return 0 if success, error code(<0) if fail
1633 * @retval PMINFO_R_OK success
1634 * @retval PMINFO_R_EINVAL invalid argument
1635 * @retval PMINFO_R_ERROR internal error
1637 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1638 * @see pkgmgrinfo_pkginfo_get_pkgid()
1639 * @see pkgmgrinfo_pkginfo_is_removable()
1641 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1644 pkgmgrinfo_cert_compare_result_type_e result;
1646 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1647 if (ret != PMINFO_R_OK) {
1650 printf("result: %d\n", result);
1655 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);
1656 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);
1658 * @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)
1659 * @brief This API compare the cert information from given app id
1661 * @par This API is for package-manager client application
1662 * @par Sync (or) Async : Synchronous API
1664 * @param[in] lhs_app_id pointer to first app ID
1665 * @param[in] rhs_app_id pointer to second app ID
1666 * @param[out] compare_result pointer to the compare result.
1667 * @return 0 if success, error code(<0) if fail
1668 * @retval PMINFO_R_OK success
1669 * @retval PMINFO_R_EINVAL invalid argument
1670 * @retval PMINFO_R_ERROR internal error
1672 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1673 * @see pkgmgrinfo_pkginfo_get_pkgid()
1674 * @see pkgmgrinfo_pkginfo_is_removable()
1676 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1679 pkgmgrinfo_cert_compare_result_type_e result;
1681 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1682 if (ret != PMINFO_R_OK) {
1685 printf("result: %d\n", result);
1690 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);
1691 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);
1693 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1694 * @brief This API gets the package 'removable' value from the package ID
1696 * @par This API is for package-manager client application
1697 * @par Sync (or) Async : Synchronous API
1699 * @param[in] handle pointer to package info handle
1700 * @param[out] removable pointer to hold package removable value
1701 * @return 0 if success, error code(<0) if fail
1702 * @retval PMINFO_R_OK success
1703 * @retval PMINFO_R_EINVAL invalid argument
1704 * @retval PMINFO_R_ERROR internal error
1705 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1706 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1707 * @see pkgmgrinfo_pkginfo_get_pkgid()
1708 * @see pkgmgrinfo_pkginfo_is_readonly()
1710 static int get_pkg_removable(const char *pkgid)
1714 pkgmgrinfo_pkginfo_h handle;
1715 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1716 if (ret != PMINFO_R_OK)
1718 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1719 if (ret != PMINFO_R_OK) {
1720 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1723 printf("pkg removable: %d\n", removable);
1724 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1729 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1732 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1733 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1735 * @par This API is for package-manager client application
1736 * @par Sync (or) Async : Synchronous API
1738 * @param[in] handle pointer to package info handle
1739 * @param[out] movable pointer to hold package movable state
1740 * @return 0 if success, error code(<0) if fail
1741 * @retval PMINFO_R_OK success
1742 * @retval PMINFO_R_EINVAL invalid argument
1743 * @retval PMINFO_R_ERROR internal error
1744 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1745 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1746 * @see pkgmgrinfo_pkginfo_get_pkgid()
1748 static int get_pkg_movable(const char *pkgid)
1752 pkgmgrinfo_pkginfo_h handle;
1753 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1754 if (ret != PMINFO_R_OK)
1756 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1757 if (ret != PMINFO_R_OK) {
1758 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1761 printf("pkg movable: %d\n", movable);
1762 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1767 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1770 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1771 * @brief This API gets the package 'preload' value from the package ID
1773 * @par This API is for package-manager client application
1774 * @par Sync (or) Async : Synchronous API
1776 * @param[in] handle pointer to package info handle
1777 * @param[out] preload pointer to hold package preload value
1778 * @return 0 if success, error code(<0) if fail
1779 * @retval PMINFO_R_OK success
1780 * @retval PMINFO_R_EINVAL invalid argument
1781 * @retval PMINFO_R_ERROR internal error
1782 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1783 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1784 * @see pkgmgrinfo_pkginfo_get_pkgid()
1785 * @see pkgmgrinfo_pkginfo_is_readonly()
1787 static int get_pkg_preload(const char *pkgid)
1791 pkgmgrinfo_pkginfo_h handle;
1792 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1793 if (ret != PMINFO_R_OK)
1795 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1796 if (ret != PMINFO_R_OK) {
1797 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1800 printf("pkg preload: %d\n", preload);
1801 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1806 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1809 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1810 * @brief This API gets the value for given handle is system or not
1812 * @par This API is for package-manager client application
1813 * @par Sync (or) Async : Synchronous API
1815 * @param[in] handle pointer to package info handle
1816 * @param[out] system pointer to hold system is or not
1817 * @return 0 if success, error code(<0) if fail
1818 * @retval PMINFO_R_OK success
1819 * @retval PMINFO_R_EINVAL invalid argument
1820 * @retval PMINFO_R_ERROR internal error
1821 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1822 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1823 * @see pkgmgrinfo_pkginfo_get_pkgid()
1824 * @see pkgmgrinfo_pkginfo_is_readonly()
1826 static int get_pkg_system(const char *pkgid)
1829 bool system = false;
1830 pkgmgrinfo_pkginfo_h handle = NULL;
1831 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1832 if (ret != PMINFO_R_OK)
1834 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1835 if (ret != PMINFO_R_OK) {
1836 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1839 printf("pkg system: %d\n", system);
1840 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1845 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1848 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1849 * @brief This API gets the package 'readonly' value from the package ID
1851 * @par This API is for package-manager client application
1852 * @par Sync (or) Async : Synchronous API
1854 * @param[in] handle pointer to package info handle
1855 * @param[out] readonly pointer to hold package readonly value
1856 * @return 0 if success, error code(<0) if fail
1857 * @retval PMINFO_R_OK success
1858 * @retval PMINFO_R_EINVAL invalid argument
1859 * @retval PMINFO_R_ERROR internal error
1860 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1861 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1862 * @see pkgmgrinfo_pkginfo_get_pkgid()
1863 * @see pkgmgrinfo_pkginfo_is_removable()
1865 static int get_pkg_readonly(const char *pkgid)
1869 pkgmgrinfo_pkginfo_h handle;
1870 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1871 if (ret != PMINFO_R_OK)
1873 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1874 if (ret != PMINFO_R_OK) {
1875 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1878 printf("pkg readonly: %d\n", readonly);
1879 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1884 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1888 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1889 * @brief This API gets the package 'upate' value from the package ID
1891 * @par This API is for package-manager client application
1892 * @par Sync (or) Async : Synchronous API
1894 * @param[in] handle pointer to package info handle
1895 * @param[out] update pointer to hold package update value
1896 * @return 0 if success, error code(<0) if fail
1897 * @retval PMINFO_R_OK success
1898 * @retval PMINFO_R_EINVAL invalid argument
1899 * @retval PMINFO_R_ERROR internal error
1900 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1901 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1902 * @see pkgmgrinfo_pkginfo_get_pkgid()
1904 static int get_pkg_update(const char *pkgid)
1908 pkgmgrinfo_pkginfo_h handle;
1909 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1910 if (ret != PMINFO_R_OK)
1912 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1913 if (ret != PMINFO_R_OK) {
1914 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1917 printf("pkg update: %d\n", update);
1918 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1923 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1926 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1927 * @brief This API gets the package 'support_disable' value from the package ID
1929 * @par This API is for package-manager client application
1930 * @par Sync (or) Async : Synchronous API
1932 * @param[in] handle pointer to package info handle
1933 * @param[out] support_disable pointer to hold package support_disable value
1934 * @return 0 if success, error code(<0) if fail
1935 * @retval PMINFO_R_OK success
1936 * @retval PMINFO_R_EINVAL invalid argument
1937 * @retval PMINFO_R_ERROR internal error
1938 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1939 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1940 * @see pkgmgrinfo_pkginfo_get_pkgid()
1942 static int get_pkg_support_disable(const char *pkgid)
1945 bool support_disable;
1946 pkgmgrinfo_pkginfo_h handle = NULL;
1947 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1948 if (ret != PMINFO_R_OK)
1950 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1951 if (ret != PMINFO_R_OK) {
1952 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1955 printf("pkg support_disable: %d\n", support_disable);
1956 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1961 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1964 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1965 * @brief This API gets whethere the given package is global package or user package
1967 * @par This API is for package-manager client application
1968 * @par Sync (or) Async : Synchronous API
1970 * @param[in] handle pointer to package info handle
1971 * @param[in] global pointer to hold package global value
1972 * @return 0 if success, error code(<0) if fail
1973 * @retval PMINFO_R_OK success
1974 * @retval PMINFO_R_EINVAL invalid argument
1975 * @retval PMINFO_R_ERROR internal error
1976 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1977 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1978 * @see pkgmgrinfo_pkginfo_get_pkgid()
1979 static int get_pkg_support_disable(const char *pkgid)
1983 pkgmgrinfo_pkginfo_h handle = NULL;
1984 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1985 if (ret != PMINFO_R_OK)
1987 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1988 if (ret != PMINFO_R_OK) {
1989 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1992 printf("pkg is_global: %d\n", global);
1993 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1998 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2001 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2002 * @brief This API gets the package 'accessible' value from the package ID
2004 * @par This API is for package-manager client application
2005 * @par Sync (or) Async : Synchronous API
2007 * @param[in] handle pointer to package info handle
2008 * @param[out] accessible pointer to hold package accessible value
2009 * @return 0 if success, error code(<0) if fail
2010 * @retval PMINFO_R_OK success
2011 * @retval PMINFO_R_EINVAL invalid argument
2012 * @retval PMINFO_R_ERROR internal error
2013 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2014 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2015 * @see pkgmgrinfo_pkginfo_get_pkgid()
2016 * @see pkgmgrinfo_pkginfo_is_readonly()
2018 static int get_pkg_accessible(const char *pkgid)
2022 pkgmgrinfo_pkginfo_h handle;
2023 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2024 if (ret != PMINFO_R_OK)
2026 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2027 if (ret != PMINFO_R_OK) {
2028 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2031 printf("pkg accessible: %d\n", accessible);
2032 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2037 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2040 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2041 * @brief This API destroys the package information handle freeing up all the resources
2043 * @par This API is for package-manager client application
2044 * @par Sync (or) Async : Synchronous API
2046 * @param[in] handle pointer to the package info handle
2047 * @return 0 if success, error code(<0) if fail
2048 * @retval PMINFO_R_OK success
2049 * @retval PMINFO_R_EINVAL invalid argument
2050 * @retval PMINFO_R_ERROR internal error
2051 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2053 * @see pkgmgrinfo_pkginfo_get_pkgid()
2054 * @see pkgmgrinfo_pkginfo_is_removable()
2056 static int get_pkg_type(const char *pkgid)
2060 pkgmgrinfo_pkginfo_h handle;
2061 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2062 if (ret != PMINFO_R_OK)
2064 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2065 if (ret != PMINFO_R_OK) {
2066 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2069 printf("pkgtype: %s\n", type);
2070 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2075 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2078 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2079 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2080 The query will search the entire package information collected from the manifest file of all the installed packages
2082 * @par This API is for package-manager client application
2083 * @par Sync (or) Async : Synchronous API
2085 * @param[out] handle pointer to the package info filter handle.
2086 * @return 0 if success, error code(<0) if fail
2087 * @retval PMINFO_R_OK success
2088 * @retval PMINFO_R_EINVAL invalid argument
2089 * @retval PMINFO_R_ERROR internal error
2091 * @post pkgmgrinfo_pkginfo_filter_destroy()
2092 * @see pkgmgrinfo_pkginfo_filter_count()
2093 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2095 static int get_tpk_pkg_count()
2099 pkgmgrinfo_pkginfo_filter_h handle;
2100 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2101 if (ret != PMINFO_R_OK)
2103 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2104 if (ret != PMINFO_R_OK) {
2105 pkgmgrinfo_pkginfo_filter_destroy(handle);
2108 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2109 if (ret != PMINFO_R_OK) {
2110 pkgmgrinfo_pkginfo_filter_destroy(handle);
2113 printf("No of tpk pkgs: %d\n", count);
2114 pkgmgrinfo_pkginfo_filter_destroy(handle);
2119 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2122 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2123 * @brief This API destroys the package information filter handle freeing up all the resources
2125 * @par This API is for package-manager client application
2126 * @par Sync (or) Async : Synchronous API
2128 * @param[in] handle pointer to the package info filter handle.
2129 * @return 0 if success, error code(<0) if fail
2130 * @retval PMINFO_R_OK success
2131 * @retval PMINFO_R_EINVAL invalid argument
2132 * @retval PMINFO_R_ERROR internal error
2133 * @pre pkgmgrinfo_pkginfo_filter_create()
2135 * @see pkgmgrinfo_pkginfo_filter_count()
2136 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2138 static int get_tpk_pkg_count()
2142 pkgmgrinfo_pkginfo_filter_h handle;
2143 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2144 if (ret != PMINFO_R_OK)
2146 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2147 if (ret != PMINFO_R_OK) {
2148 pkgmgrinfo_pkginfo_filter_destroy(handle);
2151 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2152 if (ret != PMINFO_R_OK) {
2153 pkgmgrinfo_pkginfo_filter_destroy(handle);
2156 printf("No of tpk pkgs: %d\n", count);
2157 pkgmgrinfo_pkginfo_filter_destroy(handle);
2162 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2165 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2166 * @brief This API adds a boolean filter property to the filter handle
2168 * @par This API is for package-manager client application
2169 * @par Sync (or) Async : Synchronous API
2171 * @param[in] handle pointer to the package info filter handle.
2172 * @param[in] property boolean property name.
2173 * @param[in] value value corresponding to the property.
2174 * @return 0 if success, error code(<0) if fail
2175 * @retval PMINFO_R_OK success
2176 * @retval PMINFO_R_EINVAL invalid argument
2177 * @retval PMINFO_R_ERROR internal error
2178 * @pre pkgmgrinfo_pkginfo_filter_create()
2179 * @post pkgmgrinfo_pkginfo_filter_destroy()
2180 * @see pkgmgrinfo_pkginfo_filter_count()
2181 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2183 static int get_preload_pkg_count()
2187 pkgmgrinfo_pkginfo_filter_h handle;
2188 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2189 if (ret != PMINFO_R_OK)
2191 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2192 if (ret != PMINFO_R_OK) {
2193 pkgmgrinfo_pkginfo_filter_destroy(handle);
2196 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2197 if (ret != PMINFO_R_OK) {
2198 pkgmgrinfo_pkginfo_filter_destroy(handle);
2201 printf("No of preload pkgs: %d\n", count);
2202 pkgmgrinfo_pkginfo_filter_destroy(handle);
2207 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2208 const char *property, const bool value);
2211 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2212 * @brief This API adds an integer filter property to the filter handle
2214 * @par This API is for package-manager client application
2215 * @par Sync (or) Async : Synchronous API
2217 * @param[in] handle pointer to the package info filter handle.
2218 * @param[in] property integer property name.
2219 * @param[in] value value corresponding to the property.
2220 * @return 0 if success, error code(<0) if fail
2221 * @retval PMINFO_R_OK success
2222 * @retval PMINFO_R_EINVAL invalid argument
2223 * @retval PMINFO_R_ERROR internal error
2224 * @pre pkgmgrinfo_pkginfo_filter_create()
2225 * @post pkgmgrinfo_pkginfo_filter_destroy()
2226 * @see pkgmgrinfo_pkginfo_filter_count()
2227 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2229 static int get_pkg_count()
2233 pkgmgrinfo_pkginfo_filter_h handle;
2234 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2235 if (ret != PMINFO_R_OK)
2237 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2238 if (ret != PMINFO_R_OK) {
2239 pkgmgrinfo_pkginfo_filter_destroy(handle);
2242 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2243 if (ret != PMINFO_R_OK) {
2244 pkgmgrinfo_pkginfo_filter_destroy(handle);
2247 printf("No of preload pkgs: %d\n", count);
2248 pkgmgrinfo_pkginfo_filter_destroy(handle);
2253 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2254 const char *property, const int value);
2257 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2258 * @brief This API adds a string filter property to the filter handle
2260 * @par This API is for package-manager client application
2261 * @par Sync (or) Async : Synchronous API
2263 * @param[in] handle pointer to the package info filter handle.
2264 * @param[in] property string property name.
2265 * @param[in] value value corresponding to the property.
2266 * @return 0 if success, error code(<0) if fail
2267 * @retval PMINFO_R_OK success
2268 * @retval PMINFO_R_EINVAL invalid argument
2269 * @retval PMINFO_R_ERROR internal error
2270 * @pre pkgmgrinfo_pkginfo_filter_create()
2271 * @post pkgmgrinfo_pkginfo_filter_destroy()
2272 * @see pkgmgrinfo_pkginfo_filter_count()
2273 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2275 static int get_tpk_pkg_count()
2279 pkgmgrinfo_pkginfo_filter_h handle;
2280 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2281 if (ret != PMINFO_R_OK)
2283 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2284 if (ret != PMINFO_R_OK) {
2285 pkgmgrinfo_pkginfo_filter_destroy(handle);
2288 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2289 if (ret != PMINFO_R_OK) {
2290 pkgmgrinfo_pkginfo_filter_destroy(handle);
2293 printf("No of tpk pkgs: %d\n", count);
2294 pkgmgrinfo_pkginfo_filter_destroy(handle);
2299 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2300 const char *property, const char *value);
2303 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2304 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2306 * @par This API is for package-manager client application
2307 * @par Sync (or) Async : Synchronous API
2309 * @param[in] handle pointer to the package info filter handle.
2310 * @param[in] pkg_cb callback function.
2311 * @param[in] user_data user data to be passed to the callback function
2312 * @return 0 if success, error code(<0) if fail
2313 * @retval PMINFO_R_OK success
2314 * @retval PMINFO_R_EINVAL invalid argument
2315 * @retval PMINFO_R_ERROR internal error
2316 * @pre pkgmgrinfo_pkginfo_filter_create()
2317 * @post pkgmgrinfo_pkginfo_filter_destroy()
2318 * @see pkgmgrinfo_pkginfo_filter_count()
2320 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2323 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2324 printf("pkg id : %s\n", pkgid);
2328 static int get_tpk_pkg_list()
2331 pkgmgrinfo_pkginfo_filter_h handle;
2332 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2333 if (ret != PMINFO_R_OK)
2335 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2336 if (ret != PMINFO_R_OK) {
2337 pkgmgrinfo_pkginfo_filter_destroy(handle);
2340 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2341 if (ret != PMINFO_R_OK) {
2342 pkgmgrinfo_pkginfo_filter_destroy(handle);
2345 pkgmgrinfo_pkginfo_filter_destroy(handle);
2350 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2351 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2352 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2353 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2356 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2357 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2358 * @brief This API counts the package that satisfy the filter conditions
2360 * @par This API is for package-manager client application
2361 * @par Sync (or) Async : Synchronous API
2363 * @param[in] handle pointer to the package info filter handle.
2364 * @param[in] count pointer to store the count value.
2365 * @param[in] uid the addressee user id of the instruction
2366 * @return 0 if success, error code(<0) if fail
2367 * @retval PMINFO_R_OK success
2368 * @retval PMINFO_R_EINVAL invalid argument
2369 * @retval PMINFO_R_ERROR internal error
2370 * @pre pkgmgrinfo_pkginfo_filter_create()
2371 * @post pkgmgrinfo_pkginfo_filter_destroy()
2372 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2374 static int get_tpk_pkg_count()
2378 pkgmgrinfo_pkginfo_filter_h handle;
2379 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2380 if (ret != PMINFO_R_OK)
2382 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2383 if (ret != PMINFO_R_OK) {
2384 pkgmgrinfo_pkginfo_filter_destroy(handle);
2387 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2388 if (ret != PMINFO_R_OK) {
2389 pkgmgrinfo_pkginfo_filter_destroy(handle);
2392 printf("No of tpk pkgs: %d\n", count);
2393 pkgmgrinfo_pkginfo_filter_destroy(handle);
2398 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2399 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2402 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2403 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2404 * @brief This API gets the list of privilege for a particular package
2406 * @par This API is for package-manager client application
2407 * @par Sync (or) Async : Synchronous API
2408 * @param[in] handle pointer to the package info handle.
2409 * @param[in] privilege_func callback function for list
2410 * @param[in] user_data user data to be passed to callback function
2411 * @return 0 if success, error code(<0) if fail
2412 * @retval PMINFO_R_OK success
2413 * @retval PMINFO_R_EINVAL invalid argument
2414 * @retval PMINFO_R_ERROR internal error
2415 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2416 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2418 int privilege_func(const char *name, void *user_data)
2420 if (strcmp(name, (char *)user_data) == 0)
2426 static int list_privilege(const char *package, char *privilege)
2429 pkgmgrinfo_pkginfo_h handle;
2430 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2431 if (ret != PMINFO_R_OK)
2433 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2434 if (ret != PMINFO_R_OK) {
2435 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2438 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2443 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2444 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2447 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2448 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2449 * @brief This API gets the list of appdefined privilege for a particular package
2451 * @par This API is for package-manager client application
2452 * @par Sync (or) Async : Synchronous API
2453 * @param[in] handle pointer to the package info handle.
2454 * @param[in] privilege_func callback function for list
2455 * @param[in] user_data user data to be passed to callback function
2456 * @return 0 if success, error code(<0) if fail
2457 * @retval PMINFO_R_OK success
2458 * @retval PMINFO_R_EINVAL invalid argument
2459 * @retval PMINFO_R_ERROR internal error
2460 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2461 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2463 int privilege_func(const char *name, const char *license_path, void *user_data)
2465 printf("appdefined privilege : %s", name);
2467 printf("licensed privilege, lecense path : %s", license_path);
2471 static int list_appdefined_privilege(const char *package)
2474 pkgmgrinfo_pkginfo_h handle;
2475 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2476 if (ret != PMINFO_R_OK)
2478 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2479 if (ret != PMINFO_R_OK) {
2480 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2488 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2489 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2491 /* TODO: add doxygen comment here */
2492 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2495 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2496 * @brief This API copy the application information handle
2498 * @par This API is for package-manager client application
2499 * @par Sync (or) Async : Synchronous API
2501 * @param[in] handle pointer to the package info handle.
2502 * @param[out] handle pointer to the package info handle.
2503 * @return 0 if success, error code(<0) if fail
2504 * @retval PMINFO_R_OK success
2505 * @retval PMINFO_R_EINVAL invalid argument
2506 * @retval PMINFO_R_ERROR internal error
2508 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2510 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2514 pkgmgrinfo_pkginfo_h clone;
2516 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2517 if (ret != PMINFO_R_OK)
2521 printf("package: %s\n", clone->package);
2522 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2527 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2531 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2532 pkgmgrinfo_app_list_cb app_func, void *user_data)
2533 * @brief This API gets list of installed applications for a particular package
2535 * @par This API is for package-manager client application
2536 * @par Sync (or) Async : Synchronous API
2537 * @param[in] handle package info handle
2538 * @param[in] component application component
2539 * @param[in] app_func iteration function for list
2540 * @param[in] user_data user data to be passed to callback function
2541 * @return 0 if success, error code(<0) if fail
2542 * @retval PMINFO_R_OK success
2543 * @retval PMINFO_R_EINVAL invalid argument
2544 * @retval PMINFO_R_ERROR internal error
2545 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2546 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2548 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2551 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2552 printf("appid : %s\n", appid);
2556 static int list_apps(const char *pkgid)
2559 pkgmgrinfo_pkginfo_h handle;
2560 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2561 if (ret != PMINFO_R_OK)
2563 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2564 if (ret != PMINFO_R_OK) {
2565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2573 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2574 pkgmgrinfo_app_list_cb app_func, void *user_data);
2575 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2576 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2579 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2580 * @brief This API gets list of installed applications from all packages with minimum informaion.
2582 * @par This API is for package-manager client application
2583 * @par Sync (or) Async : Synchronous API
2584 * @param[in] app_func iteration function for list
2585 * @param[in] user_data user data to be passed to callback function
2586 * @return 0 if success, error code(<0) if fail
2587 * @retval PMINFO_R_OK success
2588 * @retval PMINFO_R_EINVAL invalid argument
2589 * @retval PMINFO_R_ERROR internal error
2593 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2595 char *pkgid1 = NULL;
2596 char *pkgid2 = NULL;
2597 pkgid1 = (char *)user_data;
2598 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2599 if (strcmp(pkgid1, pkgid2) == 0) {
2606 static int list_apps()
2609 char *name = "helloworld";
2610 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2611 if (ret != PMINFO_R_OK) {
2618 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2619 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2622 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2623 * @brief This API gets list of installed applications from all packages.
2625 * @par This API is for package-manager client application
2626 * @par Sync (or) Async : Synchronous API
2627 * @param[in] app_func iteration function for list
2628 * @param[in] user_data user data to be passed to callback function
2629 * @return 0 if success, error code(<0) if fail
2630 * @retval PMINFO_R_OK success
2631 * @retval PMINFO_R_EINVAL invalid argument
2632 * @retval PMINFO_R_ERROR internal error
2636 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2638 char *pkgid1 = NULL;
2639 char *pkgid2 = NULL;
2640 pkgid1 = (char *)user_data;
2641 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2642 if (strcmp(pkgid1, pkgid2) == 0) {
2649 static int list_apps()
2652 char *name = "helloworld";
2653 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2654 if (ret != PMINFO_R_OK) {
2661 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2662 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2665 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2666 * @brief This API creates the disabled application information handle from db
2668 * @par This API is for package-manager client application
2669 * @par Sync (or) Async : Synchronous API
2671 * @param[in] appid pointer to appid
2672 * @param[out] handle pointer to the application info handle.
2673 * @return 0 if success, error code(<0) if fail
2674 * @retval PMINFO_R_OK success
2675 * @retval PMINFO_R_EINVAL invalid argument
2676 * @retval PMINFO_R_ERROR internal error
2678 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2679 * @see pkgmgrinfo_appinfo_get_pkgid()
2680 * @see pkgmgrinfo_appinfo_is_multiple()
2682 static int get_disabled_app_type(const char *appid)
2686 pkgmgrinfo_appinfo_h handle;
2687 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2688 if (ret != PMINFO_R_OK)
2690 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2691 if (ret != PMINFO_R_OK) {
2692 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2695 printf("apptype: %s\n", type);
2696 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2701 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2702 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2705 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2706 * @brief This API creates the application information handle from db
2708 * @par This API is for package-manager client application
2709 * @par Sync (or) Async : Synchronous API
2711 * @param[in] appid pointer to appid
2712 * @param[out] handle pointer to the application info handle.
2713 * @return 0 if success, error code(<0) if fail
2714 * @retval PMINFO_R_OK success
2715 * @retval PMINFO_R_EINVAL invalid argument
2716 * @retval PMINFO_R_ERROR internal error
2718 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2719 * @see pkgmgrinfo_appinfo_get_pkgid()
2720 * @see pkgmgrinfo_appinfo_is_multiple()
2722 static int get_app_type(const char *appid)
2726 pkgmgrinfo_appinfo_h handle;
2727 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2728 if (ret != PMINFO_R_OK)
2730 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2731 if (ret != PMINFO_R_OK) {
2732 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2735 printf("apptype: %s\n", type);
2736 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2741 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2742 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2745 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2746 * @brief This API creates the application information handle from db regardless of its disable or storage status
2748 * @par This API is for package-manager client application
2749 * @par Sync (or) Async : Synchronous API
2751 * @param[in] appid pointer to appid
2752 * @param[out] handle pointer to the application info handle.
2753 * @return 0 if success, error code(<0) if fail
2754 * @retval PMINFO_R_OK success
2755 * @retval PMINFO_R_EINVAL invalid argument
2756 * @retval PMINFO_R_ERROR internal error
2758 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2759 * @see pkgmgrinfo_appinfo_get_pkgid()
2760 * @see pkgmgrinfo_appinfo_is_multiple()
2762 static int get_app_type(const char *appid)
2766 pkgmgrinfo_appinfo_h handle;
2767 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2768 if (ret != PMINFO_R_OK)
2770 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2771 if (ret != PMINFO_R_OK) {
2772 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2775 printf("apptype: %s\n", type);
2776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2781 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2782 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2785 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2786 * @brief This API gets the application ID
2788 * @par This API is for package-manager client application
2789 * @par Sync (or) Async : Synchronous API
2791 * @param[in] handle pointer to the application info handle.
2792 * @param[out] appid pointer to hold appid
2793 * @return 0 if success, error code(<0) if fail
2794 * @retval PMINFO_R_OK success
2795 * @retval PMINFO_R_EINVAL invalid argument
2796 * @retval PMINFO_R_ERROR internal error
2797 * @pre pkgmgrinfo_appinfo_get_appinfo()
2798 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2799 * @see pkgmgrinfo_appinfo_get_pkgid()
2800 * @see pkgmgrinfo_appinfo_is_multiple()
2802 static int get_app_id(const char *appid)
2805 char *app_id = NULL;
2806 pkgmgrinfo_appinfo_h handle;
2807 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2808 if (ret != PMINFO_R_OK)
2810 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2811 if (ret != PMINFO_R_OK) {
2812 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2815 printf("app id: %s\n", app_id);
2816 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2821 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2824 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2825 * @brief This API gets the package name of the application
2827 * @par This API is for package-manager client application
2828 * @par Sync (or) Async : Synchronous API
2830 * @param[in] handle pointer to the application info handle.
2831 * @param[out] pkg_name pointer to hold package name
2832 * @return 0 if success, error code(<0) if fail
2833 * @retval PMINFO_R_OK success
2834 * @retval PMINFO_R_EINVAL invalid argument
2835 * @retval PMINFO_R_ERROR internal error
2836 * @pre pkgmgrinfo_appinfo_get_appinfo()
2837 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2838 * @see pkgmgrinfo_appinfo_get_appid()
2839 * @see pkgmgrinfo_appinfo_is_multiple()
2841 static int get_app_pkgname(const char *appid)
2844 char *pkgname = NULL;
2845 pkgmgrinfo_appinfo_h handle;
2846 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2847 if (ret != PMINFO_R_OK)
2849 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2850 if (ret != PMINFO_R_OK) {
2851 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2854 printf("pkg name: %s\n", pkgname);
2855 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2860 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2863 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2864 * @brief This API gets the package id of the application
2866 * @par This API is for package-manager client application
2867 * @par Sync (or) Async : Synchronous API
2869 * @param[in] handle pointer to the application info handle.
2870 * @param[out] pkgid pointer to hold package id
2871 * @return 0 if success, error code(<0) if fail
2872 * @retval PMINFO_R_OK success
2873 * @retval PMINFO_R_EINVAL invalid argument
2874 * @retval PMINFO_R_ERROR internal error
2875 * @pre pkgmgrinfo_appinfo_get_appinfo()
2876 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2877 * @see pkgmgrinfo_appinfo_get_appid()
2878 * @see pkgmgrinfo_appinfo_is_multiple()
2880 static int get_app_pkgid(const char *appid)
2884 pkgmgrinfo_appinfo_h handle;
2885 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2886 if (ret != PMINFO_R_OK)
2888 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2889 if (ret != PMINFO_R_OK) {
2890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2893 printf("pkg id: %s\n", pkgid);
2894 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2899 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2902 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2903 * @brief This API gets the package type of the application
2905 * @par This API is for package-manager client application
2906 * @par Sync (or) Async : Synchronous API
2908 * @param[in] handle pointer to the application info handle.
2909 * @param[out] pkgtype pointer to hold package type
2910 * @return 0 if success, error code(<0) if fail
2911 * @retval PMINFO_R_OK success
2912 * @retval PMINFO_R_EINVAL invalid argument
2913 * @retval PMINFO_R_ERROR internal error
2914 * @pre pkgmgrinfo_appinfo_get_appinfo()
2915 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2916 * @see pkgmgrinfo_appinfo_get_appid()
2917 * @see pkgmgrinfo_appinfo_is_multiple()
2919 static int get_app_pkgtype(const char *appid)
2922 char *pkgtype = NULL;
2923 pkgmgrinfo_appinfo_h handle = NULL;
2924 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2925 if (ret != PMINFO_R_OK)
2927 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2928 if (ret != PMINFO_R_OK) {
2929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2932 printf("pkgtype: %s\n", pkgtype);
2933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2938 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2941 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2942 * @brief This API gets the executable name of the application
2944 * @par This API is for package-manager client application
2945 * @par Sync (or) Async : Synchronous API
2947 * @param[in] handle pointer to the application info handle.
2948 * @param[out] exec pointer to hold app exec name
2949 * @return 0 if success, error code(<0) if fail
2950 * @retval PMINFO_R_OK success
2951 * @retval PMINFO_R_EINVAL invalid argument
2952 * @retval PMINFO_R_ERROR internal error
2953 * @pre pkgmgrinfo_appinfo_get_appinfo()
2954 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2955 * @see pkgmgrinfo_appinfo_get_appid()
2956 * @see pkgmgrinfo_appinfo_is_multiple()
2958 static int get_app_exec(const char *appid)
2962 pkgmgrinfo_appinfo_h handle;
2963 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2964 if (ret != PMINFO_R_OK)
2966 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2967 if (ret != PMINFO_R_OK) {
2968 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2971 printf("exec name: %s\n", exec);
2972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2977 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2980 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2981 * @brief This API gets the icon name of the application
2983 * @par This API is for package-manager client application
2984 * @par Sync (or) Async : Synchronous API
2986 * @param[in] handle pointer to the application info handle.
2987 * @param[out] icon pointer to hold app icon name
2988 * @return 0 if success, error code(<0) if fail
2989 * @retval PMINFO_R_OK success
2990 * @retval PMINFO_R_EINVAL invalid argument
2991 * @retval PMINFO_R_ERROR internal error
2992 * @pre pkgmgrinfo_appinfo_get_appinfo()
2993 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2994 * @see pkgmgrinfo_appinfo_get_appid()
2995 * @see pkgmgrinfo_appinfo_is_multiple()
2997 static int get_app_icon(const char *appid)
3001 pkgmgrinfo_appinfo_h handle;
3002 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3003 if (ret != PMINFO_R_OK)
3005 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3006 if (ret != PMINFO_R_OK) {
3007 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3010 printf("icon name: %s\n", icon);
3011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3016 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3019 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3020 * @brief This API gets the label of the application
3022 * @par This API is for package-manager client application
3023 * @par Sync (or) Async : Synchronous API
3025 * @param[in] handle pointer to the application info handle.
3026 * @param[out] label pointer to hold app label
3027 * @return 0 if success, error code(<0) if fail
3028 * @retval PMINFO_R_OK success
3029 * @retval PMINFO_R_EINVAL invalid argument
3030 * @retval PMINFO_R_ERROR internal error
3031 * @pre pkgmgrinfo_appinfo_get_appinfo()
3032 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3033 * @see pkgmgrinfo_appinfo_get_appid()
3034 * @see pkgmgrinfo_appinfo_is_multiple()
3036 static int get_app_label(const char *appid)
3040 pkgmgrinfo_appinfo_h handle;
3041 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3042 if (ret != PMINFO_R_OK)
3044 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3045 if (ret != PMINFO_R_OK) {
3046 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3049 printf("label : %s\n", label);
3050 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3055 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3058 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3059 * @brief This API gets exactly matched label by given appid and locale
3061 * @par This API is for package-manager client application
3062 * @par Sync (or) Async : Synchronous API
3064 * @param[in] appid pointer to appid
3065 * @param[in] locale pointer to locale
3066 * @param[out] label pointer to hold app label
3067 * @return 0 if success, error code(<0) if fail
3068 * @retval PMINFO_R_OK success
3069 * @retval PMINFO_R_EINVAL invalid argument
3070 * @retval PMINFO_R_ERROR internal error
3072 static int get_localed_label(const char *appid, const char *locale)
3077 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3078 if (ret != PMINFO_R_OK)
3081 printf("localed label: %s\n", label);
3089 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3090 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3093 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3094 * @brief This API gets metadata value by given metadata key
3096 * @par This API is for package-manager client application
3097 * @par Sync (or) Async : Synchronous API
3099 * @param[in] handle pointer to the application info handle
3100 * @param[in] metadata_key metadata key
3101 * @param[out] metadata_value pointer to hold metadata value
3102 * @return 0 if success, error code(<0) if fail
3103 * @retval PMINFO_R_OK success
3104 * @retval PMINFO_R_EINVAL invalid argument
3106 static int get_metadata_value(const char *appid, const char *metadata_key)
3109 pkgmgrinfo_appinfo_h handle = NULL;
3110 char *metadata_value = NULL;
3112 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3113 if (ret != PMINFO_R_OK)
3116 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3117 if (ret != PMINFO_R_OK) {
3118 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3122 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3127 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3130 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3131 * @brief This API gets the component of the application
3133 * @par This API is for package-manager client application
3134 * @par Sync (or) Async : Synchronous API
3136 * @param[in] handle pointer to the application info handle.
3137 * @param[out] component pointer to hold app component
3138 * @return 0 if success, error code(<0) if fail
3139 * @retval PMINFO_R_OK success
3140 * @retval PMINFO_R_EINVAL invalid argument
3141 * @retval PMINFO_R_ERROR internal error
3142 * @pre pkgmgrinfo_appinfo_get_appinfo()
3143 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3144 * @see pkgmgrinfo_appinfo_get_appid()
3145 * @see pkgmgrinfo_appinfo_is_multiple()
3147 static int get_app_component(const char *appid)
3150 pkgmgrinfo_app_component component;
3151 pkgmgrinfo_appinfo_h handle;
3152 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3153 if (ret != PMINFO_R_OK)
3155 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3156 if (ret != PMINFO_R_OK) {
3157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3160 printf("component : %s\n", component);
3161 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3166 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3169 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3170 * @brief This API gets the apptype of the application
3172 * @par This API is for package-manager client application
3173 * @par Sync (or) Async : Synchronous API
3175 * @param[in] handle pointer to the application info handle.
3176 * @param[out] app_type pointer to hold apptype
3177 * @return 0 if success, error code(<0) if fail
3178 * @retval PMINFO_R_OK success
3179 * @retval PMINFO_R_EINVAL invalid argument
3180 * @retval PMINFO_R_ERROR internal error
3181 * @pre pkgmgrinfo_appinfo_get_appinfo()
3182 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3183 * @see pkgmgrinfo_appinfo_get_appid()
3184 * @see pkgmgrinfo_appinfo_is_multiple()
3186 static int get_app_type(const char *appid)
3189 char *apptype = NULL;
3190 pkgmgrinfo_appinfo_h handle;
3191 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3192 if (ret != PMINFO_R_OK)
3194 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3195 if (ret != PMINFO_R_OK) {
3196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3199 printf("apptype : %s\n", apptype);
3200 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3205 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3208 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3209 int *operation_count, char ***operation)
3210 * @brief This API gets the list of operation of the application
3212 * @par This API is for package-manager client application
3213 * @par Sync (or) Async : Synchronous API
3215 * @param[in] handle pointer to the appcontrol handle.
3216 * @param[out] operation_count pointer to hold number of operations
3217 * @param[out] operation pointer to hold list of operations
3218 * @return 0 if success, error code(<0) if fail
3219 * @retval PMINFO_R_OK success
3220 * @retval PMINFO_R_EINVAL invalid argument
3221 * @retval PMINFO_R_ERROR internal error
3222 * @pre pkgmgrinfo_appinfo_get_appinfo()
3223 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3224 * @see pkgmgrinfo_appinfo_get_uri()
3225 * @see pkgmgrinfo_appinfo_get_mime()
3227 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3232 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3233 for (i = 0; i < oc; i++) {
3234 if (strcmp(operation[i], (char *)user_data) == 0)
3241 static int check_operation(const char *appid, char *operation)
3244 pkgmgrinfo_appinfo_h handle;
3245 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3246 if (ret != PMINFO_R_OK)
3248 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3249 if (ret != PMINFO_R_OK) {
3250 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3253 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3258 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
3259 int *operation_count, char ***operation);
3262 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3263 int *uri_count, char ***uri)
3264 * @brief This API gets the list of uri of the application
3266 * @par This API is for package-manager client application
3267 * @par Sync (or) Async : Synchronous API
3269 * @param[in] handle pointer to the appcontrol handle.
3270 * @param[out] uri_count pointer to hold number of uris
3271 * @param[out] uri pointer to hold list of uris
3272 * @return 0 if success, error code(<0) if fail
3273 * @retval PMINFO_R_OK success
3274 * @retval PMINFO_R_EINVAL invalid argument
3275 * @retval PMINFO_R_ERROR internal error
3276 * @pre pkgmgrinfo_appinfo_get_appinfo()
3277 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3278 * @see pkgmgrinfo_appinfo_get_operation()
3279 * @see pkgmgrinfo_appinfo_get_mime()
3281 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3286 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
3287 for (i = 0; i < uc; i++) {
3288 if (strcmp(uri[i], (char *)user_data) == 0)
3295 static int check_uri(const char *appid, char *uri)
3298 pkgmgrinfo_appinfo_h handle;
3299 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3300 if (ret != PMINFO_R_OK)
3302 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
3303 if (ret != PMINFO_R_OK) {
3304 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3307 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3312 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
3313 int *uri_count, char ***uri);
3316 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3317 int *mime_count, char ***mime)
3318 * @brief This API gets the list of mime of the application
3320 * @par This API is for package-manager client application
3321 * @par Sync (or) Async : Synchronous API
3323 * @param[in] handle pointer to the appcontrol handle.
3324 * @param[out] mime_count pointer to hold number of mimes
3325 * @param[out] mime pointer to hold list of mimes
3326 * @return 0 if success, error code(<0) if fail
3327 * @retval PMINFO_R_OK success
3328 * @retval PMINFO_R_EINVAL invalid argument
3329 * @retval PMINFO_R_ERROR internal error
3330 * @pre pkgmgrinfo_appinfo_get_appinfo()
3331 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3332 * @see pkgmgrinfo_appinfo_get_uri()
3333 * @see pkgmgrinfo_appinfo_get_operation()
3335 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3340 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
3341 for (i = 0; i < mc; i++) {
3342 if (strcmp(mime[i], (char *)user_data) == 0)
3349 static int check_mime(const char *appid, char *mime)
3352 pkgmgrinfo_appinfo_h handle;
3353 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3354 if (ret != PMINFO_R_OK)
3356 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3357 if (ret != PMINFO_R_OK) {
3358 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3361 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3366 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
3367 int *mime_count, char ***mime);
3370 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3371 int *subapp_count, char ***subapp)
3372 * @brief This API gets the list of subapp of the application
3374 * @par This API is for package-manager client application
3375 * @par Sync (or) Async : Synchronous API
3377 * @param[in] handle pointer to the appcontrol handle.
3378 * @param[out] subapp_count pointer to hold number of subapp
3379 * @param[out] subapp pointer to hold list of subapp
3380 * @return 0 if success, error code(<0) if fail
3381 * @retval PMINFO_R_OK success
3382 * @retval PMINFO_R_EINVAL invalid argument
3383 * @retval PMINFO_R_ERROR internal error
3384 * @pre pkgmgrinfo_appinfo_get_appinfo()
3385 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3386 * @see pkgmgrinfo_appinfo_get_uri()
3387 * @see pkgmgrinfo_appinfo_get_operation()
3389 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3393 char **subapp = NULL;
3394 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3395 for (i = 0; i < sc; i++) {
3396 if (strcmp(subapp[i], (char *)user_data) == 0)
3403 static int check_subapp(const char *appid, char *subapp)
3406 pkgmgrinfo_appinfo_h handle = NULL;
3407 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3408 if (ret != PMINFO_R_OK)
3410 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3411 if (ret != PMINFO_R_OK) {
3412 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3420 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
3421 int *subapp_count, char ***subapp);
3424 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3425 * @brief This API gets the notification icon of the application
3427 * @par This API is for package-manager client application
3428 * @par Sync (or) Async : Synchronous API
3430 * @param[in] handle pointer to the application info handle.
3431 * @param[out] path pointer to hold notification icon
3432 * @return 0 if success, error code(<0) if fail
3433 * @retval PMINFO_R_OK success
3434 * @retval PMINFO_R_EINVAL invalid argument
3435 * @retval PMINFO_R_ERROR internal error
3436 * @pre pkgmgrinfo_appinfo_get_appinfo()
3437 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3438 * @see pkgmgrinfo_appinfo_get_appid()
3439 * @see pkgmgrinfo_appinfo_is_multiple()
3441 static int get_app_notification_icon(const char *appid)
3444 char *notification_icon = NULL;
3445 pkgmgrinfo_appinfo_h handle;
3446 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3447 if (ret != PMINFO_R_OK)
3449 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3450 if (ret != PMINFO_R_OK) {
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3454 printf("notification icon : %s\n", notification_icon);
3455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3460 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3463 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3464 * @brief This API gets the type of recent image on app-tray
3466 * @par This API is for package-manager client application
3467 * @par Sync (or) Async : Synchronous API
3469 * @param[in] handle pointer to the application info handle.
3470 * @param[out] type pointer to hold image type
3471 * @return 0 if success, error code(<0) if fail
3472 * @retval PMINFO_R_OK success
3473 * @retval PMINFO_R_EINVAL invalid argument
3474 * @retval PMINFO_R_ERROR internal error
3475 * @pre pkgmgrinfo_appinfo_get_appinfo()
3476 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3477 * @see pkgmgrinfo_appinfo_get_appid()
3478 * @see pkgmgrinfo_appinfo_is_multiple()
3480 static int get_app_recent_image_type(const char *appid)
3483 pkgmgrinfo_app_recentimage type;
3484 pkgmgrinfo_appinfo_h handle;
3485 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3486 if (ret != PMINFO_R_OK)
3488 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3489 if (ret != PMINFO_R_OK) {
3490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3493 printf("recent image type: %d\n", type);
3494 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3499 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3503 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3504 * @brief This API gets the preview image of application
3506 * @par Sync (or) Async : Synchronous API
3508 * @param[in] handle pointer to the application info handle.
3509 * @param[out] preview_img pointer to hold preview image path
3510 * @return 0 if success, error code(<0) if fail
3511 * @retval PMINFO_R_OK success
3512 * @retval PMINFO_R_EINVAL invalid argument
3513 * @retval PMINFO_R_ERROR internal error
3514 * @pre pkgmgrinfo_appinfo_get_appinfo()
3515 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3516 * @see pkgmgrinfo_appinfo_get_appid()
3518 static int get_app_previewimage(const char *appid)
3521 char *preview = NULL;
3522 pkgmgrinfo_appinfo_h handle = NULL;
3523 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3524 if (ret != PMINFO_R_OK)
3526 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3527 if (ret != PMINFO_R_OK) {
3528 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3531 printf("preview image path : %s\n", preview);
3532 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3537 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3541 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3542 * @brief This API gets the package permission type of the application
3544 * @par This API is for package-manager client application
3545 * @par Sync (or) Async : Synchronous API
3547 * @param[in] handle pointer to the application info handle.
3548 * @param[out] permission pointer to hold package permission
3549 * @return 0 if success, error code(<0) if fail
3550 * @retval PMINFO_R_OK success
3551 * @retval PMINFO_R_EINVAL invalid argument
3552 * @retval PMINFO_R_ERROR internal error
3553 * @pre pkgmgrinfo_appinfo_get_appinfo()
3554 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3555 * @see pkgmgrinfo_appinfo_get_appid()
3557 static int get_app_permission(const char *appid)
3560 pkgmgrinfo_permission_type permission = 0;
3561 pkgmgrinfo_appinfo_h handle;
3563 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3564 if (ret != PMINFO_R_OK)
3566 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3567 if (ret != PMINFO_R_OK) {
3568 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3571 printf("permission type: %d\n", permission);
3572 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3577 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3580 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3581 * @brief This API gets the component_type
3583 * @par This API is for package-manager client application
3584 * @par Sync (or) Async : Synchronous API
3586 * @param[in] handle pointer to the application info handle.
3587 * @param[out] component_type pointer to hold component_type
3588 * @return 0 if success, error code(<0) if fail
3589 * @retval PMINFO_R_OK success
3590 * @retval PMINFO_R_EINVAL invalid argument
3591 * @retval PMINFO_R_ERROR internal error
3592 * @pre pkgmgrinfo_appinfo_get_appinfo()
3593 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3594 * @see pkgmgrinfo_appinfo_get_pkgid()
3595 * @see pkgmgrinfo_appinfo_is_multiple()
3597 static int get_component_type(const char *appid)
3600 char *component_type = NULL;
3601 pkgmgrinfo_appinfo_h handle;
3602 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3603 if (ret != PMINFO_R_OK)
3605 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3606 if (ret != PMINFO_R_OK) {
3607 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3610 printf("component_type: %s\n", component_type);
3611 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3616 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3619 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3620 * @brief This API gets the application 'hwacceleration' value from the app ID
3622 * @par This API is for package-manager client application
3623 * @par Sync (or) Async : Synchronous API
3625 * @param[in] handle pointer to application info handle
3626 * @param[out] hwacceleration pointer to hold package hwacceleration value
3627 * @return 0 if success, error code(<0) if fail
3628 * @retval PMINFO_R_OK success
3629 * @retval PMINFO_R_EINVAL invalid argument
3630 * @retval PMINFO_R_ERROR internal error
3631 * @pre pkgmgrinfo_appinfo_get_appinfo()
3632 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3633 * @see pkgmgrinfo_appinfo_get_appid()
3634 * @see pkgmgrinfo_appinfo_is_multiple()
3636 static int get_app_hwacceleration(const char *appid)
3639 pkgmgrinfo_app_hwacceleration hwacceleration;
3640 pkgmgrinfo_appinfo_h handle;
3641 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3642 if (ret != PMINFO_R_OK)
3644 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3645 if (ret != PMINFO_R_OK) {
3646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3649 printf("app hwacceleration: %d\n", hwacceleration);
3650 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3655 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3658 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3659 * @brief This API gets the application 'screenreader' value from the app ID
3661 * @par This API is for package-manager client application
3662 * @par Sync (or) Async : Synchronous API
3664 * @param[in] handle pointer to application info handle
3665 * @param[out] screenreader pointer to hold package accessibility value
3666 * @return 0 if success, error code(<0) if fail
3667 * @retval PMINFO_R_OK success
3668 * @retval PMINFO_R_EINVAL invalid argument
3669 * @retval PMINFO_R_ERROR internal error
3670 * @pre pkgmgrinfo_appinfo_get_appinfo()
3671 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3672 * @see pkgmgrinfo_appinfo_get_appid()
3673 * @see pkgmgrinfo_appinfo_is_multiple()
3675 static int get_app_screenreader(const char *appid)
3678 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3679 pkgmgrinfo_appinfo_h handle = NULL;
3680 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3681 if (ret != PMINFO_R_OK)
3683 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3684 if (ret != PMINFO_R_OK) {
3685 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3688 printf("app screenreader: %d\n", screenreader);
3689 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3694 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3697 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3698 * @brief This API gets the application's landscape & portrait effect images
3700 * @par This API is for package-manager client application
3701 * @par Sync (or) Async : Synchronous API
3703 * @param[in] handle pointer to application info handle
3704 * @param[out] portrait_img contains portrait mode effect image
3705 * @param[out] landscape_img contains landscape mode effect image
3706 * @return 0 if success, error code(<0) if fail
3707 * @retval PMINFO_R_OK success
3708 * @retval PMINFO_R_EINVAL invalid argument
3709 * @retval PMINFO_R_ERROR internal error
3710 * @pre pkgmgrinfo_appinfo_get_appinfo()
3711 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3712 * @see pkgmgrinfo_appinfo_get_appid()
3713 * @see pkgmgrinfo_appinfo_is_nodisplay()
3715 static int get_app_effectimages(const char *appid)
3718 char *portraitimg = NULL;
3719 char *landscapeimg = NULL;
3720 pkgmgrinfo_appinfo_h handle;
3721 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3722 if (ret != PMINFO_R_OK)
3724 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3725 if (ret != PMINFO_R_OK) {
3726 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3729 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3730 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3735 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3738 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3739 * @brief This API gets the application's effect image type
3741 * @par This API is for package-manager client application
3742 * @par Sync (or) Async : Synchronous API
3744 * @param[in] handle pointer to application info handle
3745 * @param[out] effectimg_type contains effect image type
3746 * @return 0 if success, error code(<0) if fail
3747 * @retval PMINFO_R_OK success
3748 * @retval PMINFO_R_EINVAL invalid argument
3749 * @retval PMINFO_R_ERROR internal error
3750 * @pre pkgmgrinfo_appinfo_get_appinfo()
3751 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3752 * @see pkgmgrinfo_appinfo_get_appid()
3753 * @see pkgmgrinfo_appinfo_is_nodisplay()
3755 static int get_app_effectimage_type(const char *appid)
3758 char *effectimg_type = NULL;
3759 pkgmgrinfo_appinfo_h handle = NULL;
3760 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3761 if (ret != PMINFO_R_OK)
3763 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3764 if (ret != PMINFO_R_OK) {
3765 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3768 printf("app effect image type: %s\n", effectimg_type);
3769 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3774 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3777 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3778 * @brief This API gets the submode_mainid of the application
3780 * @par This API is for package-manager client application
3781 * @par Sync (or) Async : Synchronous API
3783 * @param[in] handle pointer to the application info handle.
3784 * @param[out] submode_mainid pointer to hold package name
3785 * @return 0 if success, error code(<0) if fail
3786 * @retval PMINFO_R_OK success
3787 * @retval PMINFO_R_EINVAL invalid argument
3788 * @retval PMINFO_R_ERROR internal error
3789 * @pre pkgmgrinfo_appinfo_get_appinfo()
3790 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3791 * @see pkgmgrinfo_appinfo_get_appid()
3792 * @see pkgmgrinfo_appinfo_is_multiple()
3794 static int get_app_submode_mainid(const char *appid)
3797 char *submode_mainid = NULL;
3798 pkgmgrinfo_appinfo_h handle = NULL;
3799 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3800 if (ret != PMINFO_R_OK)
3802 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3803 if (ret != PMINFO_R_OK) {
3804 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3807 printf("submode_mainid: %s\n", submode_mainid);
3808 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3813 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3816 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3817 * @brief This API gets the datacontrol info
3819 * @par This API is for package-manager client application
3820 * @par Sync (or) Async : Synchronous API
3822 * @param[in] providerid pointer to the providerid of dataconltrol.
3823 * @param[in] type pointer to the type of dataconltrol.
3824 * @param[out] appid pointer to hold appid, need to free after using
3825 * @param[out] access pointer to hold access, need to free after using
3826 * @return 0 if success, error code(<0) if fail
3827 * @retval PMINFO_R_OK success
3828 * @retval PMINFO_R_EINVAL invalid argument
3829 * @retval PMINFO_R_ERROR internal error
3832 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3833 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3836 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3837 * @brief This API gets the appid of datacontrol
3839 * @par This API is for package-manager client application
3840 * @par Sync (or) Async : Synchronous API
3842 * @param[in] providerid pointer to the providerid of dataconltrol.
3843 * @param[out] appid pointer to hold appid, need to free after using
3844 * @return 0 if success, error code(<0) if fail
3845 * @retval PMINFO_R_OK success
3846 * @retval PMINFO_R_EINVAL invalid argument
3847 * @retval PMINFO_R_ERROR internal error
3850 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3851 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3854 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3855 * @brief This API gets the information about trusted datacontrol
3857 * @par This API is for package-manager client application
3858 * @par Sync (or) Async : Synchronous API
3860 * @param[in] providerid pointer to the providerid of datacontrol.
3861 * @param[out] appid pointer to hold appid, need to free after using
3862 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3863 * @return 0 if success, error code(<0) if fail
3864 * @retval PMINFO_R_OK success
3865 * @retval PMINFO_R_EINVAL invalid argument
3866 * @retval PMINFO_R_ERROR internal error
3869 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3870 const char *type, char **appid, bool *is_trusted);
3871 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3872 const char *type, uid_t uid, char **appid, bool *is_trusted);
3875 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3876 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3877 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3879 * @par This API is for package-manager client application
3880 * @par Sync (or) Async : Synchronous API
3882 * @param[in] providerid pointer to the providerid of datacontrol.
3883 * @param[in] type pointer to the type of dataconltrol.
3884 * @param[in] privilege_func callback function for list
3885 * @param[in] user_data user data to be passed to callback function
3886 * @return 0 if success, error code(<0) if fail
3887 * @retval PMINFO_R_OK success
3888 * @retval PMINFO_R_EINVAL invalid argument
3889 * @retval PMINFO_R_ERROR internal error
3891 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3892 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3893 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3894 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3897 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3898 * @brief This API gets the alias_appid of the application
3900 * @par This API is for package-manager client application
3901 * @par Sync (or) Async : Synchronous API
3903 * @param[in] handle pointer to the application info handle.
3904 * @param[out] alias_appid pointer to hold app alias_appid
3905 * @return 0 if success, error code(<0) if fail
3906 * @retval PMINFO_R_OK success
3907 * @retval PMINFO_R_EINVAL invalid argument
3908 * @retval PMINFO_R_ERROR internal error
3909 * @pre pkgmgrinfo_appinfo_get_appinfo()
3910 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3911 * @see pkgmgrinfo_appinfo_get_appid()
3913 static int get_alias_appid(const char *appid)
3916 char *alias_appid= 0;
3917 pkgmgrinfo_appinfo_h handle = NULL;
3918 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3919 if (ret != PMINFO_R_OK)
3921 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3922 if (ret != PMINFO_R_OK) {
3923 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3926 printf("alias_appid: %s\n", alias_appid);
3927 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3932 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3935 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3936 * @brief This API gets the effective_appid of the application
3938 * @par This API is for package-manager client application
3939 * @par Sync (or) Async : Synchronous API
3941 * @param[in] handle pointer to the application info handle.
3942 * @param[out] effective_appid pointer to hold app effective_appid
3943 * @return 0 if success, error code(<0) if fail
3944 * @retval PMINFO_R_OK success
3945 * @retval PMINFO_R_EINVAL invalid argument
3946 * @retval PMINFO_R_ERROR internal error
3947 * @pre pkgmgrinfo_appinfo_get_appinfo()
3948 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3949 * @see pkgmgrinfo_appinfo_get_appid()
3951 static int get_effective_appid(const char *appid)
3954 char *effective_appid= 0;
3955 pkgmgrinfo_appinfo_h handle = NULL;
3956 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3957 if (ret != PMINFO_R_OK)
3959 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3960 if (ret != PMINFO_R_OK) {
3961 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3964 printf("effective_appid: %s\n", effective_appid);
3965 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3970 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3973 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3974 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3976 * @par This API is for package-manager client application
3977 * @par Sync (or) Async : Synchronous API
3979 * @param[in] handle pointer to the appinfo handle.
3980 * @param[out] tep_name pointer to hold tep name
3981 * @return 0 if success, error code(<0) if fail
3982 * @retval PMINFO_R_OK success
3983 * @retval PMINFO_R_EINVAL invalid argument
3984 * @retval PMINFO_R_ERROR internal error
3985 * @pre pkgmgrinfo_appinfo_get_appinfo()
3986 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3987 * @see pkgmgrinfo_appinfo_get_appid()
3989 static int get_tep_name(const char *appid)
3992 char *tep_name = NULL;
3993 pkgmgrinfo_appinfo_h handle = NULL;
3994 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3995 if (ret != PMINFO_R_OK)
3997 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3998 if (ret != PMINFO_R_OK) {
3999 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4002 printf("TEP name is: %s\n", tep_name);
4003 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4008 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4011 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4012 * @brief This API gets zip mount file name associated with the package which contain given application
4013 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4015 * @par This API is for package-manager client application
4016 * @par Sync (or) Async : Synchronous API
4018 * @param[in] handle pointer to the appinfo handle.
4019 * @param[out] zip_mount_file pointer to hold zip mount file name
4020 * @return 0 if success, error code(<0) if fail
4021 * @retval PMINFO_R_OK success
4022 * @retval PMINFO_R_EINVAL invalid argument
4023 * @retval PMINFO_R_ERROR internal error
4024 * @pre pkgmgrinfo_appinfo_get_appinfo()
4025 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4026 * @see pkgmgrinfo_appinfo_get_appid()
4028 static int get_zip_mount_file(const char *appid)
4031 char *zip_mount_file = NULL;
4032 pkgmgrinfo_appinfo_h handle = NULL;
4033 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4034 if (ret != PMINFO_R_OK)
4036 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4037 if (ret != PMINFO_R_OK) {
4038 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4041 printf("Mount file name is: %s\n", zip_mount_file);
4042 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4047 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4050 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4051 * @brief This API gets the root path of application
4053 * @par Sync (or) Async : Synchronous API
4055 * @param[in] handle pointer to appinfo handle
4056 * @param[out] path pointer to hold root path of application
4057 * @return 0 if success, error code(<0) if fail
4058 * @retval PMINFO_R_OK success
4059 * @retval PMINFO_R_EINVAL invalid argument
4060 * @retval PMINFO_R_ERROR internal error
4062 static int get_root_path(const char *appid)
4066 pkgmgrinfo_appinfo_h handle;
4067 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4068 if (ret != PMINFO_R_OK)
4071 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4072 if (ret != PMINFO_R_OK) {
4073 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4076 printf("path : %s\n", path);
4077 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4083 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4086 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4087 * @brief This API gets the application api_version from the application ID
4089 * @par This API is for package-manager client application
4090 * @par Sync (or) Async : Synchronous API
4092 * @param[in] handle pointer to appinfo handle
4093 * @param[out] api_version pointer to hold application api_version
4094 * @return 0 if success, error code(<0) if fail
4095 * @retval PMINFO_R_OK success
4096 * @retval PMINFO_R_EINVAL invalid argument
4097 * @retval PMINFO_R_ERROR internal error
4098 * @pre pkgmgrinfo_appinfo_get_appinfo()
4099 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4100 * @see pkgmgrinfo_appinfo_get_appid()
4102 static int get_app_api_version(const char *appid)
4105 char *api_version = NULL;
4106 pkgmgrinfo_appinfo_h handle = NULL;
4107 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4108 if (ret != PMINFO_R_OK)
4110 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4111 if (ret != PMINFO_R_OK) {
4112 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4115 printf("app api_version: %s\n", api_version);
4116 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4121 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4124 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4125 * @brief This API gets the installed_time of the application
4127 * @par This API is for package-manager client application
4128 * @par Sync (or) Async : Synchronous API
4130 * @param[in] handle pointer to the application info handle.
4131 * @param[out] installed_time pointer to hold installed_time
4132 * @return 0 if success, error code(<0) if fail
4133 * @retval PMINFO_R_OK success
4134 * @retval PMINFO_R_EINVAL invalid argument
4135 * @retval PMINFO_R_ERROR internal error
4136 * @pre pkgmgrinfo_appinfo_get_appinfo()
4137 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4138 * @see pkgmgrinfo_appinfo_get_appid()
4139 * @see pkgmgrinfo_appinfo_is_multiple()
4141 static int get_app_installed_time(const char *appid)
4144 int installed_time = 0;
4145 pkgmgrinfo_appinfo_h handle = NULL;
4146 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4147 if (ret != PMINFO_R_OK)
4149 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4150 if (ret != PMINFO_R_OK) {
4151 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4154 printf("installed_time: %d\n", installed_time);
4155 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4160 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4163 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4164 * @brief This API gets the support_mode of the application
4166 * @par This API is for package-manager client application
4167 * @par Sync (or) Async : Synchronous API
4169 * @param[in] handle pointer to the application info handle.
4170 * @param[out] support_mode pointer to hold app support_mode
4171 * @return 0 if success, error code(<0) if fail
4172 * @retval PMINFO_R_OK success
4173 * @retval PMINFO_R_EINVAL invalid argument
4174 * @retval PMINFO_R_ERROR internal error
4175 * @pre pkgmgrinfo_appinfo_get_appinfo()
4176 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4177 * @see pkgmgrinfo_appinfo_get_appid()
4179 static int get_app_support_mode(const char *appid)
4182 int support_mode = 0;
4183 pkgmgrinfo_appinfo_h handle = NULL;
4184 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4185 if (ret != PMINFO_R_OK)
4187 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4188 if (ret != PMINFO_R_OK) {
4189 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4192 printf("support_mode: %s\n", support_mode);
4193 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4198 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4202 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4203 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4204 * @brief This API gets the list of category for a particular application
4206 * @par This API is for package-manager client application
4207 * @par Sync (or) Async : Synchronous API
4208 * @param[in] handle pointer to the application info handle.
4209 * @param[in] category_func callback function for list
4210 * @param[in] user_data user data to be passed to callback function
4211 * @return 0 if success, error code(<0) if fail
4212 * @retval PMINFO_R_OK success
4213 * @retval PMINFO_R_EINVAL invalid argument
4214 * @retval PMINFO_R_ERROR internal error
4215 * @pre pkgmgrinfo_appinfo_get_appinfo()
4216 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4218 int category_func(const char *name, void *user_data)
4220 if (strcmp(name, (char *)user_data) == 0)
4226 static int list_category(const char *appid, char *category)
4229 pkgmgrinfo_appinfo_h handle;
4230 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4231 if (ret != PMINFO_R_OK)
4233 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4234 if (ret != PMINFO_R_OK) {
4235 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4238 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4243 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4244 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4247 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4248 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4249 * @brief This API gets the list of metadata for a particular application
4251 * @par This API is for package-manager client application
4252 * @par Sync (or) Async : Synchronous API
4253 * @param[in] handle pointer to the application info handle.
4254 * @param[in] metadata_func callback function for list
4255 * @param[in] user_data user data to be passed to callback function
4256 * @return 0 if success, error code(<0) if fail
4257 * @retval PMINFO_R_OK success
4258 * @retval PMINFO_R_EINVAL invalid argument
4259 * @retval PMINFO_R_ERROR internal error
4260 * @pre pkgmgrinfo_appinfo_get_appinfo()
4261 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4263 int metadata_func(const char *key, const char *value, void *user_data)
4265 if (strcmp(key, (char *)user_data) == 0) {
4266 printf("Value is %s\n", value);
4273 static int list_metadata(const char *appid, char *key)
4276 pkgmgrinfo_appinfo_h handle;
4277 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4278 if (ret != PMINFO_R_OK)
4280 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4281 if (ret != PMINFO_R_OK) {
4282 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4285 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4290 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4291 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4294 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4295 * const char *operation,
4296 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4298 * @brief This API gets the list of privileges for a particular
4299 * appllication's app_control
4301 * @par This API is for package-manager client application
4302 * @par Sync (or) Async : Synchronous API
4303 * @param[in] appid application id
4304 * @param[in] operation operation of appcontrol
4305 * @param[in] privilege_func callback function for list
4306 * @param[in] user_data user data to be passed to callback function
4307 * @return 0 if success, error code(<0) if fail
4308 * @retval PMINFO_R_OK success
4309 * @retval PMINFO_R_EINVAL invalid argument
4310 * @retval PMINFO_R_ERROR internal error
4312 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4313 const char *operation,
4314 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4315 void *user_data, uid_t uid);
4316 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4317 const char *operation,
4318 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4322 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4323 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4324 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4325 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4326 * @brief This API gets the list of app-control for a particular application
4328 * @par This API is for package-manager client application
4329 * @par Sync (or) Async : Synchronous API
4330 * @param[in] handle pointer to the application info handle.
4331 * @param[in] appcontrol_func callback function for list
4332 * @param[in] user_data user data to be passed to callback function
4333 * @param[in] uid the addressee user id of the instruction
4334 * @return 0 if success, error code(<0) if fail
4335 * @retval PMINFO_R_OK success
4336 * @retval PMINFO_R_EINVAL invalid argument
4337 * @retval PMINFO_R_ERROR internal error
4338 * @pre pkgmgrinfo_appinfo_get_appinfo()
4339 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4341 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4346 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4347 for (i = 0; i < oc; i++) {
4348 if (strcmp(operation[i], (char *)user_data) == 0)
4355 static int check_operation(const char *appid, char *operation)
4358 pkgmgrinfo_appinfo_h handle;
4359 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4360 if (ret != PMINFO_R_OK)
4362 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4363 if (ret != PMINFO_R_OK) {
4364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4367 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4372 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4373 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4375 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4376 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4381 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4382 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4385 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4386 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4387 * @brief This API gets the list of splashscreen for a particular application
4389 * @par This API is for package-manager client application
4390 * @par Sync (or) Async : Synchronous API
4391 * @param[in] handle pointer to the application info handle.
4392 * @param[in] splash_screen_func callback function for list
4393 * @param[in] user_data user data to be passed to callback function
4394 * @return 0 if success, error code(<0) if fail
4395 * @retval PMINFO_R_OK success
4396 * @retval PMINFO_R_EINVAL invalid argument
4397 * @retval PMINFO_R_ERROR internal error
4398 * @pre pkgmgrinfo_appinfo_get_appinfo()
4399 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4402 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4403 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4406 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4407 * @brief This API gets the application 'nodisplay' value from the app ID
4409 * @par This API is for package-manager client application
4410 * @par Sync (or) Async : Synchronous API
4412 * @param[in] handle pointer to application info handle
4413 * @param[out] nodisplay pointer to hold package nodisplay value
4414 * @return 0 if success, error code(<0) if fail
4415 * @retval PMINFO_R_OK success
4416 * @retval PMINFO_R_EINVAL invalid argument
4417 * @retval PMINFO_R_ERROR internal error
4418 * @pre pkgmgrinfo_appinfo_get_appinfo()
4419 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4420 * @see pkgmgrinfo_appinfo_get_appid()
4421 * @see pkgmgrinfo_appinfo_is_multiple()
4423 static int get_app_nodisplay(const char *appid)
4427 pkgmgrinfo_appinfo_h handle;
4428 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4429 if (ret != PMINFO_R_OK)
4431 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4432 if (ret != PMINFO_R_OK) {
4433 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4436 printf("app nodisplay: %d\n", nodisplay);
4437 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4442 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4445 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4446 * @brief This API gets the application 'multiple' value from the app ID
4448 * @par This API is for package-manager client application
4449 * @par Sync (or) Async : Synchronous API
4451 * @param[in] handle pointer to application info handle
4452 * @param[out] multiple pointer to hold package multiple value
4453 * @return 0 if success, error code(<0) if fail
4454 * @retval PMINFO_R_OK success
4455 * @retval PMINFO_R_EINVAL invalid argument
4456 * @retval PMINFO_R_ERROR internal error
4457 * @pre pkgmgrinfo_appinfo_get_appinfo()
4458 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4459 * @see pkgmgrinfo_appinfo_get_appid()
4460 * @see pkgmgrinfo_appinfo_is_nodisplay()
4462 static int get_app_multiple(const char *appid)
4466 pkgmgrinfo_appinfo_h handle;
4467 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4468 if (ret != PMINFO_R_OK)
4470 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4471 if (ret != PMINFO_R_OK) {
4472 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4475 printf("app multiple: %d\n", multiple);
4476 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4481 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4484 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4485 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4486 * application launching effect. If fales, indicator will be hidden during application launching effect
4488 * @par This API is for package-manager client application
4489 * @par Sync (or) Async : Synchronous API
4491 * @param[in] handle pointer to application info handle
4492 * @param[out] indicator_disp contains indicator display status for application launching effect
4493 * @return 0 if success, error code(<0) if fail
4494 * @retval PMINFO_R_OK success
4495 * @retval PMINFO_R_EINVAL invalid argument
4496 * @retval PMINFO_R_ERROR internal error
4497 * @pre pkgmgrinfo_appinfo_get_appinfo()
4498 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4499 * @see pkgmgrinfo_appinfo_get_appid()
4500 * @see pkgmgrinfo_appinfo_is_nodisplay()
4502 static int get_app_indicator_display(const char *appid)
4505 bool indicator_disp;
4506 pkgmgrinfo_appinfo_h handle;
4507 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4508 if (ret != PMINFO_R_OK)
4510 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4511 if (ret != PMINFO_R_OK){
4512 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4515 printf("app indicator disp : %d\n", indicator_disp);
4516 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4521 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4524 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4525 * @brief This API gets the application 'taskmanage' value from the app ID
4527 * @par This API is for package-manager client application
4528 * @par Sync (or) Async : Synchronous API
4530 * @param[in] handle pointer to application info handle
4531 * @param[out] taskmanage pointer to hold package taskmanage value
4532 * @return 0 if success, error code(<0) if fail
4533 * @retval PMINFO_R_OK success
4534 * @retval PMINFO_R_EINVAL invalid argument
4535 * @retval PMINFO_R_ERROR internal error
4536 * @pre pkgmgrinfo_appinfo_get_appinfo()
4537 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4538 * @see pkgmgrinfo_appinfo_get_appid()
4539 * @see pkgmgrinfo_appinfo_is_multiple()
4541 static int get_app_taskmanage(const char *appid)
4545 pkgmgrinfo_appinfo_h handle;
4546 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4547 if (ret != PMINFO_R_OK)
4549 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4550 if (ret != PMINFO_R_OK) {
4551 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4554 printf("app taskmanage: %d\n", taskmanage);
4555 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4560 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4563 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4564 * @brief This API gets the application 'taskmanage' value from the app ID
4566 * @par This API is for package-manager client application
4567 * @par Sync (or) Async : Synchronous API
4569 * @param[in] handle pointer to application info handle
4570 * @param[out] enabled pointer to hold package enabled value
4571 * @return 0 if success, error code(<0) if fail
4572 * @retval PMINFO_R_OK success
4573 * @retval PMINFO_R_EINVAL invalid argument
4574 * @retval PMINFO_R_ERROR internal error
4575 * @pre pkgmgrinfo_appinfo_get_appinfo()
4576 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4577 * @see pkgmgrinfo_appinfo_get_appid()
4578 * @see pkgmgrinfo_appinfo_is_multiple()
4580 static int get_app_enabled(const char *appid)
4584 pkgmgrinfo_appinfo_h handle;
4585 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4586 if (ret != PMINFO_R_OK)
4588 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4589 if (ret != PMINFO_R_OK) {
4590 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4593 printf("app enabled: %d\n", enabled);
4594 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4599 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4602 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4603 * @brief This API gets the application 'onboot' value from the app ID
4605 * @par This API is for package-manager client application
4606 * @par Sync (or) Async : Synchronous API
4608 * @param[in] handle pointer to application info handle
4609 * @param[out] onboot pointer to hold package onboot value
4610 * @return 0 if success, error code(<0) if fail
4611 * @retval PMINFO_R_OK success
4612 * @retval PMINFO_R_EINVAL invalid argument
4613 * @retval PMINFO_R_ERROR internal error
4614 * @pre pkgmgrinfo_appinfo_get_appinfo()
4615 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4616 * @see pkgmgrinfo_appinfo_get_appid()
4617 * @see pkgmgrinfo_appinfo_is_multiple()
4619 static int get_app_onboot(const char *appid)
4623 pkgmgrinfo_appinfo_h handle;
4624 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4625 if (ret != PMINFO_R_OK)
4627 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4628 if (ret != PMINFO_R_OK) {
4629 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4632 printf("app onboot: %d\n", onboot);
4633 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4638 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4641 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4642 * @brief This API gets the application 'autorestart' value from the app ID
4644 * @par This API is for package-manager client application
4645 * @par Sync (or) Async : Synchronous API
4647 * @param[in] handle pointer to application info handle
4648 * @param[out] autorestart pointer to hold package autorestart value
4649 * @return 0 if success, error code(<0) if fail
4650 * @retval PMINFO_R_OK success
4651 * @retval PMINFO_R_EINVAL invalid argument
4652 * @retval PMINFO_R_ERROR internal error
4653 * @pre pkgmgrinfo_appinfo_get_appinfo()
4654 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4655 * @see pkgmgrinfo_appinfo_get_appid()
4656 * @see pkgmgrinfo_appinfo_is_multiple()
4658 static int get_app_autorestart(const char *appid)
4662 pkgmgrinfo_appinfo_h handle;
4663 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4664 if (ret != PMINFO_R_OK)
4666 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4667 if (ret != PMINFO_R_OK) {
4668 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4671 printf("app autorestart: %d\n", autorestart);
4672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4677 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4680 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4681 * @brief This API gets the value for given application is main app or not from handle
4683 * @par This API is for package-manager client application
4684 * @par Sync (or) Async : Synchronous API
4686 * @param[in] handle pointer to application info handle
4687 * @param[out] mainapp pointer to hold package mainapp is or not
4688 * @return 0 if success, error code(<0) if fail
4689 * @retval PMINFO_R_OK success
4690 * @retval PMINFO_R_EINVAL invalid argument
4691 * @retval PMINFO_R_ERROR internal error
4692 * @pre pkgmgrinfo_appinfo_get_appinfo()
4693 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4694 * @see pkgmgrinfo_appinfo_get_appid()
4695 * @see pkgmgrinfo_appinfo_is_multiple()
4697 static int get_app_mainapp(const char *appid)
4701 pkgmgrinfo_appinfo_h handle;
4702 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4703 if (ret != PMINFO_R_OK)
4705 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4706 if (ret != PMINFO_R_OK) {
4707 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4710 printf("mainapp: %d\n", mainapp);
4711 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4716 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4720 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4721 * @brief This API gets the value for given application is preload or not from handle
4723 * @par This API is for package-manager client application
4724 * @par Sync (or) Async : Synchronous API
4726 * @param[in] handle pointer to application info handle
4727 * @param[out] preload pointer to hold preload is or not
4728 * @return 0 if success, error code(<0) if fail
4729 * @retval PMINFO_R_OK success
4730 * @retval PMINFO_R_EINVAL invalid argument
4731 * @retval PMINFO_R_ERROR internal error
4732 * @pre pkgmgrinfo_appinfo_get_appinfo()
4733 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4734 * @see pkgmgrinfo_appinfo_get_appid()
4735 * @see pkgmgrinfo_appinfo_is_multiple()
4737 static int get_app_preload(const char *appid)
4741 pkgmgrinfo_appinfo_h handle = NULL;
4742 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4743 if (ret != PMINFO_R_OK)
4745 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4746 if (ret != PMINFO_R_OK) {
4747 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4750 printf("preload: %d\n", preload);
4751 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4756 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4759 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4760 * @brief This API gets the value for given application is submode or not from handle
4762 * @par This API is for package-manager client application
4763 * @par Sync (or) Async : Synchronous API
4765 * @param[in] handle pointer to application info handle
4766 * @param[out] submode pointer to hold submode is or not
4767 * @return 0 if success, error code(<0) if fail
4768 * @retval PMINFO_R_OK success
4769 * @retval PMINFO_R_EINVAL invalid argument
4770 * @retval PMINFO_R_ERROR internal error
4771 * @pre pkgmgrinfo_appinfo_get_appinfo()
4772 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4773 * @see pkgmgrinfo_appinfo_get_appid()
4774 * @see pkgmgrinfo_appinfo_is_multiple()
4776 static int get_app_submode(const char *appid)
4780 pkgmgrinfo_appinfo_h handle = NULL;
4781 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4782 if (ret != PMINFO_R_OK)
4784 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4785 if (ret != PMINFO_R_OK) {
4786 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4789 printf("submode: %d\n", submode);
4790 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4795 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4798 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4799 * @brief This API gets the value for given application is process_pool or not from handle
4801 * @par This API is for package-manager client application
4802 * @par Sync (or) Async : Synchronous API
4804 * @param[in] handle pointer to application info handle
4805 * @param[out] process_pool pointer to hold process_pool is or not
4806 * @return 0 if success, error code(<0) if fail
4807 * @retval PMINFO_R_OK success
4808 * @retval PMINFO_R_EINVAL invalid argument
4809 * @retval PMINFO_R_ERROR internal error
4810 * @pre pkgmgrinfo_appinfo_get_appinfo()
4811 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4812 * @see pkgmgrinfo_appinfo_get_appid()
4814 static int get_app_process_pool(const char *appid)
4817 bool process_pool = 0;
4818 pkgmgrinfo_appinfo_h handle = NULL;
4819 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4820 if (ret != PMINFO_R_OK)
4822 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4823 if (ret != PMINFO_R_OK) {
4824 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4827 printf("process_pool: %d\n", process_pool);
4828 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4833 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4836 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4837 * @brief This API gets the installed storage location of the application
4839 * @par This API is for package-manager client application
4840 * @par Sync (or) Async : Synchronous API
4842 * @param[in] handle pointer to the application info handle.
4843 * @param[out] app_type pointer to hold installed storage location
4844 * @return 0 if success, error code(<0) if fail
4845 * @retval PMINFO_R_OK success
4846 * @retval PMINFO_R_EINVAL invalid argument
4847 * @retval PMINFO_R_ERROR internal error
4848 * @pre pkgmgrinfo_appinfo_get_appinfo()
4849 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4850 * @see pkgmgrinfo_appinfo_get_appid()
4852 static int get_app_installed_location(const char *appid)
4855 pkgmgrinfo_installed_storage storage;
4856 pkgmgrinfo_appinfo_h handle = NULL;
4857 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4858 if (ret != PMINFO_R_OK)
4860 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4861 if (ret != PMINFO_R_OK) {
4862 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4865 printf("Installed storage location : %d\n", storage);
4866 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4871 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4875 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4876 * @brief This API checks if the application has the given category
4878 * @par This API is for package-manager client application
4879 * @par Sync (or) Async : Synchronous API
4881 * @param[in] handle pointer to the application info handle
4882 * @param[in] category category
4883 * @param[out] exist value Gets whether the application has the given category
4884 * @return 0 if success, error code(<0) if fail
4885 * @retval PMINFO_R_OK success
4886 * @retval PMINFO_R_EINVAL invalid argument
4887 * @retval PMINFO_R_ERROR internal error
4889 static int is_category_exist(const char *appid, const char *category)
4892 pkgmgrinfo_appinfo_h handle;
4895 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4896 if (ret != PMINFO_R_OK)
4899 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4900 if (ret != PMINFO_R_OK) {
4901 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4910 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4913 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4914 * @brief This API gets the application 'ui_gadget' value from the app ID
4916 * @par This API is for package-manager client application
4917 * @par Sync (or) Async : Synchronous API
4919 * @param[in] handle pointer to application info handle
4920 * @param[out] ui_gadget pointer to hold package ui_gadget value
4921 * @return 0 if success, error code(<0) if fail
4922 * @retval PMINFO_R_OK success
4923 * @retval PMINFO_R_EINVAL invalid argument
4924 * @pre pkgmgrinfo_appinfo_get_appinfo()
4925 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4927 static int get_app_ui_gadget(const char *appid)
4931 pkgmgrinfo_appinfo_h handle = NULL;
4932 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4933 if (ret != PMINFO_R_OK)
4935 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4936 if (ret != PMINFO_R_OK) {
4937 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4940 printf("app ui_gadget: %d\n", ui_gadget);
4941 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4946 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4949 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4950 * @brief This API gets the application 'support_disable' value from the app ID
4952 * @par This API is for package-manager client application
4953 * @par Sync (or) Async : Synchronous API
4955 * @param[in] handle pointer to application info handle
4956 * @param[out] support_disable pointer to hold package support_disable value
4957 * @return 0 if success, error code(<0) if fail
4958 * @retval PMINFO_R_OK success
4959 * @retval PMINFO_R_EINVAL invalid argument
4960 * @pre pkgmgrinfo_appinfo_get_appinfo()
4961 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4963 static int get_app_support_disable(const char *appid)
4966 bool support_disable;
4967 pkgmgrinfo_appinfo_h handle = NULL;
4968 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4969 if (ret != PMINFO_R_OK)
4971 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4972 if (ret != PMINFO_R_OK) {
4973 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4976 printf("app support_disable: %d\n", support_disable);
4977 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4982 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4985 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4986 * @brief This API gets the application 'removable' value from the app ID
4988 * @par This API is for package-manager client application
4989 * @par Sync (or) Async : Synchronous API
4991 * @param[in] handle pointer to application info handle
4992 * @param[out] removable pointer to hold package removable value
4993 * @return 0 if success, error code(<0) if fail
4994 * @retval PMINFO_R_OK success
4995 * @retval PMINFO_R_EINVAL invalid argument
4996 * @retval PMINFO_R_ERROR internal error
4997 * @pre pkgmgrinfo_appinfo_get_appinfo()
4998 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4999 * @see pkgmgrinfo_appinfo_get_appid()
5001 static int get_app_removable(const char *appid)
5005 pkgmgrinfo_appinfo_h handle = NULL;
5006 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5007 if (ret != PMINFO_R_OK)
5009 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5010 if (ret != PMINFO_R_OK) {
5011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5014 printf("app removable: %d\n", removable);
5015 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5020 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5023 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5024 * @brief This API gets the application 'system' value from the app ID
5026 * @par This API is for package-manager client application
5027 * @par Sync (or) Async : Synchronous API
5029 * @param[in] handle pointer to application info handle
5030 * @param[out] system pointer to hold package system value
5031 * @return 0 if success, error code(<0) if fail
5032 * @retval PMINFO_R_OK success
5033 * @retval PMINFO_R_EINVAL invalid argument
5034 * @retval PMINFO_R_ERROR internal error
5035 * @pre pkgmgrinfo_appinfo_get_appinfo()
5036 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5037 * @see pkgmgrinfo_appinfo_get_appid()
5039 static int get_app_system(const char *appid)
5042 bool system = false;
5043 pkgmgrinfo_appinfo_h handle = NULL;
5044 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5045 if (ret != PMINFO_R_OK)
5047 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5048 if (ret != PMINFO_R_OK) {
5049 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5052 printf("app system: %d\n", system);
5053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5058 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5062 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5063 * @brief This API gets the application 'is_disable' value from the app ID
5065 * @par This API is for package-manager client application
5066 * @par Sync (or) Async : Synchronous API
5068 * @param[in] handle pointer to application info handle
5069 * @param[out] disabled pointer to hold application is_disabled value
5070 * @return 0 if success, error code(<0) if fail
5071 * @retval PMINFO_R_OK success
5072 * @retval PMINFO_R_EINVAL invalid argument
5073 * @pre pkgmgrinfo_appinfo_get_appinfo()
5074 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5076 static int get_app_is_disable(const char *appid)
5080 pkgmgrinfo_appinfo_h handle = NULL;
5081 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5082 if (ret != PMINFO_R_OK)
5084 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5085 if (ret != PMINFO_R_OK) {
5086 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5089 printf("app is_disable: %d\n", is_disable);
5090 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5095 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5098 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5099 * @brief This API gets whethere the given application is global application or user application
5101 * @par This API is for package-manager client application
5102 * @par Sync (or) Async : Synchronous API
5104 * @param[in] handle pointer to application info handle
5105 * @param[in] global pointer to hold application global value
5106 * @return 0 if success, error code(<0) if fail
5107 * @retval PMINFO_R_OK success
5108 * @retval PMINFO_R_EINVAL invalid argument
5109 * @retval PMINFO_R_ERROR internal error
5110 * @pre pkgmgrinfo_appinfo_get_appinfo()
5111 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5112 * @see pkgmgrinfo_appinfo_get_appid()
5113 static int get_app_is_global(const char *appid)
5117 pkgmgrinfo_appinfo_h handle = NULL;
5118 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5119 if (ret != PMINFO_R_OK)
5121 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5122 if (ret != PMINFO_R_OK) {
5123 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5126 printf("app is_global: %d\n", global);
5127 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5132 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5135 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5136 * @brief This API gets the application 'splash_screen_display' value from the app ID
5138 * @par This API is for package-manager client application
5139 * @par Sync (or) Async : Synchronous API
5141 * @param[in] handle pointer to application info handle
5142 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5143 * @return 0 if success, error code(<0) if fail
5144 * @retval PMINFO_R_OK success
5145 * @retval PMINFO_R_EINVAL invalid argument
5146 * @retval PMINFO_R_ERROR internal error
5148 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5151 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5152 * @brief This API gets the application 'setup_appid' value from the app ID
5154 * @par This API is for package-manager client application
5155 * @par Sync (or) Async : Synchronous API
5157 * @param[in] handle pointer to application info handle
5158 * @param[out] setup_appid pointer to hold package setup_appid value
5159 * @return 0 if success, error code(<0) if fail
5160 * @retval PMINFO_R_OK success
5161 * @retval PMINFO_R_EINVAL invalid argument
5162 * @retval PMINFO_R_ERROR internal error
5164 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5167 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5168 * @brief This API gets the application 'support_ambient' value from the app ID
5170 * @par This API is for package-manager client application
5171 * @par Sync (or) Async : Synchronous API
5173 * @param[in] handle pointer to application info handle
5174 * @param[out] support_ambient pointer to hold package support_ambient value
5175 * @return 0 if success, error code(<0) if fail
5176 * @retval PMINFO_R_OK success
5177 * @retval PMINFO_R_EINVAL invalid argument
5178 * @retval PMINFO_R_ERROR internal error
5180 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5183 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5184 * @brief This API destroys the application information handle freeing up all the resources
5186 * @par This API is for package-manager client application
5187 * @par Sync (or) Async : Synchronous API
5189 * @param[in] handle pointer to the application info handle.
5190 * @return 0 if success, error code(<0) if fail
5191 * @retval PMINFO_R_OK success
5192 * @retval PMINFO_R_EINVAL invalid argument
5193 * @retval PMINFO_R_ERROR internal error
5194 * @pre pkgmgrinfo_appinfo_get_appinfo()
5196 * @see pkgmgrinfo_appinfo_get_pkgid()
5197 * @see pkgmgrinfo_appinfo_is_multiple()
5199 static int get_app_type(const char *appid)
5203 pkgmgrinfo_appinfo_h handle;
5204 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5205 if (ret != PMINFO_R_OK)
5207 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5208 if (ret != PMINFO_R_OK) {
5209 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5212 printf("apptype: %s\n", type);
5213 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5218 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5221 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5222 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5223 The query will search the entire application information collected from the manifest file of all the installed packages
5225 * @par This API is for package-manager client application
5226 * @par Sync (or) Async : Synchronous API
5228 * @param[out] handle pointer to the application info filter handle.
5229 * @return 0 if success, error code(<0) if fail
5230 * @retval PMINFO_R_OK success
5231 * @retval PMINFO_R_EINVAL invalid argument
5232 * @retval PMINFO_R_ERROR internal error
5234 * @post pkgmgrinfo_appinfo_filter_destroy()
5235 * @see pkgmgrinfo_appinfo_filter_count()
5236 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5238 static int get_capp_count()
5242 pkgmgrinfo_appinfo_filter_h handle;
5243 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5244 if (ret != PMINFO_R_OK)
5246 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5247 if (ret != PMINFO_R_OK) {
5248 pkgmgrinfo_appinfo_filter_destroy(handle);
5251 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5252 if (ret != PMINFO_R_OK) {
5253 pkgmgrinfo_appinfo_filter_destroy(handle);
5256 printf("No of capp: %d\n", count);
5257 pkgmgrinfo_appinfo_filter_destroy(handle);
5262 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5265 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5266 * @brief This API destroys the application information filter handle freeing up all the resources
5268 * @par This API is for package-manager client application
5269 * @par Sync (or) Async : Synchronous API
5271 * @param[in] handle pointer to the application info filter handle.
5272 * @return 0 if success, error code(<0) if fail
5273 * @retval PMINFO_R_OK success
5274 * @retval PMINFO_R_EINVAL invalid argument
5275 * @retval PMINFO_R_ERROR internal error
5276 * @pre pkgmgrinfo_appinfo_filter_create()
5278 * @see pkgmgrinfo_appinfo_filter_count()
5279 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5281 static int get_capp_count()
5285 pkgmgrinfo_appinfo_filter_h handle;
5286 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5287 if (ret != PMINFO_R_OK)
5289 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5290 if (ret != PMINFO_R_OK) {
5291 pkgmgrinfo_appinfo_filter_destroy(handle);
5294 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5295 if (ret != PMINFO_R_OK) {
5296 pkgmgrinfo_appinfo_filter_destroy(handle);
5299 printf("No of capp: %d\n", count);
5300 pkgmgrinfo_appinfo_filter_destroy(handle);
5305 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5308 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5309 * @brief This API adds a boolean filter property to the filter handle
5311 * @par This API is for package-manager client application
5312 * @par Sync (or) Async : Synchronous API
5314 * @param[in] handle pointer to the application info filter handle.
5315 * @param[in] property boolean property name.
5316 * @param[in] value value corresponding to the property.
5317 * @return 0 if success, error code(<0) if fail
5318 * @retval PMINFO_R_OK success
5319 * @retval PMINFO_R_EINVAL invalid argument
5320 * @retval PMINFO_R_ERROR internal error
5321 * @pre pkgmgrinfo_appinfo_filter_create()
5322 * @post pkgmgrinfo_appinfo_filter_destroy()
5323 * @see pkgmgrinfo_appinfo_filter_count()
5324 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5326 static int get_taskmanageable_app_count()
5330 pkgmgrinfo_appinfo_filter_h handle;
5331 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5332 if (ret != PMINFO_R_OK)
5334 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5335 if (ret != PMINFO_R_OK) {
5336 pkgmgrinfo_appinfo_filter_destroy(handle);
5339 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5340 if (ret != PMINFO_R_OK) {
5341 pkgmgrinfo_appinfo_filter_destroy(handle);
5344 printf("No of taskmanageable apps: %d\n", count);
5345 pkgmgrinfo_appinfo_filter_destroy(handle);
5350 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5351 const char *property, const bool value);
5354 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5355 * @brief This API adds an integer filter property to the filter handle
5357 * @par This API is for package-manager client application
5358 * @par Sync (or) Async : Synchronous API
5360 * @param[in] handle pointer to the application info filter handle.
5361 * @param[in] property integer property name.
5362 * @param[in] value value corresponding to the property.
5363 * @return 0 if success, error code(<0) if fail
5364 * @retval PMINFO_R_OK success
5365 * @retval PMINFO_R_EINVAL invalid argument
5366 * @retval PMINFO_R_ERROR internal error
5367 * @pre pkgmgrinfo_appinfo_filter_create()
5368 * @post pkgmgrinfo_appinfo_filter_destroy()
5369 * @see pkgmgrinfo_appinfo_filter_count()
5370 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5372 static int get_taskmanageable_app_count()
5376 pkgmgrinfo_appinfo_filter_h handle;
5377 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5378 if (ret != PMINFO_R_OK)
5380 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5381 if (ret != PMINFO_R_OK) {
5382 pkgmgrinfo_appinfo_filter_destroy(handle);
5385 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5386 if (ret != PMINFO_R_OK) {
5387 pkgmgrinfo_appinfo_filter_destroy(handle);
5390 printf("No of apps: %d\n", count);
5391 pkgmgrinfo_appinfo_filter_destroy(handle);
5396 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5397 const char *property, const int value);
5400 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5401 * @brief This API adds a string filter property to the filter handle
5403 * @par This API is for package-manager client application
5404 * @par Sync (or) Async : Synchronous API
5406 * @param[in] handle pointer to the application info filter handle.
5407 * @param[in] property string property name.
5408 * @param[in] value value corresponding to the property.
5409 * @return 0 if success, error code(<0) if fail
5410 * @retval PMINFO_R_OK success
5411 * @retval PMINFO_R_EINVAL invalid argument
5412 * @retval PMINFO_R_ERROR internal error
5413 * @pre pkgmgrinfo_appinfo_filter_create()
5414 * @post pkgmgrinfo_appinfo_filter_destroy()
5415 * @see pkgmgrinfo_appinfo_filter_count()
5416 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5418 static int get_capp_count()
5422 pkgmgrinfo_appinfo_filter_h handle;
5423 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5424 if (ret != PMINFO_R_OK)
5426 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5427 if (ret != PMINFO_R_OK) {
5428 pkgmgrinfo_appinfo_filter_destroy(handle);
5431 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5432 if (ret != PMINFO_R_OK) {
5433 pkgmgrinfo_appinfo_filter_destroy(handle);
5436 printf("No of capp: %d\n", count);
5437 pkgmgrinfo_appinfo_filter_destroy(handle);
5442 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5443 const char *property, const char *value);
5446 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5447 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5449 * @par This API is for package-manager client application
5450 * @par Sync (or) Async : Synchronous API
5452 * @param[in] handle pointer to the application info filter handle.
5453 * @param[in] app_cb callback function.
5454 * @param[in] user_data user data to be passed to the callback function
5455 * @return 0 if success, error code(<0) if fail
5456 * @retval PMINFO_R_OK success
5457 * @retval PMINFO_R_EINVAL invalid argument
5458 * @retval PMINFO_R_ERROR internal error
5459 * @pre pkgmgrinfo_appinfo_filter_create()
5460 * @post pkgmgrinfo_appinfo_filter_destroy()
5461 * @see pkgmgrinfo_appinfo_filter_count()
5463 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5466 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5467 printf("appid : %s\n", appid);
5471 static int get_capp_list()
5474 pkgmgrinfo_appinfo_filter_h handle;
5475 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5476 if (ret != PMINFO_R_OK)
5478 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5479 if (ret != PMINFO_R_OK) {
5480 pkgmgrinfo_appinfo_filter_destroy(handle);
5483 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5484 if (ret != PMINFO_R_OK) {
5485 pkgmgrinfo_appinfo_filter_destroy(handle);
5488 pkgmgrinfo_appinfo_filter_destroy(handle);
5493 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5494 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5495 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5496 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5499 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5500 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5501 * @brief This API counts the application that satisfy the filter conditions
5503 * @par This API is for package-manager client application
5504 * @par Sync (or) Async : Synchronous API
5506 * @param[in] handle pointer to the application info filter handle.
5507 * @param[in] count pointer to store count value
5508 * @param[in] uid the addressee user id of the instruction
5509 * @return 0 if success, error code(<0) if fail
5510 * @retval PMINFO_R_OK success
5511 * @retval PMINFO_R_EINVAL invalid argument
5512 * @retval PMINFO_R_ERROR internal error
5513 * @pre pkgmgrinfo_appinfo_filter_create()
5514 * @post pkgmgrinfo_appinfo_filter_destroy()
5515 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5517 static int get_capp_count()
5521 pkgmgrinfo_appinfo_filter_h handle;
5522 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5523 if (ret != PMINFO_R_OK)
5525 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5526 if (ret != PMINFO_R_OK) {
5527 pkgmgrinfo_appinfo_filter_destroy(handle);
5530 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5531 if (ret != PMINFO_R_OK) {
5532 pkgmgrinfo_appinfo_filter_destroy(handle);
5535 printf("No of capp: %d\n", count);
5536 pkgmgrinfo_appinfo_filter_destroy(handle);
5541 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5542 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5544 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5545 * @brief This API creates the application's metadata information filter handle from db.
5547 * @par This API is for package-manager client application
5548 * @par Sync (or) Async : Synchronous API
5550 * @param[out] handle pointer to the application metadata info filter handle.
5551 * @return 0 if success, error code(<0) if fail
5552 * @retval PMINFO_R_OK success
5553 * @retval PMINFO_R_EINVAL invalid argument
5554 * @retval PMINFO_R_ERROR internal error
5556 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5557 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5559 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5562 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5563 printf("appid : %s\n", appid);
5567 static int get_app_list(const char *mkey, const char *mvalue)
5570 pkgmgrinfo_appinfo_metadata_filter_h handle;
5571 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5572 if (ret != PMINFO_R_OK)
5574 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5575 if (ret != PMINFO_R_OK) {
5576 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5579 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5580 if (ret != PMINFO_R_OK) {
5581 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5584 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5589 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5592 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5593 * @brief This API destroys the application's metadata information filter handle.
5595 * @par This API is for package-manager client application
5596 * @par Sync (or) Async : Synchronous API
5598 * @param[in] handle pointer to the application metadata info filter handle.
5599 * @return 0 if success, error code(<0) if fail
5600 * @retval PMINFO_R_OK success
5601 * @retval PMINFO_R_EINVAL invalid argument
5602 * @retval PMINFO_R_ERROR internal error
5603 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5605 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5607 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5610 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5611 printf("appid : %s\n", appid);
5615 static int get_app_list(const char *mkey, const char *mvalue)
5618 pkgmgrinfo_appinfo_metadata_filter_h handle;
5619 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5620 if (ret != PMINFO_R_OK)
5622 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5623 if (ret != PMINFO_R_OK) {
5624 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5627 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5628 if (ret != PMINFO_R_OK) {
5629 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5632 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5637 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5640 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5641 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5642 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5644 * @par This API is for package-manager client application
5645 * @par Sync (or) Async : Synchronous API
5647 * @param[in] handle pointer to the application metadata info filter handle.
5648 * @param[in] key pointer to metadata key
5649 * @param[in] value pointer to metadata value
5650 * @return 0 if success, error code(<0) if fail
5651 * @retval PMINFO_R_OK success
5652 * @retval PMINFO_R_EINVAL invalid argument
5653 * @retval PMINFO_R_ERROR internal error
5654 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5655 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5656 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5658 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5661 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5662 printf("appid : %s\n", appid);
5666 static int get_app_list(const char *mkey, const char *mvalue)
5669 pkgmgrinfo_appinfo_metadata_filter_h handle;
5670 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5671 if (ret != PMINFO_R_OK)
5673 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5674 if (ret != PMINFO_R_OK) {
5675 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5678 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5679 if (ret != PMINFO_R_OK) {
5680 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5683 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5688 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5689 const char *key, const char *value);
5692 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5693 * @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)
5694 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5695 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5696 * negative value, no more callbacks will be called and API will return.
5698 * @par This API is for package-manager client application
5699 * @par Sync (or) Async : Synchronous API
5701 * @param[in] handle pointer to the application metadata info filter handle.
5702 * @param[in] app_cb function pointer to callback
5703 * @param[in] user_data pointer to user data
5704 * @param[in] uid the addressee user id of the instruction
5705 * @return 0 if success, error code(<0) if fail
5706 * @retval PMINFO_R_OK success
5707 * @retval PMINFO_R_EINVAL invalid argument
5708 * @retval PMINFO_R_ERROR internal error
5709 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5710 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5712 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5715 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5716 printf("appid : %s\n", appid);
5720 static int get_app_list(const char *mkey, const char *mvalue)
5723 pkgmgrinfo_appinfo_metadata_filter_h handle;
5724 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5725 if (ret != PMINFO_R_OK)
5727 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5728 if (ret != PMINFO_R_OK) {
5729 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5732 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5733 if (ret != PMINFO_R_OK) {
5734 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5737 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5742 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5743 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5744 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5745 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5747 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5748 * @brief This API creates the package cert information handle to get data from db.
5750 * @par This API is for package-manager client application
5751 * @par Sync (or) Async : Synchronous API
5753 * @param[out] handle pointer to the package cert handle.
5754 * @return 0 if success, error code(<0) if fail
5755 * @retval PMINFO_R_OK success
5756 * @retval PMINFO_R_EINVAL invalid argument
5757 * @retval PMINFO_R_ERROR internal error
5759 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5760 * @see pkgmgrinfo_pkginfo_get_cert_value()
5761 * @see pkgmgrinfo_pkginfo_load_certinfo()
5763 static int get_cert_info(const char *pkgid)
5766 pkgmgrinfo_certinfo_h handle;
5767 char *auth_cert = NULL;
5768 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5769 if (ret != PMINFO_R_OK)
5771 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5772 if (ret != PMINFO_R_OK) {
5773 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5776 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5777 if (ret != PMINFO_R_OK) {
5778 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5781 printf("Author root certificate: %s\n", auth_root);
5782 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5787 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5790 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5791 * @brief This API loads the package cert information handle with data from db.
5793 * @par This API is for package-manager client application
5794 * @par Sync (or) Async : Synchronous API
5796 * @param[in] pkgid pointer to the package ID.
5797 * @param[in] handle pointer to the package cert handle.
5798 * @return 0 if success, error code(<0) if fail
5799 * @retval PMINFO_R_OK success
5800 * @retval PMINFO_R_EINVAL invalid argument
5801 * @retval PMINFO_R_ERROR internal error
5802 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5803 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5804 * @see pkgmgrinfo_pkginfo_get_cert_value()
5806 static int get_cert_info(const char *pkgid)
5809 pkgmgrinfo_certinfo_h handle;
5810 char *auth_cert = NULL;
5811 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5812 if (ret != PMINFO_R_OK)
5814 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5815 if (ret != PMINFO_R_OK) {
5816 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5819 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5820 if (ret != PMINFO_R_OK) {
5821 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5824 printf("Author root certificate: %s\n", auth_root);
5825 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5830 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5833 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5834 * @brief This API gets the package cert information from the handle
5836 * @par This API is for package-manager client application
5837 * @par Sync (or) Async : Synchronous API
5839 * @param[in] handle pointer to the package cert handle.
5840 * @param[in] cert_type certificate type
5841 * @param[out] cert_value pointer to hold certificate value
5842 * @return 0 if success, error code(<0) if fail
5843 * @retval PMINFO_R_OK success
5844 * @retval PMINFO_R_EINVAL invalid argument
5845 * @retval PMINFO_R_ERROR internal error
5846 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5847 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5848 * @see pkgmgrinfo_pkginfo_load_certinfo()
5850 static int get_cert_info(const char *pkgid)
5853 pkgmgrinfo_certinfo_h handle;
5854 char *auth_cert = NULL;
5855 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5856 if (ret != PMINFO_R_OK)
5858 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5859 if (ret != PMINFO_R_OK) {
5860 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5863 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5864 if (ret != PMINFO_R_OK) {
5865 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5868 printf("Author root certificate: %s\n", auth_root);
5869 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5874 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5877 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5878 * @brief This API destroys the package cert information handle freeing up all the resources
5880 * @par This API is for package-manager client application
5881 * @par Sync (or) Async : Synchronous API
5883 * @param[in] handle pointer to the package cert handle.
5884 * @return 0 if success, error code(<0) if fail
5885 * @retval PMINFO_R_OK success
5886 * @retval PMINFO_R_EINVAL invalid argument
5887 * @retval PMINFO_R_ERROR internal error
5888 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5890 * @see pkgmgrinfo_pkginfo_load_certinfo()
5892 static int get_cert_info(const char *pkgid)
5895 pkgmgrinfo_certinfo_h handle;
5896 char *auth_cert = NULL;
5897 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5898 if (ret != PMINFO_R_OK)
5900 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5901 if (ret != PMINFO_R_OK) {
5902 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5905 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5906 if (ret != PMINFO_R_OK) {
5907 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5910 printf("Author root certificate: %s\n", auth_root);
5911 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5916 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5919 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5920 * @brief This API deletes the package cert information from DB
5922 * @par This API is for package-manager client application
5923 * @par Sync (or) Async : Synchronous API
5925 * @param[in] pkgid pointer to the package ID.
5926 * @return 0 if success, error code(<0) if fail
5927 * @retval PMINFO_R_OK success
5928 * @retval PMINFO_R_EINVAL invalid argument
5929 * @retval PMINFO_R_ERROR internal error
5933 static int delete_cert_info(const char *pkgid)
5936 ret = pkgmgrinfo_delete_certinfo(pkgid);
5937 if (ret != PMINFO_R_OK)
5943 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5944 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5947 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5948 * @brief This API creates the package cert information handle to set data in db.
5950 * @par This API is for package-manager client application
5951 * @par Sync (or) Async : Synchronous API
5953 * @param[out] handle pointer to the package cert handle.
5954 * @return 0 if success, error code(<0) if fail
5955 * @retval PMINFO_R_OK success
5956 * @retval PMINFO_R_EINVAL invalid argument
5957 * @retval PMINFO_R_ERROR internal error
5959 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5960 * @see pkgmgrinfo_set_cert_value()
5961 * @see pkgmgrinfo_save_certinfo()
5963 static int set_cert_in_db(const char *pkgid)
5966 pkgmgrinfo_instcertinfo_h handle;
5967 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5968 if (ret != PMINFO_R_OK)
5970 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5971 if (ret != PMINFO_R_OK) {
5972 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5975 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5976 if (ret != PMINFO_R_OK) {
5977 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5980 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5985 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5988 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5989 * @brief This API sets the package cert information in the handle.
5991 * @par This API is for package-manager client application
5992 * @par Sync (or) Async : Synchronous API
5994 * @param[in] handle pointer to the package cert handle.
5995 * @param[in] cert_type certificate type.
5996 * @param[in] cert_value certificate value.
5997 * @return 0 if success, error code(<0) if fail
5998 * @retval PMINFO_R_OK success
5999 * @retval PMINFO_R_EINVAL invalid argument
6000 * @retval PMINFO_R_ERROR internal error
6001 * @pre pkgmgrinfo_create_certinfo_set_handle()
6002 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6003 * @see pkgmgrinfo_save_certinfo()
6005 static int set_cert_in_db(const char *pkgid)
6008 pkgmgrinfo_instcertinfo_h handle;
6009 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6010 if (ret != PMINFO_R_OK)
6012 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6013 if (ret != PMINFO_R_OK) {
6014 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6017 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6018 if (ret != PMINFO_R_OK) {
6019 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6022 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6027 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6030 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6031 * @brief This API saves the package cert information in the DB.
6033 * @par This API is for package-manager client application
6034 * @par Sync (or) Async : Synchronous API
6036 * @param[in] pkgid pointer to the package ID.
6037 * @param[in] handle pointer to the package cert handle.
6038 * @return 0 if success, error code(<0) if fail
6039 * @retval PMINFO_R_OK success
6040 * @retval PMINFO_R_EINVAL invalid argument
6041 * @retval PMINFO_R_ERROR internal error
6042 * @pre pkgmgrinfo_create_certinfo_set_handle()
6043 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6044 * @see pkgmgrinfo_save_certinfo()
6046 static int set_cert_in_db(const char *pkgid)
6049 pkgmgrinfo_instcertinfo_h handle;
6050 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6051 if (ret != PMINFO_R_OK)
6053 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6054 if (ret != PMINFO_R_OK) {
6055 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6058 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6059 if (ret != PMINFO_R_OK) {
6060 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6063 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6068 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6071 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6072 * @brief This API destroys the package cert information handle freeing up all the resources.
6074 * @par This API is for package-manager client application
6075 * @par Sync (or) Async : Synchronous API
6077 * @param[in] handle pointer to the package cert handle.
6078 * @return 0 if success, error code(<0) if fail
6079 * @retval PMINFO_R_OK success
6080 * @retval PMINFO_R_EINVAL invalid argument
6081 * @retval PMINFO_R_ERROR internal error
6082 * @pre pkgmgrinfo_create_certinfo_set_handle()
6084 * @see pkgmgrinfo_save_certinfo()
6086 static int set_cert_in_db(const char *pkgid)
6089 pkgmgrinfo_instcertinfo_h handle;
6090 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6091 if (ret != PMINFO_R_OK)
6093 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6094 if (ret != PMINFO_R_OK) {
6095 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6098 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6099 if (ret != PMINFO_R_OK) {
6100 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6103 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6108 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6111 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6112 * @brief This API gets the datacontrol info
6114 * @par This API is for package-manager client application
6115 * @par Sync (or) Async : Synchronous API
6117 * @param[in] providerid pointer to the providerid of dataconltrol.
6118 * @param[in] type pointer to the type of dataconltrol.
6119 * @param[out] appid pointer to hold appid, need to free after using
6120 * @param[out] access pointer to hold access, need to free after using
6121 * @return 0 if success, error code(<0) if fail
6122 * @retval PMINFO_R_OK success
6123 * @retval PMINFO_R_EINVAL invalid argument
6124 * @retval PMINFO_R_ERROR internal error
6127 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6130 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6131 * @brief This API gets the application 'guest mode visibility' value from the DB
6133 * @par This API is for package-manager client application
6134 * @par Sync (or) Async : Synchronous API
6136 * @param[in] handle pointer to application info handle
6137 * @param[out] status pointer to hold app guest mode visibility value
6138 * @return 0 if success, error code(<0) if fail
6139 * @retval PMINFO_R_OK success
6140 * @retval PMINFO_R_EINVAL invalid argument
6141 * @retval PMINFO_R_ERROR internal error
6142 * @pre pkgmgrinfo_appinfo_get_appinfo()
6143 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6144 * @see pkgmgrinfo_appinfo_get_appid()
6145 * @see pkgmgrinfo_appinfo_is_multiple()
6147 static int get_app_guestmode_visibility(const char *appid)
6151 pkgmgrinfo_appinfo_h handle;
6152 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6153 if (ret != PMINFO_R_OK)
6155 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6156 if (ret != PMINFO_R_OK) {
6157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6160 printf("app guest mode visibility: %d\n", status);
6161 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6166 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6169 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6170 * @brief This API sets the package 'installed_storage' value in db
6172 * @par This API is for package-manager client application
6173 * @par Sync (or) Async : Synchronous API
6175 * @param[in] pkgid pointer to the package ID.
6176 * @param[in] location package install location
6177 * @param[in] external_pkg_path image path if pkg has installed at external storage
6178 * @return 0 if success, error code(<0) if fail
6179 * @retval PMINFO_R_OK success
6180 * @retval PMINFO_R_EINVAL invalid argument
6181 * @retval PMINFO_R_ERROR internal error
6183 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6187 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6188 if (ret != PMINFO_R_OK) {
6195 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6196 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6198 /* version compare */
6199 int pkgmgrinfo_compare_package_version(const char *current_version,
6200 const char *target_version, pkgmgrinfo_version_compare_type *res);
6207 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6208 int flag, void *user_data, uid_t uid);
6209 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6210 int flag, void *user_data);
6211 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6212 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6214 int pkgmgrinfo_appinfo_get_installed_list_full(
6215 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6218 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6219 pkgmgrinfo_archiveinfo_h *handle);
6220 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6221 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6222 const char **pkgid);
6223 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6225 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6226 const char **version);
6227 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6228 const char **api_version);
6229 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6230 const char **description);
6231 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6232 const char **label);
6233 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6234 const char **author);
6235 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6236 const unsigned char **icon, size_t *size);
6239 * @pkgmgrinfo client API end
6247 #endif /* __PKG_INFO_H__ */