4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
113 /** Integer property for filtering based on package info*/
114 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
116 /** String property for filtering based on app info*/
117 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE"
147 /** Integer property for filtering app disabled by user*/
148 #define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE"
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"
171 /** will be updated*/
172 /** string property for filtering based on pkg info*/
173 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
175 /* For multiuser support */
176 const char *getIconPath(uid_t uid, bool readonly);
177 char *getUserPkgParserDBPath(void);
178 char *getUserPkgParserDBPathUID(uid_t uid);
179 char *getUserPkgCertDBPath(void);
180 char *getUserPkgCertDBPathUID(uid_t uid);
181 const char *getUserManifestPath(uid_t uid, bool readonly);
184 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
185 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
186 * @brief This API gets list of installed packages
188 * @par This API is for package-manager client application
189 * @par Sync (or) Async : Synchronous API
190 * @param[in] pkg_list_cb iteration function for list
191 * @param[in] user_data user data to be passed to callback function
192 * @param[in] uid the addressee user id of the instruction
193 * @return 0 if success, error code(<0) if fail
194 * @retval PMINFO_R_OK success
195 * @retval PMINFO_R_EINVAL invalid argument
196 * @retval PMINFO_R_ERROR internal error
200 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
204 pkgid1 = (char *)user_data;
205 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
206 if (strcmp(pkgid1, pkgid2) == 0) {
213 static int list_pkgs()
216 char *name = "helloworld";
217 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
218 if (ret != PMINFO_R_OK) {
225 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
226 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
228 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
229 * @brief This API creates the package information handle from db
231 * @par This API is for package-manager client application
232 * @par Sync (or) Async : Synchronous API
234 * @param[in] pkgid pointer to package ID
235 * @param[in] uid the addressee user id of the instruction
236 * @param[out] handle pointer to the package info handle.
237 * @return 0 if success, error code(<0) if fail
238 * @retval PMINFO_R_OK success
239 * @retval PMINFO_R_EINVAL invalid argument
240 * @retval PMINFO_R_ERROR internal error
242 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
243 * @see pkgmgrinfo_pkginfo_get_pkgid()
244 * @see pkgmgrinfo_pkginfo_is_removable()
246 static int get_pkg_type(const char *pkgid)
250 pkgmgrinfo_pkginfo_h handle;
251 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
252 if (ret != PMINFO_R_OK)
254 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
255 if (ret != PMINFO_R_OK) {
256 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
259 printf("pkgtype: %s\n", type);
260 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
265 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
266 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
269 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
270 * @brief This API gets the package name from the package ID
272 * @par This API is for package-manager client application
273 * @par Sync (or) Async : Synchronous API
275 * @param[in] handle pointer to package info handle
276 * @param[out] pkg_name pointer to hold package name
277 * @return 0 if success, error code(<0) if fail
278 * @retval PMINFO_R_OK success
279 * @retval PMINFO_R_EINVAL invalid argument
280 * @retval PMINFO_R_ERROR internal error
281 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
282 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
283 * @see pkgmgrinfo_pkginfo_get_type()
284 * @see pkgmgrinfo_pkginfo_is_removable()
286 static int get_pkg_name(const char *pkgid)
289 char *pkgname = NULL;
290 pkgmgrinfo_pkginfo_h handle;
291 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
292 if (ret != PMINFO_R_OK)
294 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
295 if (ret != PMINFO_R_OK) {
296 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
299 printf("pkgname: %s\n", pkgname);
300 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
305 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
308 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
309 * @brief This API gets the package id from the package ID
311 * @par This API is for package-manager client application
312 * @par Sync (or) Async : Synchronous API
314 * @param[in] handle pointer to package info handle
315 * @param[out] pkgid pointer to hold package id
316 * @return 0 if success, error code(<0) if fail
317 * @retval PMINFO_R_OK success
318 * @retval PMINFO_R_EINVAL invalid argument
319 * @retval PMINFO_R_ERROR internal error
320 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
321 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
322 * @see pkgmgrinfo_pkginfo_get_type()
323 * @see pkgmgrinfo_pkginfo_is_removable()
325 static int get_pkgid(const char *pkgid)
329 pkgmgrinfo_pkginfo_h handle;
330 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
331 if (ret != PMINFO_R_OK)
333 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
334 if (ret != PMINFO_R_OK) {
335 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
338 printf("pkg id: %s\n", pkg_id);
339 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
344 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
347 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
348 * @brief This API gets the package type from the package ID
350 * @par This API is for package-manager client application
351 * @par Sync (or) Async : Synchronous API
353 * @param[in] handle pointer to package info handle
354 * @param[out] type pointer to hold package type
355 * @return 0 if success, error code(<0) if fail
356 * @retval PMINFO_R_OK success
357 * @retval PMINFO_R_EINVAL invalid argument
358 * @retval PMINFO_R_ERROR internal error
359 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
360 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
361 * @see pkgmgrinfo_pkginfo_get_pkgid()
362 * @see pkgmgrinfo_pkginfo_is_removable()
364 static int get_pkg_type(const char *pkgid)
368 pkgmgrinfo_pkginfo_h handle;
369 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
370 if (ret != PMINFO_R_OK)
372 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
373 if (ret != PMINFO_R_OK) {
374 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
377 printf("pkgtype: %s\n", type);
378 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
383 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
386 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
387 * @brief This API gets the package version from the package ID
389 * @par This API is for package-manager client application
390 * @par Sync (or) Async : Synchronous API
392 * @param[in] handle pointer to package info handle
393 * @param[out] version pointer to hold package version
394 * @return 0 if success, error code(<0) if fail
395 * @retval PMINFO_R_OK success
396 * @retval PMINFO_R_EINVAL invalid argument
397 * @retval PMINFO_R_ERROR internal error
398 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
399 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
400 * @see pkgmgrinfo_pkginfo_get_pkgid()
401 * @see pkgmgrinfo_pkginfo_is_removable()
403 static int get_pkg_version(const char *pkgid)
406 char *version = NULL;
407 pkgmgrinfo_pkginfo_h handle;
408 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
409 if (ret != PMINFO_R_OK)
411 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
412 if (ret != PMINFO_R_OK) {
413 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
416 printf("pkg version: %s\n", version);
417 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
422 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
425 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
426 * @brief This API gets the package api_version from the package ID
428 * @par This API is for package-manager client application
429 * @par Sync (or) Async : Synchronous API
431 * @param[in] handle pointer to package info handle
432 * @param[out] api_version pointer to hold package api_version
433 * @return 0 if success, error code(<0) if fail
434 * @retval PMINFO_R_OK success
435 * @retval PMINFO_R_EINVAL invalid argument
436 * @retval PMINFO_R_ERROR internal error
437 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
438 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
439 * @see pkgmgrinfo_pkginfo_get_pkgid()
440 * @see pkgmgrinfo_pkginfo_is_removable()
442 static int get_pkg_api_version(const char *pkgid)
445 char *api_version = NULL;
446 pkgmgrinfo_pkginfo_h handle = NULL;
447 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
448 if (ret != PMINFO_R_OK)
450 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
451 if (ret != PMINFO_R_OK) {
452 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
455 printf("pkg api_version: %s\n", api_version);
456 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
461 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
464 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
465 * @brief This API gets tep(tizen expansion package) file name associated with the package
467 * @par This API is for package-manager client application
468 * @par Sync (or) Async : Synchronous API
470 * @param[in] handle pointer to the pkginfo handle.
471 * @param[out] tep_name pointer to hold tep name
472 * @return 0 if success, error code(<0) if fail
473 * @retval PMINFO_R_OK success
474 * @retval PMINFO_R_EINVAL invalid argument
475 * @retval PMINFO_R_ERROR internal error
476 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
477 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
478 * @see pkgmgrinfo_pkginfo_get_pkgid()
480 static int get_tep_name(const char *pkgid)
483 char *tep_name = NULL;
484 pkgmgrinfo_pkginfo_h handle = NULL;
485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
486 if (ret != PMINFO_R_OK)
488 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
489 if (ret != PMINFO_R_OK) {
490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
493 printf("TEP name is: %s\n", tep_name);
494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
499 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
502 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
503 * @brief This API gets package mount point path associated with the package
504 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
506 * @par This API is for package-manager client application
507 * @par Sync (or) Async : Synchronous API
509 * @param[in] handle pointer to the pkginfo handle.
510 * @param[out] zip_mount_file pointer to hold zip mount file
511 * @return 0 if success, error code(<0) if fail
512 * @retval PMINFO_R_OK success
513 * @retval PMINFO_R_EINVAL invalid argument
514 * @retval PMINFO_R_ERROR internal error
515 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
516 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
517 * @see pkgmgrinfo_pkginfo_get_pkgid()
519 static int get_zip_mount_file(const char *pkgid)
522 char *zip_mount_file = NULL;
523 pkgmgrinfo_pkginfo_h handle = NULL;
524 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
525 if (ret != PMINFO_R_OK)
527 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
528 if (ret != PMINFO_R_OK) {
529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
532 if (zip_mount_file != NULL)
533 printf("Zip mount path is: %s\n", zip_mount_file);
534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
539 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
542 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
543 * @brief This API gets the package install location from the package ID
545 * @par This API is for package-manager client application
546 * @par Sync (or) Async : Synchronous API
548 * @param[in] handle pointer to package info handle
549 * @param[out] location pointer to hold package install location
550 * @return 0 if success, error code(<0) if fail
551 * @retval PMINFO_R_OK success
552 * @retval PMINFO_R_EINVAL invalid argument
553 * @retval PMINFO_R_ERROR internal error
554 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
555 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
556 * @see pkgmgrinfo_pkginfo_get_pkgid()
557 * @see pkgmgrinfo_pkginfo_is_removable()
559 static int get_pkg_install_location(const char *pkgid)
562 pkgmgrinfo_install_location location;
563 pkgmgrinfo_pkginfo_h handle;
564 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
565 if (ret != PMINFO_R_OK)
567 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
568 if (ret != PMINFO_R_OK) {
569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
572 printf("pkg install location: %d\n", location);
573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
578 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
581 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
582 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
583 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
584 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
586 * @par This API is for package-manager client application
587 * @par Sync (or) Async : Synchronous API
589 * @param[in] handle pointer to package info handle
590 * @param[out] size pointer to hold package size
591 * @return 0 if success, error code(<0) if fail
592 * @retval PMINFO_R_OK success
593 * @retval PMINFO_R_EINVAL invalid argument
594 * @retval PMINFO_R_ERROR internal error
595 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
596 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
597 * @see pkgmgrinfo_pkginfo_get_pkgid()
598 * @see pkgmgrinfo_pkginfo_is_removable()
600 static int get_pkg_size(const char *pkgid)
604 pkgmgrinfo_pkginfo_h handle;
605 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
606 if (ret != PMINFO_R_OK)
608 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
609 if (ret != PMINFO_R_OK) {
610 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
613 printf("pkgsize: %d\n", size);
614 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
619 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
622 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
623 * @brief This API gets the package icon from the package ID
625 * @par This API is for package-manager client application
626 * @par Sync (or) Async : Synchronous API
628 * @param[in] handle pointer to package info handle
629 * @param[out] icon pointer to hold package icon
630 * @return 0 if success, error code(<0) if fail
631 * @retval PMINFO_R_OK success
632 * @retval PMINFO_R_EINVAL invalid argument
633 * @retval PMINFO_R_ERROR internal error
634 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
635 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
636 * @see pkgmgrinfo_pkginfo_get_pkgid()
637 * @see pkgmgrinfo_pkginfo_is_removable()
639 static int get_pkg_icon(const char *pkgid)
643 pkgmgrinfo_pkginfo_h handle;
644 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
645 if (ret != PMINFO_R_OK)
647 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
648 if (ret != PMINFO_R_OK) {
649 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
652 printf("pkg icon: %s\n", icon);
653 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
658 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
661 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
662 * @brief This API gets the package label from the package ID
664 * @par This API is for package-manager client application
665 * @par Sync (or) Async : Synchronous API
667 * @param[in] handle pointer to package info handle
668 * @param[out] label pointer to hold package label
669 * @return 0 if success, error code(<0) if fail
670 * @retval PMINFO_R_OK success
671 * @retval PMINFO_R_EINVAL invalid argument
672 * @retval PMINFO_R_ERROR internal error
673 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
674 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
675 * @see pkgmgrinfo_pkginfo_get_pkgid()
676 * @see pkgmgrinfo_pkginfo_is_removable()
678 static int get_pkg_label(const char *pkgid)
682 pkgmgrinfo_pkginfo_h handle;
683 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
684 if (ret != PMINFO_R_OK)
686 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
687 if (ret != PMINFO_R_OK) {
688 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
691 printf("pkg label: %s\n", label);
692 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
697 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
700 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
701 * @brief This API gets the package description from the package ID
703 * @par This API is for package-manager client application
704 * @par Sync (or) Async : Synchronous API
706 * @param[in] handle pointer to package info handle
707 * @param[out] description pointer to hold package description
708 * @return 0 if success, error code(<0) if fail
709 * @retval PMINFO_R_OK success
710 * @retval PMINFO_R_EINVAL invalid argument
711 * @retval PMINFO_R_ERROR internal error
712 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
713 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
714 * @see pkgmgrinfo_pkginfo_get_pkgid()
715 * @see pkgmgrinfo_pkginfo_is_removable()
717 static int get_pkg_description(const char *pkgid)
720 char *description = NULL;
721 pkgmgrinfo_pkginfo_h handle;
722 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
723 if (ret != PMINFO_R_OK)
725 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
726 if (ret != PMINFO_R_OK) {
727 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
730 printf("pkg description: %s\n", description);
731 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
736 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
739 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
740 * @brief This API gets the package's author name from the package ID
742 * @par This API is for package-manager client application
743 * @par Sync (or) Async : Synchronous API
745 * @param[in] handle pointer to package info handle
746 * @param[out] author_name pointer to hold package author name
747 * @return 0 if success, error code(<0) if fail
748 * @retval PMINFO_R_OK success
749 * @retval PMINFO_R_EINVAL invalid argument
750 * @retval PMINFO_R_ERROR internal error
751 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
752 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
753 * @see pkgmgrinfo_pkginfo_get_pkgid()
754 * @see pkgmgrinfo_pkginfo_is_removable()
756 static int get_pkg_author_name(const char *pkgid)
759 char *author_name = NULL;
760 pkgmgrinfo_pkginfo_h handle;
761 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
762 if (ret != PMINFO_R_OK)
764 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
765 if (ret != PMINFO_R_OK) {
766 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
769 printf("pkg author name: %s\n", author_name);
770 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
775 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
778 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
779 * @brief This API gets the package's author email from the package ID
781 * @par This API is for package-manager client application
782 * @par Sync (or) Async : Synchronous API
784 * @param[in] handle pointer to package info handle
785 * @param[out] author_email pointer to hold package author email
786 * @return 0 if success, error code(<0) if fail
787 * @retval PMINFO_R_OK success
788 * @retval PMINFO_R_EINVAL invalid argument
789 * @retval PMINFO_R_ERROR internal error
790 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
791 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
792 * @see pkgmgrinfo_pkginfo_get_pkgid()
793 * @see pkgmgrinfo_pkginfo_is_removable()
795 static int get_pkg_author_email(const char *pkgid)
798 char *author_email = NULL;
799 pkgmgrinfo_pkginfo_h handle;
800 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
801 if (ret != PMINFO_R_OK)
803 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
804 if (ret != PMINFO_R_OK) {
805 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
808 printf("pkg author email: %s\n", author_email);
809 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
814 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
817 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
818 * @brief This API gets the package's author href from the package ID
820 * @par This API is for package-manager client application
821 * @par Sync (or) Async : Synchronous API
823 * @param[in] handle pointer to package info handle
824 * @param[out] author_href pointer to hold package author href
825 * @return 0 if success, error code(<0) if fail
826 * @retval PMINFO_R_OK success
827 * @retval PMINFO_R_EINVAL invalid argument
828 * @retval PMINFO_R_ERROR internal error
829 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
830 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
831 * @see pkgmgrinfo_pkginfo_get_pkgid()
832 * @see pkgmgrinfo_pkginfo_is_removable()
834 static int get_pkg_author_href(const char *pkgid)
837 char *author_href = NULL;
838 pkgmgrinfo_pkginfo_h handle;
839 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
840 if (ret != PMINFO_R_OK)
842 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
843 if (ret != PMINFO_R_OK) {
844 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
847 printf("pkg author href: %s\n", author_href);
848 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
853 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
856 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
857 * @brief This API gets the package installed storagae value from the package ID
859 * @par This API is for package-manager client application
860 * @par Sync (or) Async : Synchronous API
862 * @param[in] handle pointer to package info handle
863 * @param[out] storage pointer to hold package installed storage
864 * @return 0 if success, error code(<0) if fail
865 * @retval PMINFO_R_OK success
866 * @retval PMINFO_R_EINVAL invalid argument
867 * @retval PMINFO_R_ERROR internal error
868 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
869 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
870 * @see pkgmgrinfo_pkginfo_get_pkgid()
871 * @see pkgmgrinfo_pkginfo_is_removable()
873 static int get_pkg_installed_storage(const char *pkgid)
876 pkgmgrinfo_installed_storage storage;
877 pkgmgrinfo_pkginfo_h handle;
878 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
879 if (ret != PMINFO_R_OK)
881 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
882 if (ret != PMINFO_R_OK) {
883 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
886 printf("pkg installed storage: %d\n", storage);
887 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
892 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
895 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
896 * @brief This API gets the installed time of package from the package ID
898 * @par This API is for package-manager client application
899 * @par Sync (or) Async : Synchronous API
901 * @param[in] handle pointer to package info handle
902 * @param[out] installed_time pointer to hold installed time of package
903 * @return 0 if success, error code(<0) if fail
904 * @retval PMINFO_R_OK success
905 * @retval PMINFO_R_EINVAL invalid argument
906 * @retval PMINFO_R_ERROR internal error
907 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
908 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
909 * @see pkgmgrinfo_pkginfo_get_pkgid()
910 * @see pkgmgrinfo_pkginfo_is_removable()
912 static int get_pkg_installed_time(const char *pkgid)
915 int installed_time = 0;
916 pkgmgrinfo_pkginfo_h handle;
917 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
918 if (ret != PMINFO_R_OK)
920 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
921 if (ret != PMINFO_R_OK) {
922 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
925 printf("installed_time: %d\n", installed_time);
926 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
931 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
934 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
935 * @brief This API gets the launch mode of package from the package ID
937 * @par This API is for package-manager client application
938 * @par Sync (or) Async : Synchronous API
940 * @param[in] handle pointer to package info handle
941 * @param[out] mode pointer to hold launch mode of package
942 * @return 0 if success, error code(<0) if fail
943 * @retval PMINFO_R_OK success
944 * @retval PMINFO_R_EINVAL invalid argument
945 * @retval PMINFO_R_ERROR internal error
946 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
947 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
948 * @see pkgmgrinfo_pkginfo_get_pkgid()
949 * @see pkgmgrinfo_pkginfo_is_removable()
951 static int get_pkg_launch_mode(const char *pkgid)
954 char *launch_mode = NULL;
955 pkgmgrinfo_pkginfo_h handle;
956 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
957 if (ret != PMINFO_R_OK)
959 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
960 if (ret != PMINFO_R_OK) {
961 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
964 printf("launch mode: %s\n", mode);
965 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
970 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
973 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
974 * @brief This API gets the store client id of package from the package ID
976 * @par This API is for package-manager client application
977 * @par Sync (or) Async : Synchronous API
979 * @param[in] handle pointer to package info handle
980 * @param[out] storeclientid pointer to hold store client id of package
981 * @return 0 if success, error code(<0) if fail
982 * @retval PMINFO_R_OK success
983 * @retval PMINFO_R_EINVAL invalid argument
984 * @retval PMINFO_R_ERROR internal error
985 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
986 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
987 * @see pkgmgrinfo_pkginfo_get_pkgid()
988 * @see pkgmgrinfo_pkginfo_is_removable()
990 static int get_pkg_storeclientid(const char *pkgid)
993 char *storeclientid = 0;
994 pkgmgrinfo_pkginfo_h handle;
995 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
996 if (ret != PMINFO_R_OK)
998 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
999 if (ret != PMINFO_R_OK) {
1000 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1003 printf(store client id: %s\n", storeclientid);
1004 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1009 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1012 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1013 * @brief This API gets the main app id of package from the package ID
1015 * @par This API is for package-manager client application
1016 * @par Sync (or) Async : Synchronous API
1018 * @param[in] handle pointer to package info handle
1019 * @param[out] mainappid pointer to hold main app id of package
1020 * @return 0 if success, error code(<0) if fail
1021 * @retval PMINFO_R_OK success
1022 * @retval PMINFO_R_EINVAL invalid argument
1023 * @retval PMINFO_R_ERROR internal error
1024 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1025 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1026 * @see pkgmgrinfo_pkginfo_get_pkgid()
1027 * @see pkgmgrinfo_pkginfo_is_removable()
1029 static int get_pkg_mainappid(const char *pkgid)
1032 char *mainappid = 0;
1033 pkgmgrinfo_pkginfo_h handle;
1034 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1035 if (ret != PMINFO_R_OK)
1037 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1038 if (ret != PMINFO_R_OK) {
1039 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1042 printf(main app id: %s\n", mainappid);
1043 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1048 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1051 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1052 * @brief This API gets the url of package from the package ID
1054 * @par This API is for package-manager client application
1055 * @par Sync (or) Async : Synchronous API
1057 * @param[in] handle pointer to package info handle
1058 * @param[out] url pointer to hold url of package
1059 * @return 0 if success, error code(<0) if fail
1060 * @retval PMINFO_R_OK success
1061 * @retval PMINFO_R_EINVAL invalid argument
1062 * @retval PMINFO_R_ERROR internal error
1063 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1064 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1065 * @see pkgmgrinfo_pkginfo_get_pkgid()
1066 * @see pkgmgrinfo_pkginfo_is_removable()
1068 static int get_pkg_url(const char *pkgid)
1072 pkgmgrinfo_pkginfo_h handle;
1073 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1074 if (ret != PMINFO_R_OK)
1076 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1077 if (ret != PMINFO_R_OK) {
1078 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1081 printf("url : %s\n", url);
1082 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1087 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1090 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1091 * @brief This API gets the root path of package
1093 * @par Sync (or) Async : Synchronous API
1095 * @param[in] handle pointer to package info handle
1096 * @param[out] path pointer to hold root path of package
1097 * @return 0 if success, error code(<0) if fail
1098 * @retval PMINFO_R_OK success
1099 * @retval PMINFO_R_EINVAL invalid argument
1100 * @retval PMINFO_R_ERROR internal error
1102 static int get_root_path(const char *pkgid)
1106 pkgmgrinfo_pkginfo_h handle;
1107 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1108 if (ret != PMINFO_R_OK)
1111 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1112 if (ret != PMINFO_R_OK) {
1113 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1116 printf("path : %s\n", path);
1117 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1123 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1127 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1128 * @brief This API gets the csc path of package
1130 * @par Sync (or) Async : Synchronous API
1132 * @param[in] handle pointer to package info handle
1133 * @param[out] path pointer to hold csc path of package
1134 * @return 0 if success, error code(<0) if fail
1135 * @retval PMINFO_R_OK success
1136 * @retval PMINFO_R_EINVAL invalid argument
1137 * @retval PMINFO_R_ERROR internal error
1139 static int get_csc_path(const char *pkgid)
1143 pkgmgrinfo_pkginfo_h handle;
1144 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1145 if (ret != PMINFO_R_OK)
1148 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1149 if (ret != PMINFO_R_OK) {
1150 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1153 printf("path : %s\n", path);
1154 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1160 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1163 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1164 * @brief This API gets the support_mode of package
1166 * @par Sync (or) Async : Synchronous API
1168 * @param[in] handle pointer to package info handle
1169 * @param[out] support_mode pointer to hold support_mode of package
1170 * @return 0 if success, error code(<0) if fail
1171 * @retval PMINFO_R_OK success
1172 * @retval PMINFO_R_EINVAL invalid argument
1173 * @retval PMINFO_R_ERROR internal error
1175 static int get_support_mode(const char *pkgid)
1178 int support_mode = 0;
1179 pkgmgrinfo_pkginfo_h handle = NULL;
1180 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1181 if (ret != PMINFO_R_OK)
1184 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1185 if (ret != PMINFO_R_OK) {
1186 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1189 printf("support_mode : %s\n", support_mode);
1190 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1196 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1199 * @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)
1200 * @brief This API compare the cert information from given package id
1202 * @par This API is for package-manager client application
1203 * @par Sync (or) Async : Synchronous API
1205 * @param[in] lhs_package_id pointer to first package ID
1206 * @param[in] rhs_package_id pointer to second package ID
1207 * @param[out] compare_result pointer to the compare result.
1208 * @return 0 if success, error code(<0) if fail
1209 * @retval PMINFO_R_OK success
1210 * @retval PMINFO_R_EINVAL invalid argument
1211 * @retval PMINFO_R_ERROR internal error
1213 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1214 * @see pkgmgrinfo_pkginfo_get_pkgid()
1215 * @see pkgmgrinfo_pkginfo_is_removable()
1217 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1220 pkgmgrinfo_cert_compare_result_type_e result;
1222 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1223 if (ret != PMINFO_R_OK) {
1226 printf("result: %d\n", result);
1231 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);
1232 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);
1234 * @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)
1235 * @brief This API compare the cert information from given app id
1237 * @par This API is for package-manager client application
1238 * @par Sync (or) Async : Synchronous API
1240 * @param[in] lhs_app_id pointer to first app ID
1241 * @param[in] rhs_app_id pointer to second app ID
1242 * @param[out] compare_result pointer to the compare result.
1243 * @return 0 if success, error code(<0) if fail
1244 * @retval PMINFO_R_OK success
1245 * @retval PMINFO_R_EINVAL invalid argument
1246 * @retval PMINFO_R_ERROR internal error
1248 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1249 * @see pkgmgrinfo_pkginfo_get_pkgid()
1250 * @see pkgmgrinfo_pkginfo_is_removable()
1252 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1255 pkgmgrinfo_cert_compare_result_type_e result;
1257 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1258 if (ret != PMINFO_R_OK) {
1261 printf("result: %d\n", result);
1266 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);
1267 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);
1269 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1270 * @brief This API gets the package 'removable' value from the package ID
1272 * @par This API is for package-manager client application
1273 * @par Sync (or) Async : Synchronous API
1275 * @param[in] handle pointer to package info handle
1276 * @param[out] removable pointer to hold package removable value
1277 * @return 0 if success, error code(<0) if fail
1278 * @retval PMINFO_R_OK success
1279 * @retval PMINFO_R_EINVAL invalid argument
1280 * @retval PMINFO_R_ERROR internal error
1281 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1282 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1283 * @see pkgmgrinfo_pkginfo_get_pkgid()
1284 * @see pkgmgrinfo_pkginfo_is_readonly()
1286 static int get_pkg_removable(const char *pkgid)
1290 pkgmgrinfo_pkginfo_h handle;
1291 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1292 if (ret != PMINFO_R_OK)
1294 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1295 if (ret != PMINFO_R_OK) {
1296 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1299 printf("pkg removable: %d\n", removable);
1300 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1305 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1308 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1309 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1311 * @par This API is for package-manager client application
1312 * @par Sync (or) Async : Synchronous API
1314 * @param[in] handle pointer to package info handle
1315 * @param[out] movable pointer to hold package movable state
1316 * @return 0 if success, error code(<0) if fail
1317 * @retval PMINFO_R_OK success
1318 * @retval PMINFO_R_EINVAL invalid argument
1319 * @retval PMINFO_R_ERROR internal error
1320 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1321 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1322 * @see pkgmgrinfo_pkginfo_get_pkgid()
1324 static int get_pkg_movable(const char *pkgid)
1328 pkgmgrinfo_pkginfo_h handle;
1329 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1330 if (ret != PMINFO_R_OK)
1332 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1333 if (ret != PMINFO_R_OK) {
1334 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1337 printf("pkg movable: %d\n", movable);
1338 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1343 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1346 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1347 * @brief This API gets the package 'preload' value from the package ID
1349 * @par This API is for package-manager client application
1350 * @par Sync (or) Async : Synchronous API
1352 * @param[in] handle pointer to package info handle
1353 * @param[out] preload pointer to hold package preload value
1354 * @return 0 if success, error code(<0) if fail
1355 * @retval PMINFO_R_OK success
1356 * @retval PMINFO_R_EINVAL invalid argument
1357 * @retval PMINFO_R_ERROR internal error
1358 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1359 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1360 * @see pkgmgrinfo_pkginfo_get_pkgid()
1361 * @see pkgmgrinfo_pkginfo_is_readonly()
1363 static int get_pkg_preload(const char *pkgid)
1367 pkgmgrinfo_pkginfo_h handle;
1368 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1369 if (ret != PMINFO_R_OK)
1371 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1372 if (ret != PMINFO_R_OK) {
1373 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1376 printf("pkg preload: %d\n", preload);
1377 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1382 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1385 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1386 * @brief This API gets the value for given handle is system or not
1388 * @par This API is for package-manager client application
1389 * @par Sync (or) Async : Synchronous API
1391 * @param[in] handle pointer to package info handle
1392 * @param[out] system pointer to hold system is or not
1393 * @return 0 if success, error code(<0) if fail
1394 * @retval PMINFO_R_OK success
1395 * @retval PMINFO_R_EINVAL invalid argument
1396 * @retval PMINFO_R_ERROR internal error
1397 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1398 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1399 * @see pkgmgrinfo_pkginfo_get_pkgid()
1400 * @see pkgmgrinfo_pkginfo_is_readonly()
1402 static int get_pkg_system(const char *pkgid)
1405 bool system = false;
1406 pkgmgrinfo_pkginfo_h handle = NULL;
1407 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1408 if (ret != PMINFO_R_OK)
1410 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1411 if (ret != PMINFO_R_OK) {
1412 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1415 printf("pkg system: %d\n", system);
1416 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1421 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1424 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1425 * @brief This API gets the package 'readonly' value from the package ID
1427 * @par This API is for package-manager client application
1428 * @par Sync (or) Async : Synchronous API
1430 * @param[in] handle pointer to package info handle
1431 * @param[out] readonly pointer to hold package readonly value
1432 * @return 0 if success, error code(<0) if fail
1433 * @retval PMINFO_R_OK success
1434 * @retval PMINFO_R_EINVAL invalid argument
1435 * @retval PMINFO_R_ERROR internal error
1436 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1437 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1438 * @see pkgmgrinfo_pkginfo_get_pkgid()
1439 * @see pkgmgrinfo_pkginfo_is_removable()
1441 static int get_pkg_readonly(const char *pkgid)
1445 pkgmgrinfo_pkginfo_h handle;
1446 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1447 if (ret != PMINFO_R_OK)
1449 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1450 if (ret != PMINFO_R_OK) {
1451 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1454 printf("pkg readonly: %d\n", readonly);
1455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1460 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1464 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1465 * @brief This API gets the package 'upate' value from the package ID
1467 * @par This API is for package-manager client application
1468 * @par Sync (or) Async : Synchronous API
1470 * @param[in] handle pointer to package info handle
1471 * @param[out] update pointer to hold package update value
1472 * @return 0 if success, error code(<0) if fail
1473 * @retval PMINFO_R_OK success
1474 * @retval PMINFO_R_EINVAL invalid argument
1475 * @retval PMINFO_R_ERROR internal error
1476 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1477 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1478 * @see pkgmgrinfo_pkginfo_get_pkgid()
1480 static int get_pkg_update(const char *pkgid)
1484 pkgmgrinfo_pkginfo_h handle;
1485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1486 if (ret != PMINFO_R_OK)
1488 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1489 if (ret != PMINFO_R_OK) {
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493 printf("pkg update: %d\n", update);
1494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1499 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1502 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1503 * @brief This API gets the package 'support_disable' value from the package ID
1505 * @par This API is for package-manager client application
1506 * @par Sync (or) Async : Synchronous API
1508 * @param[in] handle pointer to package info handle
1509 * @param[out] support_disable pointer to hold package support_disable value
1510 * @return 0 if success, error code(<0) if fail
1511 * @retval PMINFO_R_OK success
1512 * @retval PMINFO_R_EINVAL invalid argument
1513 * @retval PMINFO_R_ERROR internal error
1514 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1515 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1516 * @see pkgmgrinfo_pkginfo_get_pkgid()
1518 static int get_pkg_support_disable(const char *pkgid)
1521 bool support_disable;
1522 pkgmgrinfo_pkginfo_h handle = NULL;
1523 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1524 if (ret != PMINFO_R_OK)
1526 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1527 if (ret != PMINFO_R_OK) {
1528 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1531 printf("pkg support_disable: %d\n", support_disable);
1532 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1537 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1540 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1541 * @brief This API gets whethere the given package is global package or user package
1543 * @par This API is for package-manager client application
1544 * @par Sync (or) Async : Synchronous API
1546 * @param[in] handle pointer to package info handle
1547 * @param[in] global pointer to hold package global value
1548 * @return 0 if success, error code(<0) if fail
1549 * @retval PMINFO_R_OK success
1550 * @retval PMINFO_R_EINVAL invalid argument
1551 * @retval PMINFO_R_ERROR internal error
1552 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1553 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1554 * @see pkgmgrinfo_pkginfo_get_pkgid()
1555 static int get_pkg_support_disable(const char *pkgid)
1559 pkgmgrinfo_pkginfo_h handle = NULL;
1560 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1561 if (ret != PMINFO_R_OK)
1563 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1564 if (ret != PMINFO_R_OK) {
1565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1568 printf("pkg is_global: %d\n", global);
1569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1574 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1577 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1578 * @brief This API gets the package 'accessible' value from the package ID
1580 * @par This API is for package-manager client application
1581 * @par Sync (or) Async : Synchronous API
1583 * @param[in] handle pointer to package info handle
1584 * @param[out] accessible pointer to hold package accessible value
1585 * @return 0 if success, error code(<0) if fail
1586 * @retval PMINFO_R_OK success
1587 * @retval PMINFO_R_EINVAL invalid argument
1588 * @retval PMINFO_R_ERROR internal error
1589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1590 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1591 * @see pkgmgrinfo_pkginfo_get_pkgid()
1592 * @see pkgmgrinfo_pkginfo_is_readonly()
1594 static int get_pkg_accessible(const char *pkgid)
1598 pkgmgrinfo_pkginfo_h handle;
1599 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1600 if (ret != PMINFO_R_OK)
1602 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1603 if (ret != PMINFO_R_OK) {
1604 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1607 printf("pkg accessible: %d\n", accessible);
1608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1616 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1617 * @brief This API destroys the package information handle freeing up all the resources
1619 * @par This API is for package-manager client application
1620 * @par Sync (or) Async : Synchronous API
1622 * @param[in] handle pointer to the package info handle
1623 * @return 0 if success, error code(<0) if fail
1624 * @retval PMINFO_R_OK success
1625 * @retval PMINFO_R_EINVAL invalid argument
1626 * @retval PMINFO_R_ERROR internal error
1627 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1629 * @see pkgmgrinfo_pkginfo_get_pkgid()
1630 * @see pkgmgrinfo_pkginfo_is_removable()
1632 static int get_pkg_type(const char *pkgid)
1636 pkgmgrinfo_pkginfo_h handle;
1637 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1638 if (ret != PMINFO_R_OK)
1640 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1641 if (ret != PMINFO_R_OK) {
1642 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1645 printf("pkgtype: %s\n", type);
1646 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1651 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1654 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1655 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1656 The query will search the entire package information collected from the manifest file of all the installed packages
1658 * @par This API is for package-manager client application
1659 * @par Sync (or) Async : Synchronous API
1661 * @param[out] handle pointer to the package info filter handle.
1662 * @return 0 if success, error code(<0) if fail
1663 * @retval PMINFO_R_OK success
1664 * @retval PMINFO_R_EINVAL invalid argument
1665 * @retval PMINFO_R_ERROR internal error
1667 * @post pkgmgrinfo_pkginfo_filter_destroy()
1668 * @see pkgmgrinfo_pkginfo_filter_count()
1669 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1671 static int get_tpk_pkg_count()
1675 pkgmgrinfo_pkginfo_filter_h handle;
1676 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1677 if (ret != PMINFO_R_OK)
1679 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1680 if (ret != PMINFO_R_OK) {
1681 pkgmgrinfo_pkginfo_filter_destroy(handle);
1684 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1685 if (ret != PMINFO_R_OK) {
1686 pkgmgrinfo_pkginfo_filter_destroy(handle);
1689 printf("No of tpk pkgs: %d\n", count);
1690 pkgmgrinfo_pkginfo_filter_destroy(handle);
1695 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1698 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1699 * @brief This API destroys the package information filter handle freeing up all the resources
1701 * @par This API is for package-manager client application
1702 * @par Sync (or) Async : Synchronous API
1704 * @param[in] handle pointer to the package info filter handle.
1705 * @return 0 if success, error code(<0) if fail
1706 * @retval PMINFO_R_OK success
1707 * @retval PMINFO_R_EINVAL invalid argument
1708 * @retval PMINFO_R_ERROR internal error
1709 * @pre pkgmgrinfo_pkginfo_filter_create()
1711 * @see pkgmgrinfo_pkginfo_filter_count()
1712 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1714 static int get_tpk_pkg_count()
1718 pkgmgrinfo_pkginfo_filter_h handle;
1719 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1720 if (ret != PMINFO_R_OK)
1722 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1723 if (ret != PMINFO_R_OK) {
1724 pkgmgrinfo_pkginfo_filter_destroy(handle);
1727 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1728 if (ret != PMINFO_R_OK) {
1729 pkgmgrinfo_pkginfo_filter_destroy(handle);
1732 printf("No of tpk pkgs: %d\n", count);
1733 pkgmgrinfo_pkginfo_filter_destroy(handle);
1738 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1741 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1742 * @brief This API adds a boolean filter property to the filter handle
1744 * @par This API is for package-manager client application
1745 * @par Sync (or) Async : Synchronous API
1747 * @param[in] handle pointer to the package info filter handle.
1748 * @param[in] property boolean property name.
1749 * @param[in] value value corresponding to the property.
1750 * @return 0 if success, error code(<0) if fail
1751 * @retval PMINFO_R_OK success
1752 * @retval PMINFO_R_EINVAL invalid argument
1753 * @retval PMINFO_R_ERROR internal error
1754 * @pre pkgmgrinfo_pkginfo_filter_create()
1755 * @post pkgmgrinfo_pkginfo_filter_destroy()
1756 * @see pkgmgrinfo_pkginfo_filter_count()
1757 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1759 static int get_preload_pkg_count()
1763 pkgmgrinfo_pkginfo_filter_h handle;
1764 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1765 if (ret != PMINFO_R_OK)
1767 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1768 if (ret != PMINFO_R_OK) {
1769 pkgmgrinfo_pkginfo_filter_destroy(handle);
1772 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1773 if (ret != PMINFO_R_OK) {
1774 pkgmgrinfo_pkginfo_filter_destroy(handle);
1777 printf("No of preload pkgs: %d\n", count);
1778 pkgmgrinfo_pkginfo_filter_destroy(handle);
1783 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1784 const char *property, const bool value);
1787 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1788 * @brief This API adds an integer filter property to the filter handle
1790 * @par This API is for package-manager client application
1791 * @par Sync (or) Async : Synchronous API
1793 * @param[in] handle pointer to the package info filter handle.
1794 * @param[in] property integer property name.
1795 * @param[in] value value corresponding to the property.
1796 * @return 0 if success, error code(<0) if fail
1797 * @retval PMINFO_R_OK success
1798 * @retval PMINFO_R_EINVAL invalid argument
1799 * @retval PMINFO_R_ERROR internal error
1800 * @pre pkgmgrinfo_pkginfo_filter_create()
1801 * @post pkgmgrinfo_pkginfo_filter_destroy()
1802 * @see pkgmgrinfo_pkginfo_filter_count()
1803 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1805 static int get_pkg_count()
1809 pkgmgrinfo_pkginfo_filter_h handle;
1810 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1811 if (ret != PMINFO_R_OK)
1813 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1814 if (ret != PMINFO_R_OK) {
1815 pkgmgrinfo_pkginfo_filter_destroy(handle);
1818 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1819 if (ret != PMINFO_R_OK) {
1820 pkgmgrinfo_pkginfo_filter_destroy(handle);
1823 printf("No of preload pkgs: %d\n", count);
1824 pkgmgrinfo_pkginfo_filter_destroy(handle);
1829 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1830 const char *property, const int value);
1833 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1834 * @brief This API adds a string filter property to the filter handle
1836 * @par This API is for package-manager client application
1837 * @par Sync (or) Async : Synchronous API
1839 * @param[in] handle pointer to the package info filter handle.
1840 * @param[in] property string property name.
1841 * @param[in] value value corresponding to the property.
1842 * @return 0 if success, error code(<0) if fail
1843 * @retval PMINFO_R_OK success
1844 * @retval PMINFO_R_EINVAL invalid argument
1845 * @retval PMINFO_R_ERROR internal error
1846 * @pre pkgmgrinfo_pkginfo_filter_create()
1847 * @post pkgmgrinfo_pkginfo_filter_destroy()
1848 * @see pkgmgrinfo_pkginfo_filter_count()
1849 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1851 static int get_tpk_pkg_count()
1855 pkgmgrinfo_pkginfo_filter_h handle;
1856 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1857 if (ret != PMINFO_R_OK)
1859 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1860 if (ret != PMINFO_R_OK) {
1861 pkgmgrinfo_pkginfo_filter_destroy(handle);
1864 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1865 if (ret != PMINFO_R_OK) {
1866 pkgmgrinfo_pkginfo_filter_destroy(handle);
1869 printf("No of tpk pkgs: %d\n", count);
1870 pkgmgrinfo_pkginfo_filter_destroy(handle);
1875 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1876 const char *property, const char *value);
1879 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1880 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1882 * @par This API is for package-manager client application
1883 * @par Sync (or) Async : Synchronous API
1885 * @param[in] handle pointer to the package info filter handle.
1886 * @param[in] pkg_cb callback function.
1887 * @param[in] user_data user data to be passed to the callback function
1888 * @return 0 if success, error code(<0) if fail
1889 * @retval PMINFO_R_OK success
1890 * @retval PMINFO_R_EINVAL invalid argument
1891 * @retval PMINFO_R_ERROR internal error
1892 * @pre pkgmgrinfo_pkginfo_filter_create()
1893 * @post pkgmgrinfo_pkginfo_filter_destroy()
1894 * @see pkgmgrinfo_pkginfo_filter_count()
1896 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1899 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1900 printf("pkg id : %s\n", pkgid);
1904 static int get_tpk_pkg_list()
1907 pkgmgrinfo_pkginfo_filter_h handle;
1908 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1909 if (ret != PMINFO_R_OK)
1911 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1912 if (ret != PMINFO_R_OK) {
1913 pkgmgrinfo_pkginfo_filter_destroy(handle);
1916 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1917 if (ret != PMINFO_R_OK) {
1918 pkgmgrinfo_pkginfo_filter_destroy(handle);
1921 pkgmgrinfo_pkginfo_filter_destroy(handle);
1926 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1927 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1928 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1929 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1932 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1933 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1934 * @brief This API counts the package that satisfy the filter conditions
1936 * @par This API is for package-manager client application
1937 * @par Sync (or) Async : Synchronous API
1939 * @param[in] handle pointer to the package info filter handle.
1940 * @param[in] count pointer to store the count value.
1941 * @param[in] uid the addressee user id of the instruction
1942 * @return 0 if success, error code(<0) if fail
1943 * @retval PMINFO_R_OK success
1944 * @retval PMINFO_R_EINVAL invalid argument
1945 * @retval PMINFO_R_ERROR internal error
1946 * @pre pkgmgrinfo_pkginfo_filter_create()
1947 * @post pkgmgrinfo_pkginfo_filter_destroy()
1948 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1950 static int get_tpk_pkg_count()
1954 pkgmgrinfo_pkginfo_filter_h handle;
1955 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1956 if (ret != PMINFO_R_OK)
1958 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1959 if (ret != PMINFO_R_OK) {
1960 pkgmgrinfo_pkginfo_filter_destroy(handle);
1963 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1964 if (ret != PMINFO_R_OK) {
1965 pkgmgrinfo_pkginfo_filter_destroy(handle);
1968 printf("No of tpk pkgs: %d\n", count);
1969 pkgmgrinfo_pkginfo_filter_destroy(handle);
1974 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1975 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1977 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1978 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1979 * @brief This API gets the list of privilege for a particular package
1981 * @par This API is for package-manager client application
1982 * @par Sync (or) Async : Synchronous API
1983 * @param[in] handle pointer to the package info handle.
1984 * @param[in] privilege_func callback function for list
1985 * @param[in] user_data user data to be passed to callback function
1986 * @return 0 if success, error code(<0) if fail
1987 * @retval PMINFO_R_OK success
1988 * @retval PMINFO_R_EINVAL invalid argument
1989 * @retval PMINFO_R_ERROR internal error
1990 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1991 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1993 int privilege_func(const char *name, void *user_data)
1995 if (strcmp(name, (char *)user_data) == 0)
2001 static int list_privilege(const char *package, char *privilege)
2004 pkgmgrinfo_pkginfo_h handle;
2005 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2006 if (ret != PMINFO_R_OK)
2008 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2009 if (ret != PMINFO_R_OK) {
2010 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2013 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2018 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2019 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2021 /* TODO: add doxygen comment here */
2022 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2025 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2026 * @brief This API copy the application information handle
2028 * @par This API is for package-manager client application
2029 * @par Sync (or) Async : Synchronous API
2031 * @param[in] handle pointer to the package info handle.
2032 * @param[out] handle pointer to the package info handle.
2033 * @return 0 if success, error code(<0) if fail
2034 * @retval PMINFO_R_OK success
2035 * @retval PMINFO_R_EINVAL invalid argument
2036 * @retval PMINFO_R_ERROR internal error
2038 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2040 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2044 pkgmgrinfo_pkginfo_h clone;
2046 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2047 if (ret != PMINFO_R_OK)
2051 printf("package: %s\n", clone->package);
2052 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2057 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2061 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2062 pkgmgrinfo_app_list_cb app_func, void *user_data)
2063 * @brief This API gets list of installed applications for a particular package
2065 * @par This API is for package-manager client application
2066 * @par Sync (or) Async : Synchronous API
2067 * @param[in] handle package info handle
2068 * @param[in] component application component
2069 * @param[in] app_func iteration function for list
2070 * @param[in] user_data user data to be passed to callback function
2071 * @return 0 if success, error code(<0) if fail
2072 * @retval PMINFO_R_OK success
2073 * @retval PMINFO_R_EINVAL invalid argument
2074 * @retval PMINFO_R_ERROR internal error
2075 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2076 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2078 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2081 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2082 printf("appid : %s\n", appid);
2086 static int list_apps(const char *pkgid)
2089 pkgmgrinfo_pkginfo_h handle;
2090 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2091 if (ret != PMINFO_R_OK)
2093 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2094 if (ret != PMINFO_R_OK) {
2095 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2098 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2103 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2104 pkgmgrinfo_app_list_cb app_func, void *user_data);
2105 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2106 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2109 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2110 * @brief This API gets list of installed applications from all packages with minimum informaion.
2112 * @par This API is for package-manager client application
2113 * @par Sync (or) Async : Synchronous API
2114 * @param[in] app_func iteration function for list
2115 * @param[in] user_data user data to be passed to callback function
2116 * @return 0 if success, error code(<0) if fail
2117 * @retval PMINFO_R_OK success
2118 * @retval PMINFO_R_EINVAL invalid argument
2119 * @retval PMINFO_R_ERROR internal error
2123 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2125 char *pkgid1 = NULL;
2126 char *pkgid2 = NULL;
2127 pkgid1 = (char *)user_data;
2128 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2129 if (strcmp(pkgid1, pkgid2) == 0) {
2136 static int list_apps()
2139 char *name = "helloworld";
2140 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2141 if (ret != PMINFO_R_OK) {
2148 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2149 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2152 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2153 * @brief This API gets list of installed applications from all packages.
2155 * @par This API is for package-manager client application
2156 * @par Sync (or) Async : Synchronous API
2157 * @param[in] app_func iteration function for list
2158 * @param[in] user_data user data to be passed to callback function
2159 * @return 0 if success, error code(<0) if fail
2160 * @retval PMINFO_R_OK success
2161 * @retval PMINFO_R_EINVAL invalid argument
2162 * @retval PMINFO_R_ERROR internal error
2166 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2168 char *pkgid1 = NULL;
2169 char *pkgid2 = NULL;
2170 pkgid1 = (char *)user_data;
2171 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2172 if (strcmp(pkgid1, pkgid2) == 0) {
2179 static int list_apps()
2182 char *name = "helloworld";
2183 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2184 if (ret != PMINFO_R_OK) {
2191 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2192 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2195 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2196 * @brief This API creates the disabled application information handle from db
2198 * @par This API is for package-manager client application
2199 * @par Sync (or) Async : Synchronous API
2201 * @param[in] appid pointer to appid
2202 * @param[out] handle pointer to the application info handle.
2203 * @return 0 if success, error code(<0) if fail
2204 * @retval PMINFO_R_OK success
2205 * @retval PMINFO_R_EINVAL invalid argument
2206 * @retval PMINFO_R_ERROR internal error
2208 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2209 * @see pkgmgrinfo_appinfo_get_pkgid()
2210 * @see pkgmgrinfo_appinfo_is_multiple()
2212 static int get_disabled_app_type(const char *appid)
2216 pkgmgrinfo_appinfo_h handle;
2217 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2218 if (ret != PMINFO_R_OK)
2220 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2221 if (ret != PMINFO_R_OK) {
2222 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2225 printf("apptype: %s\n", type);
2226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2231 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2232 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2235 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2236 * @brief This API creates the application information handle from db
2238 * @par This API is for package-manager client application
2239 * @par Sync (or) Async : Synchronous API
2241 * @param[in] appid pointer to appid
2242 * @param[out] handle pointer to the application info handle.
2243 * @return 0 if success, error code(<0) if fail
2244 * @retval PMINFO_R_OK success
2245 * @retval PMINFO_R_EINVAL invalid argument
2246 * @retval PMINFO_R_ERROR internal error
2248 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2249 * @see pkgmgrinfo_appinfo_get_pkgid()
2250 * @see pkgmgrinfo_appinfo_is_multiple()
2252 static int get_app_type(const char *appid)
2256 pkgmgrinfo_appinfo_h handle;
2257 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2258 if (ret != PMINFO_R_OK)
2260 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2261 if (ret != PMINFO_R_OK) {
2262 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2265 printf("apptype: %s\n", type);
2266 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2271 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2272 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2275 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2276 * @brief This API gets the application ID
2278 * @par This API is for package-manager client application
2279 * @par Sync (or) Async : Synchronous API
2281 * @param[in] handle pointer to the application info handle.
2282 * @param[out] appid pointer to hold appid
2283 * @return 0 if success, error code(<0) if fail
2284 * @retval PMINFO_R_OK success
2285 * @retval PMINFO_R_EINVAL invalid argument
2286 * @retval PMINFO_R_ERROR internal error
2287 * @pre pkgmgrinfo_appinfo_get_appinfo()
2288 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2289 * @see pkgmgrinfo_appinfo_get_pkgid()
2290 * @see pkgmgrinfo_appinfo_is_multiple()
2292 static int get_app_id(const char *appid)
2295 char *app_id = NULL;
2296 pkgmgrinfo_appinfo_h handle;
2297 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2298 if (ret != PMINFO_R_OK)
2300 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2301 if (ret != PMINFO_R_OK) {
2302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2305 printf("app id: %s\n", app_id);
2306 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2311 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2314 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2315 * @brief This API gets the package name of the application
2317 * @par This API is for package-manager client application
2318 * @par Sync (or) Async : Synchronous API
2320 * @param[in] handle pointer to the application info handle.
2321 * @param[out] pkg_name pointer to hold package name
2322 * @return 0 if success, error code(<0) if fail
2323 * @retval PMINFO_R_OK success
2324 * @retval PMINFO_R_EINVAL invalid argument
2325 * @retval PMINFO_R_ERROR internal error
2326 * @pre pkgmgrinfo_appinfo_get_appinfo()
2327 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2328 * @see pkgmgrinfo_appinfo_get_appid()
2329 * @see pkgmgrinfo_appinfo_is_multiple()
2331 static int get_app_pkgname(const char *appid)
2334 char *pkgname = NULL;
2335 pkgmgrinfo_appinfo_h handle;
2336 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2337 if (ret != PMINFO_R_OK)
2339 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2340 if (ret != PMINFO_R_OK) {
2341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2344 printf("pkg name: %s\n", pkgname);
2345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2350 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2353 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2354 * @brief This API gets the package id of the application
2356 * @par This API is for package-manager client application
2357 * @par Sync (or) Async : Synchronous API
2359 * @param[in] handle pointer to the application info handle.
2360 * @param[out] pkgid pointer to hold package id
2361 * @return 0 if success, error code(<0) if fail
2362 * @retval PMINFO_R_OK success
2363 * @retval PMINFO_R_EINVAL invalid argument
2364 * @retval PMINFO_R_ERROR internal error
2365 * @pre pkgmgrinfo_appinfo_get_appinfo()
2366 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2367 * @see pkgmgrinfo_appinfo_get_appid()
2368 * @see pkgmgrinfo_appinfo_is_multiple()
2370 static int get_app_pkgid(const char *appid)
2374 pkgmgrinfo_appinfo_h handle;
2375 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2376 if (ret != PMINFO_R_OK)
2378 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2379 if (ret != PMINFO_R_OK) {
2380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2383 printf("pkg id: %s\n", pkgid);
2384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2389 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2392 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2393 * @brief This API gets the package type of the application
2395 * @par This API is for package-manager client application
2396 * @par Sync (or) Async : Synchronous API
2398 * @param[in] handle pointer to the application info handle.
2399 * @param[out] pkgtype pointer to hold package type
2400 * @return 0 if success, error code(<0) if fail
2401 * @retval PMINFO_R_OK success
2402 * @retval PMINFO_R_EINVAL invalid argument
2403 * @retval PMINFO_R_ERROR internal error
2404 * @pre pkgmgrinfo_appinfo_get_appinfo()
2405 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2406 * @see pkgmgrinfo_appinfo_get_appid()
2407 * @see pkgmgrinfo_appinfo_is_multiple()
2409 static int get_app_pkgtype(const char *appid)
2412 char *pkgtype = NULL;
2413 pkgmgrinfo_appinfo_h handle = NULL;
2414 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2415 if (ret != PMINFO_R_OK)
2417 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2418 if (ret != PMINFO_R_OK) {
2419 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2422 printf("pkgtype: %s\n", pkgtype);
2423 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2428 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2431 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2432 * @brief This API gets the executable name of the application
2434 * @par This API is for package-manager client application
2435 * @par Sync (or) Async : Synchronous API
2437 * @param[in] handle pointer to the application info handle.
2438 * @param[out] exec pointer to hold app exec name
2439 * @return 0 if success, error code(<0) if fail
2440 * @retval PMINFO_R_OK success
2441 * @retval PMINFO_R_EINVAL invalid argument
2442 * @retval PMINFO_R_ERROR internal error
2443 * @pre pkgmgrinfo_appinfo_get_appinfo()
2444 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2445 * @see pkgmgrinfo_appinfo_get_appid()
2446 * @see pkgmgrinfo_appinfo_is_multiple()
2448 static int get_app_exec(const char *appid)
2452 pkgmgrinfo_appinfo_h handle;
2453 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2454 if (ret != PMINFO_R_OK)
2456 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2457 if (ret != PMINFO_R_OK) {
2458 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2461 printf("exec name: %s\n", exec);
2462 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2467 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2470 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2471 * @brief This API gets the icon name of the application
2473 * @par This API is for package-manager client application
2474 * @par Sync (or) Async : Synchronous API
2476 * @param[in] handle pointer to the application info handle.
2477 * @param[out] icon pointer to hold app icon name
2478 * @return 0 if success, error code(<0) if fail
2479 * @retval PMINFO_R_OK success
2480 * @retval PMINFO_R_EINVAL invalid argument
2481 * @retval PMINFO_R_ERROR internal error
2482 * @pre pkgmgrinfo_appinfo_get_appinfo()
2483 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2484 * @see pkgmgrinfo_appinfo_get_appid()
2485 * @see pkgmgrinfo_appinfo_is_multiple()
2487 static int get_app_icon(const char *appid)
2491 pkgmgrinfo_appinfo_h handle;
2492 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2493 if (ret != PMINFO_R_OK)
2495 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2496 if (ret != PMINFO_R_OK) {
2497 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2500 printf("icon name: %s\n", icon);
2501 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2506 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2509 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2510 * @brief This API gets the label of the application
2512 * @par This API is for package-manager client application
2513 * @par Sync (or) Async : Synchronous API
2515 * @param[in] handle pointer to the application info handle.
2516 * @param[out] label pointer to hold app label
2517 * @return 0 if success, error code(<0) if fail
2518 * @retval PMINFO_R_OK success
2519 * @retval PMINFO_R_EINVAL invalid argument
2520 * @retval PMINFO_R_ERROR internal error
2521 * @pre pkgmgrinfo_appinfo_get_appinfo()
2522 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2523 * @see pkgmgrinfo_appinfo_get_appid()
2524 * @see pkgmgrinfo_appinfo_is_multiple()
2526 static int get_app_label(const char *appid)
2530 pkgmgrinfo_appinfo_h handle;
2531 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2532 if (ret != PMINFO_R_OK)
2534 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2535 if (ret != PMINFO_R_OK) {
2536 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2539 printf("label : %s\n", label);
2540 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2545 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2548 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2549 * @brief This API gets exactly matched label by given appid and locale
2551 * @par This API is for package-manager client application
2552 * @par Sync (or) Async : Synchronous API
2554 * @param[in] appid pointer to appid
2555 * @param[in] locale pointer to locale
2556 * @param[out] label pointer to hold app label
2557 * @return 0 if success, error code(<0) if fail
2558 * @retval PMINFO_R_OK success
2559 * @retval PMINFO_R_EINVAL invalid argument
2560 * @retval PMINFO_R_ERROR internal error
2562 static int get_localed_label(const char *appid, const char *locale)
2567 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2568 if (ret != PMINFO_R_OK)
2571 printf("localed label: %s\n", label);
2579 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2580 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2583 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2584 * @brief This API gets metadata value by given metadata key
2586 * @par This API is for package-manager client application
2587 * @par Sync (or) Async : Synchronous API
2589 * @param[in] handle pointer to the application info handle
2590 * @param[in] metadata_key metadata key
2591 * @param[out] metadata_value pointer to hold metadata value
2592 * @return 0 if success, error code(<0) if fail
2593 * @retval PMINFO_R_OK success
2594 * @retval PMINFO_R_EINVAL invalid argument
2596 static int get_metadata_value(const char *appid, const char *metadata_key)
2599 pkgmgrinfo_appinfo_h handle = NULL;
2600 char *metadata_value = NULL;
2602 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2603 if (ret != PMINFO_R_OK)
2606 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2607 if (ret != PMINFO_R_OK) {
2608 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2612 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2617 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2620 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2621 * @brief This API gets the component of the application
2623 * @par This API is for package-manager client application
2624 * @par Sync (or) Async : Synchronous API
2626 * @param[in] handle pointer to the application info handle.
2627 * @param[out] component pointer to hold app component
2628 * @return 0 if success, error code(<0) if fail
2629 * @retval PMINFO_R_OK success
2630 * @retval PMINFO_R_EINVAL invalid argument
2631 * @retval PMINFO_R_ERROR internal error
2632 * @pre pkgmgrinfo_appinfo_get_appinfo()
2633 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2634 * @see pkgmgrinfo_appinfo_get_appid()
2635 * @see pkgmgrinfo_appinfo_is_multiple()
2637 static int get_app_component(const char *appid)
2640 pkgmgrinfo_app_component component;
2641 pkgmgrinfo_appinfo_h handle;
2642 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2643 if (ret != PMINFO_R_OK)
2645 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2646 if (ret != PMINFO_R_OK) {
2647 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2650 printf("component : %s\n", component);
2651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2656 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2659 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2660 * @brief This API gets the apptype of the application
2662 * @par This API is for package-manager client application
2663 * @par Sync (or) Async : Synchronous API
2665 * @param[in] handle pointer to the application info handle.
2666 * @param[out] app_type pointer to hold apptype
2667 * @return 0 if success, error code(<0) if fail
2668 * @retval PMINFO_R_OK success
2669 * @retval PMINFO_R_EINVAL invalid argument
2670 * @retval PMINFO_R_ERROR internal error
2671 * @pre pkgmgrinfo_appinfo_get_appinfo()
2672 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2673 * @see pkgmgrinfo_appinfo_get_appid()
2674 * @see pkgmgrinfo_appinfo_is_multiple()
2676 static int get_app_type(const char *appid)
2679 char *apptype = NULL;
2680 pkgmgrinfo_appinfo_h handle;
2681 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2682 if (ret != PMINFO_R_OK)
2684 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2685 if (ret != PMINFO_R_OK) {
2686 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2689 printf("apptype : %s\n", apptype);
2690 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2695 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2698 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2699 int *operation_count, char ***operation)
2700 * @brief This API gets the list of operation of the application
2702 * @par This API is for package-manager client application
2703 * @par Sync (or) Async : Synchronous API
2705 * @param[in] handle pointer to the appcontrol handle.
2706 * @param[out] operation_count pointer to hold number of operations
2707 * @param[out] operation pointer to hold list of operations
2708 * @return 0 if success, error code(<0) if fail
2709 * @retval PMINFO_R_OK success
2710 * @retval PMINFO_R_EINVAL invalid argument
2711 * @retval PMINFO_R_ERROR internal error
2712 * @pre pkgmgrinfo_appinfo_get_appinfo()
2713 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2714 * @see pkgmgrinfo_appinfo_get_uri()
2715 * @see pkgmgrinfo_appinfo_get_mime()
2717 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2722 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2723 for (i = 0; i < oc; i++) {
2724 if (strcmp(operation[i], (char *)user_data) == 0)
2731 static int check_operation(const char *appid, char *operation)
2734 pkgmgrinfo_appinfo_h handle;
2735 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2736 if (ret != PMINFO_R_OK)
2738 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2739 if (ret != PMINFO_R_OK) {
2740 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2748 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2749 int *operation_count, char ***operation);
2752 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2753 int *uri_count, char ***uri)
2754 * @brief This API gets the list of uri of the application
2756 * @par This API is for package-manager client application
2757 * @par Sync (or) Async : Synchronous API
2759 * @param[in] handle pointer to the appcontrol handle.
2760 * @param[out] uri_count pointer to hold number of uris
2761 * @param[out] uri pointer to hold list of uris
2762 * @return 0 if success, error code(<0) if fail
2763 * @retval PMINFO_R_OK success
2764 * @retval PMINFO_R_EINVAL invalid argument
2765 * @retval PMINFO_R_ERROR internal error
2766 * @pre pkgmgrinfo_appinfo_get_appinfo()
2767 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2768 * @see pkgmgrinfo_appinfo_get_operation()
2769 * @see pkgmgrinfo_appinfo_get_mime()
2771 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2776 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2777 for (i = 0; i < uc; i++) {
2778 if (strcmp(uri[i], (char *)user_data) == 0)
2785 static int check_uri(const char *appid, char *uri)
2788 pkgmgrinfo_appinfo_h handle;
2789 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2790 if (ret != PMINFO_R_OK)
2792 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2793 if (ret != PMINFO_R_OK) {
2794 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2797 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2802 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2803 int *uri_count, char ***uri);
2806 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2807 int *mime_count, char ***mime)
2808 * @brief This API gets the list of mime of the application
2810 * @par This API is for package-manager client application
2811 * @par Sync (or) Async : Synchronous API
2813 * @param[in] handle pointer to the appcontrol handle.
2814 * @param[out] mime_count pointer to hold number of mimes
2815 * @param[out] mime pointer to hold list of mimes
2816 * @return 0 if success, error code(<0) if fail
2817 * @retval PMINFO_R_OK success
2818 * @retval PMINFO_R_EINVAL invalid argument
2819 * @retval PMINFO_R_ERROR internal error
2820 * @pre pkgmgrinfo_appinfo_get_appinfo()
2821 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2822 * @see pkgmgrinfo_appinfo_get_uri()
2823 * @see pkgmgrinfo_appinfo_get_operation()
2825 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2830 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2831 for (i = 0; i < mc; i++) {
2832 if (strcmp(mime[i], (char *)user_data) == 0)
2839 static int check_mime(const char *appid, char *mime)
2842 pkgmgrinfo_appinfo_h handle;
2843 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2844 if (ret != PMINFO_R_OK)
2846 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2847 if (ret != PMINFO_R_OK) {
2848 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2851 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2856 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2857 int *mime_count, char ***mime);
2860 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2861 int *subapp_count, char ***subapp)
2862 * @brief This API gets the list of subapp of the application
2864 * @par This API is for package-manager client application
2865 * @par Sync (or) Async : Synchronous API
2867 * @param[in] handle pointer to the appcontrol handle.
2868 * @param[out] subapp_count pointer to hold number of subapp
2869 * @param[out] subapp pointer to hold list of subapp
2870 * @return 0 if success, error code(<0) if fail
2871 * @retval PMINFO_R_OK success
2872 * @retval PMINFO_R_EINVAL invalid argument
2873 * @retval PMINFO_R_ERROR internal error
2874 * @pre pkgmgrinfo_appinfo_get_appinfo()
2875 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2876 * @see pkgmgrinfo_appinfo_get_uri()
2877 * @see pkgmgrinfo_appinfo_get_operation()
2879 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2883 char **subapp = NULL;
2884 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2885 for (i = 0; i < sc; i++) {
2886 if (strcmp(subapp[i], (char *)user_data) == 0)
2893 static int check_subapp(const char *appid, char *subapp)
2896 pkgmgrinfo_appinfo_h handle = NULL;
2897 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2898 if (ret != PMINFO_R_OK)
2900 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2901 if (ret != PMINFO_R_OK) {
2902 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2910 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2911 int *subapp_count, char ***subapp);
2914 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2915 * @brief This API gets the notification icon of the application
2917 * @par This API is for package-manager client application
2918 * @par Sync (or) Async : Synchronous API
2920 * @param[in] handle pointer to the application info handle.
2921 * @param[out] path pointer to hold notification icon
2922 * @return 0 if success, error code(<0) if fail
2923 * @retval PMINFO_R_OK success
2924 * @retval PMINFO_R_EINVAL invalid argument
2925 * @retval PMINFO_R_ERROR internal error
2926 * @pre pkgmgrinfo_appinfo_get_appinfo()
2927 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2928 * @see pkgmgrinfo_appinfo_get_appid()
2929 * @see pkgmgrinfo_appinfo_is_multiple()
2931 static int get_app_notification_icon(const char *appid)
2934 char *notification_icon = NULL;
2935 pkgmgrinfo_appinfo_h handle;
2936 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2937 if (ret != PMINFO_R_OK)
2939 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2940 if (ret != PMINFO_R_OK) {
2941 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2944 printf("notification icon : %s\n", notification_icon);
2945 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2950 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2953 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2954 * @brief This API gets the setting icon of the application
2956 * @par This API is for package-manager client application
2957 * @par Sync (or) Async : Synchronous API
2959 * @param[in] handle pointer to the application info handle.
2960 * @param[out] path pointer to hold setting icon
2961 * @return 0 if success, error code(<0) if fail
2962 * @retval PMINFO_R_OK success
2963 * @retval PMINFO_R_EINVAL invalid argument
2964 * @retval PMINFO_R_ERROR internal error
2965 * @pre pkgmgrinfo_appinfo_get_appinfo()
2966 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2967 * @see pkgmgrinfo_appinfo_get_appid()
2968 * @see pkgmgrinfo_appinfo_is_multiple()
2970 static int get_app_setting_icon(const char *appid)
2973 char *setting_icon = NULL;
2974 pkgmgrinfo_appinfo_h handle;
2975 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2976 if (ret != PMINFO_R_OK)
2978 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2979 if (ret != PMINFO_R_OK) {
2980 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2983 printf("setting icon : %s\n", setting_icon);
2984 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2989 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2992 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2993 * @brief This API gets the type of recent image on app-tray
2995 * @par This API is for package-manager client application
2996 * @par Sync (or) Async : Synchronous API
2998 * @param[in] handle pointer to the application info handle.
2999 * @param[out] type pointer to hold image type
3000 * @return 0 if success, error code(<0) if fail
3001 * @retval PMINFO_R_OK success
3002 * @retval PMINFO_R_EINVAL invalid argument
3003 * @retval PMINFO_R_ERROR internal error
3004 * @pre pkgmgrinfo_appinfo_get_appinfo()
3005 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3006 * @see pkgmgrinfo_appinfo_get_appid()
3007 * @see pkgmgrinfo_appinfo_is_multiple()
3009 static int get_app_recent_image_type(const char *appid)
3012 pkgmgrinfo_app_recentimage type;
3013 pkgmgrinfo_appinfo_h handle;
3014 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3015 if (ret != PMINFO_R_OK)
3017 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3018 if (ret != PMINFO_R_OK) {
3019 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3022 printf("recent image type: %d\n", type);
3023 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3028 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3032 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3033 * @brief This API gets the preview image of application
3035 * @par Sync (or) Async : Synchronous API
3037 * @param[in] handle pointer to the application info handle.
3038 * @param[out] preview_img pointer to hold preview image path
3039 * @return 0 if success, error code(<0) if fail
3040 * @retval PMINFO_R_OK success
3041 * @retval PMINFO_R_EINVAL invalid argument
3042 * @retval PMINFO_R_ERROR internal error
3043 * @pre pkgmgrinfo_appinfo_get_appinfo()
3044 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3045 * @see pkgmgrinfo_appinfo_get_appid()
3047 static int get_app_previewimage(const char *appid)
3050 char *preview = NULL;
3051 pkgmgrinfo_appinfo_h handle = NULL;
3052 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3053 if (ret != PMINFO_R_OK)
3055 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3056 if (ret != PMINFO_R_OK) {
3057 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3060 printf("preview image path : %s\n", preview);
3061 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3066 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3070 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3071 * @brief This API gets the package permission type of the application
3073 * @par This API is for package-manager client application
3074 * @par Sync (or) Async : Synchronous API
3076 * @param[in] handle pointer to the application info handle.
3077 * @param[out] permission pointer to hold package permission
3078 * @return 0 if success, error code(<0) if fail
3079 * @retval PMINFO_R_OK success
3080 * @retval PMINFO_R_EINVAL invalid argument
3081 * @retval PMINFO_R_ERROR internal error
3082 * @pre pkgmgrinfo_appinfo_get_appinfo()
3083 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3084 * @see pkgmgrinfo_appinfo_get_appid()
3086 static int get_app_permission(const char *appid)
3089 pkgmgrinfo_permission_type permission = 0;
3090 pkgmgrinfo_appinfo_h handle;
3092 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3093 if (ret != PMINFO_R_OK)
3095 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3096 if (ret != PMINFO_R_OK) {
3097 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3100 printf("permission type: %d\n", permission);
3101 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3106 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3109 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3110 * @brief This API gets the component_type
3112 * @par This API is for package-manager client application
3113 * @par Sync (or) Async : Synchronous API
3115 * @param[in] handle pointer to the application info handle.
3116 * @param[out] component_type pointer to hold component_type
3117 * @return 0 if success, error code(<0) if fail
3118 * @retval PMINFO_R_OK success
3119 * @retval PMINFO_R_EINVAL invalid argument
3120 * @retval PMINFO_R_ERROR internal error
3121 * @pre pkgmgrinfo_appinfo_get_appinfo()
3122 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3123 * @see pkgmgrinfo_appinfo_get_pkgid()
3124 * @see pkgmgrinfo_appinfo_is_multiple()
3126 static int get_component_type(const char *appid)
3129 char *component_type = NULL;
3130 pkgmgrinfo_appinfo_h handle;
3131 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3132 if (ret != PMINFO_R_OK)
3134 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3135 if (ret != PMINFO_R_OK) {
3136 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3139 printf("component_type: %s\n", component_type);
3140 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3145 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3148 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3149 * @brief This API gets the application 'hwacceleration' value from the app ID
3151 * @par This API is for package-manager client application
3152 * @par Sync (or) Async : Synchronous API
3154 * @param[in] handle pointer to application info handle
3155 * @param[out] hwacceleration pointer to hold package hwacceleration value
3156 * @return 0 if success, error code(<0) if fail
3157 * @retval PMINFO_R_OK success
3158 * @retval PMINFO_R_EINVAL invalid argument
3159 * @retval PMINFO_R_ERROR internal error
3160 * @pre pkgmgrinfo_appinfo_get_appinfo()
3161 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3162 * @see pkgmgrinfo_appinfo_get_appid()
3163 * @see pkgmgrinfo_appinfo_is_multiple()
3165 static int get_app_hwacceleration(const char *appid)
3168 pkgmgrinfo_app_hwacceleration hwacceleration;
3169 pkgmgrinfo_appinfo_h handle;
3170 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3171 if (ret != PMINFO_R_OK)
3173 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3174 if (ret != PMINFO_R_OK) {
3175 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3178 printf("app hwacceleration: %d\n", hwacceleration);
3179 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3184 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3187 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3188 * @brief This API gets the application 'screenreader' value from the app ID
3190 * @par This API is for package-manager client application
3191 * @par Sync (or) Async : Synchronous API
3193 * @param[in] handle pointer to application info handle
3194 * @param[out] screenreader pointer to hold package accessibility value
3195 * @return 0 if success, error code(<0) if fail
3196 * @retval PMINFO_R_OK success
3197 * @retval PMINFO_R_EINVAL invalid argument
3198 * @retval PMINFO_R_ERROR internal error
3199 * @pre pkgmgrinfo_appinfo_get_appinfo()
3200 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3201 * @see pkgmgrinfo_appinfo_get_appid()
3202 * @see pkgmgrinfo_appinfo_is_multiple()
3204 static int get_app_screenreader(const char *appid)
3207 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3208 pkgmgrinfo_appinfo_h handle = NULL;
3209 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3210 if (ret != PMINFO_R_OK)
3212 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3213 if (ret != PMINFO_R_OK) {
3214 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3217 printf("app screenreader: %d\n", screenreader);
3218 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3223 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3226 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3227 * @brief This API gets the application's landscape & portrait effect images
3229 * @par This API is for package-manager client application
3230 * @par Sync (or) Async : Synchronous API
3232 * @param[in] handle pointer to application info handle
3233 * @param[out] portrait_img contains portrait mode effect image
3234 * @param[out] landscape_img contains landscape mode effect image
3235 * @return 0 if success, error code(<0) if fail
3236 * @retval PMINFO_R_OK success
3237 * @retval PMINFO_R_EINVAL invalid argument
3238 * @retval PMINFO_R_ERROR internal error
3239 * @pre pkgmgrinfo_appinfo_get_appinfo()
3240 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3241 * @see pkgmgrinfo_appinfo_get_appid()
3242 * @see pkgmgrinfo_appinfo_is_nodisplay()
3244 static int get_app_effectimages(const char *appid)
3247 char *portraitimg = NULL;
3248 char *landscapeimg = NULL;
3249 pkgmgrinfo_appinfo_h handle;
3250 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3251 if (ret != PMINFO_R_OK)
3253 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3254 if (ret != PMINFO_R_OK) {
3255 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3258 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3259 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3264 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3267 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3268 * @brief This API gets the application's effect image type
3270 * @par This API is for package-manager client application
3271 * @par Sync (or) Async : Synchronous API
3273 * @param[in] handle pointer to application info handle
3274 * @param[out] effectimg_type contains effect image type
3275 * @return 0 if success, error code(<0) if fail
3276 * @retval PMINFO_R_OK success
3277 * @retval PMINFO_R_EINVAL invalid argument
3278 * @retval PMINFO_R_ERROR internal error
3279 * @pre pkgmgrinfo_appinfo_get_appinfo()
3280 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3281 * @see pkgmgrinfo_appinfo_get_appid()
3282 * @see pkgmgrinfo_appinfo_is_nodisplay()
3284 static int get_app_effectimage_type(const char *appid)
3287 char *effectimg_type = NULL;
3288 pkgmgrinfo_appinfo_h handle = NULL;
3289 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3290 if (ret != PMINFO_R_OK)
3292 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3293 if (ret != PMINFO_R_OK) {
3294 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3297 printf("app effect image type: %s\n", effectimg_type);
3298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3303 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3306 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3307 * @brief This API gets the submode_mainid of the application
3309 * @par This API is for package-manager client application
3310 * @par Sync (or) Async : Synchronous API
3312 * @param[in] handle pointer to the application info handle.
3313 * @param[out] submode_mainid pointer to hold package name
3314 * @return 0 if success, error code(<0) if fail
3315 * @retval PMINFO_R_OK success
3316 * @retval PMINFO_R_EINVAL invalid argument
3317 * @retval PMINFO_R_ERROR internal error
3318 * @pre pkgmgrinfo_appinfo_get_appinfo()
3319 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3320 * @see pkgmgrinfo_appinfo_get_appid()
3321 * @see pkgmgrinfo_appinfo_is_multiple()
3323 static int get_app_submode_mainid(const char *appid)
3326 char *submode_mainid = NULL;
3327 pkgmgrinfo_appinfo_h handle = NULL;
3328 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3329 if (ret != PMINFO_R_OK)
3331 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3332 if (ret != PMINFO_R_OK) {
3333 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3336 printf("submode_mainid: %s\n", submode_mainid);
3337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3342 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3345 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3346 * @brief This API gets the datacontrol info
3348 * @par This API is for package-manager client application
3349 * @par Sync (or) Async : Synchronous API
3351 * @param[in] providerid pointer to the providerid of dataconltrol.
3352 * @param[in] type pointer to the type of dataconltrol.
3353 * @param[out] appid pointer to hold appid, need to free after using
3354 * @param[out] access pointer to hold access, need to free after using
3355 * @return 0 if success, error code(<0) if fail
3356 * @retval PMINFO_R_OK success
3357 * @retval PMINFO_R_EINVAL invalid argument
3358 * @retval PMINFO_R_ERROR internal error
3361 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3362 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3365 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3366 * @brief This API gets the appid of datacontrol
3368 * @par This API is for package-manager client application
3369 * @par Sync (or) Async : Synchronous API
3371 * @param[in] providerid pointer to the providerid of dataconltrol.
3372 * @param[out] appid pointer to hold appid, need to free after using
3373 * @return 0 if success, error code(<0) if fail
3374 * @retval PMINFO_R_OK success
3375 * @retval PMINFO_R_EINVAL invalid argument
3376 * @retval PMINFO_R_ERROR internal error
3379 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3380 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3383 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3384 * @brief This API gets the alias_appid of the application
3386 * @par This API is for package-manager client application
3387 * @par Sync (or) Async : Synchronous API
3389 * @param[in] handle pointer to the application info handle.
3390 * @param[out] alias_appid pointer to hold app alias_appid
3391 * @return 0 if success, error code(<0) if fail
3392 * @retval PMINFO_R_OK success
3393 * @retval PMINFO_R_EINVAL invalid argument
3394 * @retval PMINFO_R_ERROR internal error
3395 * @pre pkgmgrinfo_appinfo_get_appinfo()
3396 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3397 * @see pkgmgrinfo_appinfo_get_appid()
3399 static int get_alias_appid(const char *appid)
3402 char *alias_appid= 0;
3403 pkgmgrinfo_appinfo_h handle = NULL;
3404 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3405 if (ret != PMINFO_R_OK)
3407 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3408 if (ret != PMINFO_R_OK) {
3409 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3412 printf("alias_appid: %s\n", alias_appid);
3413 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3418 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3421 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3422 * @brief This API gets the effective_appid of the application
3424 * @par This API is for package-manager client application
3425 * @par Sync (or) Async : Synchronous API
3427 * @param[in] handle pointer to the application info handle.
3428 * @param[out] effective_appid pointer to hold app effective_appid
3429 * @return 0 if success, error code(<0) if fail
3430 * @retval PMINFO_R_OK success
3431 * @retval PMINFO_R_EINVAL invalid argument
3432 * @retval PMINFO_R_ERROR internal error
3433 * @pre pkgmgrinfo_appinfo_get_appinfo()
3434 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3435 * @see pkgmgrinfo_appinfo_get_appid()
3437 static int get_effective_appid(const char *appid)
3440 char *effective_appid= 0;
3441 pkgmgrinfo_appinfo_h handle = NULL;
3442 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3443 if (ret != PMINFO_R_OK)
3445 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3446 if (ret != PMINFO_R_OK) {
3447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3450 printf("effective_appid: %s\n", effective_appid);
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3459 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3460 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3462 * @par This API is for package-manager client application
3463 * @par Sync (or) Async : Synchronous API
3465 * @param[in] handle pointer to the appinfo handle.
3466 * @param[out] tep_name pointer to hold tep name
3467 * @return 0 if success, error code(<0) if fail
3468 * @retval PMINFO_R_OK success
3469 * @retval PMINFO_R_EINVAL invalid argument
3470 * @retval PMINFO_R_ERROR internal error
3471 * @pre pkgmgrinfo_appinfo_get_appinfo()
3472 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3473 * @see pkgmgrinfo_appinfo_get_appid()
3475 static int get_tep_name(const char *appid)
3478 char *tep_name = NULL;
3479 pkgmgrinfo_appinfo_h handle = NULL;
3480 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3481 if (ret != PMINFO_R_OK)
3483 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3484 if (ret != PMINFO_R_OK) {
3485 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3488 printf("TEP name is: %s\n", tep_name);
3489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3494 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3497 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3498 * @brief This API gets zip mount file name associated with the package which contain given application
3499 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3501 * @par This API is for package-manager client application
3502 * @par Sync (or) Async : Synchronous API
3504 * @param[in] handle pointer to the appinfo handle.
3505 * @param[out] zip_mount_file pointer to hold zip mount file name
3506 * @return 0 if success, error code(<0) if fail
3507 * @retval PMINFO_R_OK success
3508 * @retval PMINFO_R_EINVAL invalid argument
3509 * @retval PMINFO_R_ERROR internal error
3510 * @pre pkgmgrinfo_appinfo_get_appinfo()
3511 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3512 * @see pkgmgrinfo_appinfo_get_appid()
3514 static int get_zip_mount_file(const char *appid)
3517 char *zip_mount_file = NULL;
3518 pkgmgrinfo_appinfo_h handle = NULL;
3519 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3520 if (ret != PMINFO_R_OK)
3522 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3523 if (ret != PMINFO_R_OK) {
3524 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3527 printf("Mount file name is: %s\n", zip_mount_file);
3528 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3533 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3536 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3537 * @brief This API gets the root path of application
3539 * @par Sync (or) Async : Synchronous API
3541 * @param[in] handle pointer to appinfo handle
3542 * @param[out] path pointer to hold root path of application
3543 * @return 0 if success, error code(<0) if fail
3544 * @retval PMINFO_R_OK success
3545 * @retval PMINFO_R_EINVAL invalid argument
3546 * @retval PMINFO_R_ERROR internal error
3548 static int get_root_path(const char *appid)
3552 pkgmgrinfo_appinfo_h handle;
3553 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3554 if (ret != PMINFO_R_OK)
3557 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3558 if (ret != PMINFO_R_OK) {
3559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3562 printf("path : %s\n", path);
3563 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3569 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3572 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3573 * @brief This API gets the application api_version from the application ID
3575 * @par This API is for package-manager client application
3576 * @par Sync (or) Async : Synchronous API
3578 * @param[in] handle pointer to appinfo handle
3579 * @param[out] api_version pointer to hold application api_version
3580 * @return 0 if success, error code(<0) if fail
3581 * @retval PMINFO_R_OK success
3582 * @retval PMINFO_R_EINVAL invalid argument
3583 * @retval PMINFO_R_ERROR internal error
3584 * @pre pkgmgrinfo_appinfo_get_appinfo()
3585 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3586 * @see pkgmgrinfo_appinfo_get_appid()
3588 static int get_app_api_version(const char *appid)
3591 char *api_version = NULL;
3592 pkgmgrinfo_appinfo_h handle = NULL;
3593 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3594 if (ret != PMINFO_R_OK)
3596 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3597 if (ret != PMINFO_R_OK) {
3598 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3601 printf("app api_version: %s\n", api_version);
3602 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3607 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3610 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3611 * @brief This API gets the installed_time of the application
3613 * @par This API is for package-manager client application
3614 * @par Sync (or) Async : Synchronous API
3616 * @param[in] handle pointer to the application info handle.
3617 * @param[out] installed_time pointer to hold installed_time
3618 * @return 0 if success, error code(<0) if fail
3619 * @retval PMINFO_R_OK success
3620 * @retval PMINFO_R_EINVAL invalid argument
3621 * @retval PMINFO_R_ERROR internal error
3622 * @pre pkgmgrinfo_appinfo_get_appinfo()
3623 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3624 * @see pkgmgrinfo_appinfo_get_appid()
3625 * @see pkgmgrinfo_appinfo_is_multiple()
3627 static int get_app_installed_time(const char *appid)
3630 int installed_time = 0;
3631 pkgmgrinfo_appinfo_h handle = NULL;
3632 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3633 if (ret != PMINFO_R_OK)
3635 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
3636 if (ret != PMINFO_R_OK) {
3637 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3640 printf("installed_time: %d\n", installed_time);
3641 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3646 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
3649 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
3650 * @brief This API gets the support_mode of the application
3652 * @par This API is for package-manager client application
3653 * @par Sync (or) Async : Synchronous API
3655 * @param[in] handle pointer to the application info handle.
3656 * @param[out] support_mode pointer to hold app support_mode
3657 * @return 0 if success, error code(<0) if fail
3658 * @retval PMINFO_R_OK success
3659 * @retval PMINFO_R_EINVAL invalid argument
3660 * @retval PMINFO_R_ERROR internal error
3661 * @pre pkgmgrinfo_appinfo_get_appinfo()
3662 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3663 * @see pkgmgrinfo_appinfo_get_appid()
3665 static int get_app_support_mode(const char *appid)
3668 int support_mode = 0;
3669 pkgmgrinfo_appinfo_h handle = NULL;
3670 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3671 if (ret != PMINFO_R_OK)
3673 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
3674 if (ret != PMINFO_R_OK) {
3675 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3678 printf("support_mode: %s\n", support_mode);
3679 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3684 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
3687 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3688 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3689 * @brief This API gets the list of permission for a particular application
3691 * @par This API is for package-manager client application
3692 * @par Sync (or) Async : Synchronous API
3693 * @param[in] handle pointer to the application info handle.
3694 * @param[in] permission_func callback function for list
3695 * @param[in] user_data user data to be passed to callback function
3696 * @return 0 if success, error code(<0) if fail
3697 * @retval PMINFO_R_OK success
3698 * @retval PMINFO_R_EINVAL invalid argument
3699 * @retval PMINFO_R_ERROR internal error
3700 * @pre pkgmgrinfo_appinfo_get_appinfo()
3701 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3703 int permission_func(const char *name, void *user_data)
3705 if (strcmp(name, (char *)user_data) == 0)
3711 static int list_permission(const char *appid, char *permission)
3714 pkgmgrinfo_appinfo_h handle;
3715 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3716 if (ret != PMINFO_R_OK)
3718 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3719 if (ret != PMINFO_R_OK) {
3720 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3723 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3728 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3729 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3732 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3733 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3734 * @brief This API gets the list of category for a particular application
3736 * @par This API is for package-manager client application
3737 * @par Sync (or) Async : Synchronous API
3738 * @param[in] handle pointer to the application info handle.
3739 * @param[in] category_func callback function for list
3740 * @param[in] user_data user data to be passed to callback function
3741 * @return 0 if success, error code(<0) if fail
3742 * @retval PMINFO_R_OK success
3743 * @retval PMINFO_R_EINVAL invalid argument
3744 * @retval PMINFO_R_ERROR internal error
3745 * @pre pkgmgrinfo_appinfo_get_appinfo()
3746 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3748 int category_func(const char *name, void *user_data)
3750 if (strcmp(name, (char *)user_data) == 0)
3756 static int list_category(const char *appid, char *category)
3759 pkgmgrinfo_appinfo_h handle;
3760 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3761 if (ret != PMINFO_R_OK)
3763 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3764 if (ret != PMINFO_R_OK) {
3765 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3768 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3773 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3774 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3777 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3778 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3779 * @brief This API gets the list of metadata for a particular application
3781 * @par This API is for package-manager client application
3782 * @par Sync (or) Async : Synchronous API
3783 * @param[in] handle pointer to the application info handle.
3784 * @param[in] metadata_func callback function for list
3785 * @param[in] user_data user data to be passed to callback function
3786 * @return 0 if success, error code(<0) if fail
3787 * @retval PMINFO_R_OK success
3788 * @retval PMINFO_R_EINVAL invalid argument
3789 * @retval PMINFO_R_ERROR internal error
3790 * @pre pkgmgrinfo_appinfo_get_appinfo()
3791 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3793 int metadata_func(const char *key, const char *value, void *user_data)
3795 if (strcmp(key, (char *)user_data) == 0) {
3796 printf("Value is %s\n", value);
3803 static int list_metadata(const char *appid, char *key)
3806 pkgmgrinfo_appinfo_h handle;
3807 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3808 if (ret != PMINFO_R_OK)
3810 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3811 if (ret != PMINFO_R_OK) {
3812 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3815 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3820 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3821 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3825 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3826 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3827 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3828 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3829 * @brief This API gets the list of app-control for a particular application
3831 * @par This API is for package-manager client application
3832 * @par Sync (or) Async : Synchronous API
3833 * @param[in] handle pointer to the application info handle.
3834 * @param[in] appcontrol_func callback function for list
3835 * @param[in] user_data user data to be passed to callback function
3836 * @param[in] uid the addressee user id of the instruction
3837 * @return 0 if success, error code(<0) if fail
3838 * @retval PMINFO_R_OK success
3839 * @retval PMINFO_R_EINVAL invalid argument
3840 * @retval PMINFO_R_ERROR internal error
3841 * @pre pkgmgrinfo_appinfo_get_appinfo()
3842 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3844 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3849 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3850 for (i = 0; i < oc; i++) {
3851 if (strcmp(operation[i], (char *)user_data) == 0)
3858 static int check_operation(const char *appid, char *operation)
3861 pkgmgrinfo_appinfo_h handle;
3862 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3863 if (ret != PMINFO_R_OK)
3865 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3866 if (ret != PMINFO_R_OK) {
3867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3870 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3875 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3876 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3881 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3882 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3885 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3886 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3887 * @brief This API gets the list of splashscreen for a particular application
3889 * @par This API is for package-manager client application
3890 * @par Sync (or) Async : Synchronous API
3891 * @param[in] handle pointer to the application info handle.
3892 * @param[in] splash_screen_func callback function for list
3893 * @param[in] user_data user data to be passed to callback function
3894 * @return 0 if success, error code(<0) if fail
3895 * @retval PMINFO_R_OK success
3896 * @retval PMINFO_R_EINVAL invalid argument
3897 * @retval PMINFO_R_ERROR internal error
3898 * @pre pkgmgrinfo_appinfo_get_appinfo()
3899 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3902 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3903 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3906 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3907 * @brief This API gets the application 'nodisplay' value from the app ID
3909 * @par This API is for package-manager client application
3910 * @par Sync (or) Async : Synchronous API
3912 * @param[in] handle pointer to application info handle
3913 * @param[out] nodisplay pointer to hold package nodisplay value
3914 * @return 0 if success, error code(<0) if fail
3915 * @retval PMINFO_R_OK success
3916 * @retval PMINFO_R_EINVAL invalid argument
3917 * @retval PMINFO_R_ERROR internal error
3918 * @pre pkgmgrinfo_appinfo_get_appinfo()
3919 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3920 * @see pkgmgrinfo_appinfo_get_appid()
3921 * @see pkgmgrinfo_appinfo_is_multiple()
3923 static int get_app_nodisplay(const char *appid)
3927 pkgmgrinfo_appinfo_h handle;
3928 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3929 if (ret != PMINFO_R_OK)
3931 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3932 if (ret != PMINFO_R_OK) {
3933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3936 printf("app nodisplay: %d\n", nodisplay);
3937 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3942 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3945 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3946 * @brief This API gets the application 'multiple' value from the app ID
3948 * @par This API is for package-manager client application
3949 * @par Sync (or) Async : Synchronous API
3951 * @param[in] handle pointer to application info handle
3952 * @param[out] multiple pointer to hold package multiple value
3953 * @return 0 if success, error code(<0) if fail
3954 * @retval PMINFO_R_OK success
3955 * @retval PMINFO_R_EINVAL invalid argument
3956 * @retval PMINFO_R_ERROR internal error
3957 * @pre pkgmgrinfo_appinfo_get_appinfo()
3958 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3959 * @see pkgmgrinfo_appinfo_get_appid()
3960 * @see pkgmgrinfo_appinfo_is_nodisplay()
3962 static int get_app_multiple(const char *appid)
3966 pkgmgrinfo_appinfo_h handle;
3967 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3968 if (ret != PMINFO_R_OK)
3970 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3971 if (ret != PMINFO_R_OK) {
3972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3975 printf("app multiple: %d\n", multiple);
3976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3981 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3984 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3985 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3986 * application launching effect. If fales, indicator will be hidden during application launching effect
3988 * @par This API is for package-manager client application
3989 * @par Sync (or) Async : Synchronous API
3991 * @param[in] handle pointer to application info handle
3992 * @param[out] indicator_disp contains indicator display status for application launching effect
3993 * @return 0 if success, error code(<0) if fail
3994 * @retval PMINFO_R_OK success
3995 * @retval PMINFO_R_EINVAL invalid argument
3996 * @retval PMINFO_R_ERROR internal error
3997 * @pre pkgmgrinfo_appinfo_get_appinfo()
3998 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3999 * @see pkgmgrinfo_appinfo_get_appid()
4000 * @see pkgmgrinfo_appinfo_is_nodisplay()
4002 static int get_app_indicator_display(const char *appid)
4005 bool indicator_disp;
4006 pkgmgrinfo_appinfo_h handle;
4007 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4008 if (ret != PMINFO_R_OK)
4010 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4011 if (ret != PMINFO_R_OK){
4012 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4015 printf("app indicator disp : %d\n", indicator_disp);
4016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4021 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4024 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4025 * @brief This API gets the application 'taskmanage' value from the app ID
4027 * @par This API is for package-manager client application
4028 * @par Sync (or) Async : Synchronous API
4030 * @param[in] handle pointer to application info handle
4031 * @param[out] taskmanage pointer to hold package taskmanage value
4032 * @return 0 if success, error code(<0) if fail
4033 * @retval PMINFO_R_OK success
4034 * @retval PMINFO_R_EINVAL invalid argument
4035 * @retval PMINFO_R_ERROR internal error
4036 * @pre pkgmgrinfo_appinfo_get_appinfo()
4037 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4038 * @see pkgmgrinfo_appinfo_get_appid()
4039 * @see pkgmgrinfo_appinfo_is_multiple()
4041 static int get_app_taskmanage(const char *appid)
4045 pkgmgrinfo_appinfo_h handle;
4046 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4047 if (ret != PMINFO_R_OK)
4049 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4050 if (ret != PMINFO_R_OK) {
4051 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4054 printf("app taskmanage: %d\n", taskmanage);
4055 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4060 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4063 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4064 * @brief This API gets the application 'taskmanage' value from the app ID
4066 * @par This API is for package-manager client application
4067 * @par Sync (or) Async : Synchronous API
4069 * @param[in] handle pointer to application info handle
4070 * @param[out] enabled pointer to hold package enabled value
4071 * @return 0 if success, error code(<0) if fail
4072 * @retval PMINFO_R_OK success
4073 * @retval PMINFO_R_EINVAL invalid argument
4074 * @retval PMINFO_R_ERROR internal error
4075 * @pre pkgmgrinfo_appinfo_get_appinfo()
4076 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4077 * @see pkgmgrinfo_appinfo_get_appid()
4078 * @see pkgmgrinfo_appinfo_is_multiple()
4080 static int get_app_enabled(const char *appid)
4084 pkgmgrinfo_appinfo_h handle;
4085 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4086 if (ret != PMINFO_R_OK)
4088 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4089 if (ret != PMINFO_R_OK) {
4090 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4093 printf("app enabled: %d\n", enabled);
4094 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4099 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4102 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4103 * @brief This API gets the application 'onboot' value from the app ID
4105 * @par This API is for package-manager client application
4106 * @par Sync (or) Async : Synchronous API
4108 * @param[in] handle pointer to application info handle
4109 * @param[out] onboot pointer to hold package onboot value
4110 * @return 0 if success, error code(<0) if fail
4111 * @retval PMINFO_R_OK success
4112 * @retval PMINFO_R_EINVAL invalid argument
4113 * @retval PMINFO_R_ERROR internal error
4114 * @pre pkgmgrinfo_appinfo_get_appinfo()
4115 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4116 * @see pkgmgrinfo_appinfo_get_appid()
4117 * @see pkgmgrinfo_appinfo_is_multiple()
4119 static int get_app_onboot(const char *appid)
4123 pkgmgrinfo_appinfo_h handle;
4124 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4125 if (ret != PMINFO_R_OK)
4127 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4128 if (ret != PMINFO_R_OK) {
4129 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4132 printf("app onboot: %d\n", onboot);
4133 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4138 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4141 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4142 * @brief This API gets the application 'autorestart' value from the app ID
4144 * @par This API is for package-manager client application
4145 * @par Sync (or) Async : Synchronous API
4147 * @param[in] handle pointer to application info handle
4148 * @param[out] autorestart pointer to hold package autorestart value
4149 * @return 0 if success, error code(<0) if fail
4150 * @retval PMINFO_R_OK success
4151 * @retval PMINFO_R_EINVAL invalid argument
4152 * @retval PMINFO_R_ERROR internal error
4153 * @pre pkgmgrinfo_appinfo_get_appinfo()
4154 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4155 * @see pkgmgrinfo_appinfo_get_appid()
4156 * @see pkgmgrinfo_appinfo_is_multiple()
4158 static int get_app_autorestart(const char *appid)
4162 pkgmgrinfo_appinfo_h handle;
4163 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4164 if (ret != PMINFO_R_OK)
4166 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4167 if (ret != PMINFO_R_OK) {
4168 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4171 printf("app autorestart: %d\n", autorestart);
4172 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4177 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4180 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4181 * @brief This API gets the value for given application is main app or not from handle
4183 * @par This API is for package-manager client application
4184 * @par Sync (or) Async : Synchronous API
4186 * @param[in] handle pointer to application info handle
4187 * @param[out] mainapp pointer to hold package mainapp is or not
4188 * @return 0 if success, error code(<0) if fail
4189 * @retval PMINFO_R_OK success
4190 * @retval PMINFO_R_EINVAL invalid argument
4191 * @retval PMINFO_R_ERROR internal error
4192 * @pre pkgmgrinfo_appinfo_get_appinfo()
4193 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4194 * @see pkgmgrinfo_appinfo_get_appid()
4195 * @see pkgmgrinfo_appinfo_is_multiple()
4197 static int get_app_mainapp(const char *appid)
4201 pkgmgrinfo_appinfo_h handle;
4202 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4203 if (ret != PMINFO_R_OK)
4205 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4206 if (ret != PMINFO_R_OK) {
4207 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4210 printf("mainapp: %d\n", mainapp);
4211 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4216 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4220 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4221 * @brief This API gets the value for given application is preload or not from handle
4223 * @par This API is for package-manager client application
4224 * @par Sync (or) Async : Synchronous API
4226 * @param[in] handle pointer to application info handle
4227 * @param[out] preload pointer to hold preload is or not
4228 * @return 0 if success, error code(<0) if fail
4229 * @retval PMINFO_R_OK success
4230 * @retval PMINFO_R_EINVAL invalid argument
4231 * @retval PMINFO_R_ERROR internal error
4232 * @pre pkgmgrinfo_appinfo_get_appinfo()
4233 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4234 * @see pkgmgrinfo_appinfo_get_appid()
4235 * @see pkgmgrinfo_appinfo_is_multiple()
4237 static int get_app_preload(const char *appid)
4241 pkgmgrinfo_appinfo_h handle = NULL;
4242 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4243 if (ret != PMINFO_R_OK)
4245 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4246 if (ret != PMINFO_R_OK) {
4247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4250 printf("preload: %d\n", preload);
4251 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4256 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4259 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4260 * @brief This API gets the value for given application is submode or not from handle
4262 * @par This API is for package-manager client application
4263 * @par Sync (or) Async : Synchronous API
4265 * @param[in] handle pointer to application info handle
4266 * @param[out] submode pointer to hold submode is or not
4267 * @return 0 if success, error code(<0) if fail
4268 * @retval PMINFO_R_OK success
4269 * @retval PMINFO_R_EINVAL invalid argument
4270 * @retval PMINFO_R_ERROR internal error
4271 * @pre pkgmgrinfo_appinfo_get_appinfo()
4272 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4273 * @see pkgmgrinfo_appinfo_get_appid()
4274 * @see pkgmgrinfo_appinfo_is_multiple()
4276 static int get_app_submode(const char *appid)
4280 pkgmgrinfo_appinfo_h handle = NULL;
4281 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4282 if (ret != PMINFO_R_OK)
4284 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4285 if (ret != PMINFO_R_OK) {
4286 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4289 printf("submode: %d\n", submode);
4290 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4295 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4298 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4299 * @brief This API gets the value for given application is process_pool or not from handle
4301 * @par This API is for package-manager client application
4302 * @par Sync (or) Async : Synchronous API
4304 * @param[in] handle pointer to application info handle
4305 * @param[out] process_pool pointer to hold process_pool is or not
4306 * @return 0 if success, error code(<0) if fail
4307 * @retval PMINFO_R_OK success
4308 * @retval PMINFO_R_EINVAL invalid argument
4309 * @retval PMINFO_R_ERROR internal error
4310 * @pre pkgmgrinfo_appinfo_get_appinfo()
4311 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4312 * @see pkgmgrinfo_appinfo_get_appid()
4314 static int get_app_process_pool(const char *appid)
4317 bool process_pool = 0;
4318 pkgmgrinfo_appinfo_h handle = NULL;
4319 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4320 if (ret != PMINFO_R_OK)
4322 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4323 if (ret != PMINFO_R_OK) {
4324 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4327 printf("process_pool: %d\n", process_pool);
4328 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4333 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4336 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4337 * @brief This API gets the installed storage location of the application
4339 * @par This API is for package-manager client application
4340 * @par Sync (or) Async : Synchronous API
4342 * @param[in] handle pointer to the application info handle.
4343 * @param[out] app_type pointer to hold installed storage location
4344 * @return 0 if success, error code(<0) if fail
4345 * @retval PMINFO_R_OK success
4346 * @retval PMINFO_R_EINVAL invalid argument
4347 * @retval PMINFO_R_ERROR internal error
4348 * @pre pkgmgrinfo_appinfo_get_appinfo()
4349 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4350 * @see pkgmgrinfo_appinfo_get_appid()
4352 static int get_app_installed_location(const char *appid)
4355 pkgmgrinfo_installed_storage storage;
4356 pkgmgrinfo_appinfo_h handle = NULL;
4357 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4358 if (ret != PMINFO_R_OK)
4360 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4361 if (ret != PMINFO_R_OK) {
4362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4365 printf("Installed storage location : %d\n", storage);
4366 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4371 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4375 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4376 * @brief This API checks if the application has the given category
4378 * @par This API is for package-manager client application
4379 * @par Sync (or) Async : Synchronous API
4381 * @param[in] handle pointer to the application info handle
4382 * @param[in] category category
4383 * @param[out] exist value Gets whether the application has the given category
4384 * @return 0 if success, error code(<0) if fail
4385 * @retval PMINFO_R_OK success
4386 * @retval PMINFO_R_EINVAL invalid argument
4387 * @retval PMINFO_R_ERROR internal error
4389 static int is_category_exist(const char *appid, const char *category)
4392 pkgmgrinfo_appinfo_h handle;
4395 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4396 if (ret != PMINFO_R_OK)
4399 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4400 if (ret != PMINFO_R_OK) {
4401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4410 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4413 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4414 * @brief This API gets the application 'ui_gadget' value from the app ID
4416 * @par This API is for package-manager client application
4417 * @par Sync (or) Async : Synchronous API
4419 * @param[in] handle pointer to application info handle
4420 * @param[out] ui_gadget pointer to hold package ui_gadget value
4421 * @return 0 if success, error code(<0) if fail
4422 * @retval PMINFO_R_OK success
4423 * @retval PMINFO_R_EINVAL invalid argument
4424 * @pre pkgmgrinfo_appinfo_get_appinfo()
4425 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4427 static int get_app_ui_gadget(const char *appid)
4431 pkgmgrinfo_appinfo_h handle = NULL;
4432 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4433 if (ret != PMINFO_R_OK)
4435 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4436 if (ret != PMINFO_R_OK) {
4437 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4440 printf("app ui_gadget: %d\n", ui_gadget);
4441 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4446 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4449 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4450 * @brief This API gets the application 'support_disable' value from the app ID
4452 * @par This API is for package-manager client application
4453 * @par Sync (or) Async : Synchronous API
4455 * @param[in] handle pointer to application info handle
4456 * @param[out] support_disable pointer to hold package support_disable value
4457 * @return 0 if success, error code(<0) if fail
4458 * @retval PMINFO_R_OK success
4459 * @retval PMINFO_R_EINVAL invalid argument
4460 * @pre pkgmgrinfo_appinfo_get_appinfo()
4461 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4463 static int get_app_support_disable(const char *appid)
4466 bool support_disable;
4467 pkgmgrinfo_appinfo_h handle = NULL;
4468 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4469 if (ret != PMINFO_R_OK)
4471 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4472 if (ret != PMINFO_R_OK) {
4473 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4476 printf("app support_disable: %d\n", support_disable);
4477 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4482 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4485 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4486 * @brief This API gets the application 'removable' value from the app ID
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] removable pointer to hold package removable value
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()
4501 static int get_app_removable(const char *appid)
4505 pkgmgrinfo_appinfo_h handle = NULL;
4506 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4507 if (ret != PMINFO_R_OK)
4509 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4510 if (ret != PMINFO_R_OK) {
4511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4514 printf("app removable: %d\n", removable);
4515 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4520 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4523 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4524 * @brief This API gets the application 'system' value from the app ID
4526 * @par This API is for package-manager client application
4527 * @par Sync (or) Async : Synchronous API
4529 * @param[in] handle pointer to application info handle
4530 * @param[out] system pointer to hold package system value
4531 * @return 0 if success, error code(<0) if fail
4532 * @retval PMINFO_R_OK success
4533 * @retval PMINFO_R_EINVAL invalid argument
4534 * @retval PMINFO_R_ERROR internal error
4535 * @pre pkgmgrinfo_appinfo_get_appinfo()
4536 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4537 * @see pkgmgrinfo_appinfo_get_appid()
4539 static int get_app_system(const char *appid)
4542 bool system = false;
4543 pkgmgrinfo_appinfo_h handle = NULL;
4544 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4545 if (ret != PMINFO_R_OK)
4547 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4548 if (ret != PMINFO_R_OK) {
4549 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4552 printf("app system: %d\n", system);
4553 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4558 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4562 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4563 * @brief This API gets the application 'is_disable' value from the app ID
4565 * @par This API is for package-manager client application
4566 * @par Sync (or) Async : Synchronous API
4568 * @param[in] handle pointer to application info handle
4569 * @param[out] disabled pointer to hold application is_disabled value
4570 * @return 0 if success, error code(<0) if fail
4571 * @retval PMINFO_R_OK success
4572 * @retval PMINFO_R_EINVAL invalid argument
4573 * @pre pkgmgrinfo_appinfo_get_appinfo()
4574 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4576 static int get_app_is_disable(const char *appid)
4580 pkgmgrinfo_appinfo_h handle = NULL;
4581 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4582 if (ret != PMINFO_R_OK)
4584 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4585 if (ret != PMINFO_R_OK) {
4586 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4589 printf("app is_disable: %d\n", is_disable);
4590 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4595 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4598 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4599 * @brief This API gets whethere the given application is global application or user application
4601 * @par This API is for package-manager client application
4602 * @par Sync (or) Async : Synchronous API
4604 * @param[in] handle pointer to application info handle
4605 * @param[in] global pointer to hold application global value
4606 * @return 0 if success, error code(<0) if fail
4607 * @retval PMINFO_R_OK success
4608 * @retval PMINFO_R_EINVAL invalid argument
4609 * @retval PMINFO_R_ERROR internal error
4610 * @pre pkgmgrinfo_appinfo_get_appinfo()
4611 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4612 * @see pkgmgrinfo_appinfo_get_appid()
4613 static int get_app_is_global(const char *appid)
4617 pkgmgrinfo_appinfo_h handle = NULL;
4618 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4619 if (ret != PMINFO_R_OK)
4621 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4622 if (ret != PMINFO_R_OK) {
4623 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4626 printf("app is_global: %d\n", global);
4627 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4632 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4635 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4636 * @brief This API gets the application 'splash_screen_display' value from the app ID
4638 * @par This API is for package-manager client application
4639 * @par Sync (or) Async : Synchronous API
4641 * @param[in] handle pointer to application info handle
4642 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4643 * @return 0 if success, error code(<0) if fail
4644 * @retval PMINFO_R_OK success
4645 * @retval PMINFO_R_EINVAL invalid argument
4646 * @retval PMINFO_R_ERROR internal error
4648 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4651 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4652 * @brief This API destroys the application information handle freeing up all the resources
4654 * @par This API is for package-manager client application
4655 * @par Sync (or) Async : Synchronous API
4657 * @param[in] handle pointer to the application info handle.
4658 * @return 0 if success, error code(<0) if fail
4659 * @retval PMINFO_R_OK success
4660 * @retval PMINFO_R_EINVAL invalid argument
4661 * @retval PMINFO_R_ERROR internal error
4662 * @pre pkgmgrinfo_appinfo_get_appinfo()
4664 * @see pkgmgrinfo_appinfo_get_pkgid()
4665 * @see pkgmgrinfo_appinfo_is_multiple()
4667 static int get_app_type(const char *appid)
4671 pkgmgrinfo_appinfo_h handle;
4672 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4673 if (ret != PMINFO_R_OK)
4675 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4676 if (ret != PMINFO_R_OK) {
4677 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4680 printf("apptype: %s\n", type);
4681 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4686 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4689 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4690 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4691 The query will search the entire application information collected from the manifest file of all the installed packages
4693 * @par This API is for package-manager client application
4694 * @par Sync (or) Async : Synchronous API
4696 * @param[out] handle pointer to the application info filter handle.
4697 * @return 0 if success, error code(<0) if fail
4698 * @retval PMINFO_R_OK success
4699 * @retval PMINFO_R_EINVAL invalid argument
4700 * @retval PMINFO_R_ERROR internal error
4702 * @post pkgmgrinfo_appinfo_filter_destroy()
4703 * @see pkgmgrinfo_appinfo_filter_count()
4704 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4706 static int get_capp_count()
4710 pkgmgrinfo_appinfo_filter_h handle;
4711 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4712 if (ret != PMINFO_R_OK)
4714 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4715 if (ret != PMINFO_R_OK) {
4716 pkgmgrinfo_appinfo_filter_destroy(handle);
4719 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4720 if (ret != PMINFO_R_OK) {
4721 pkgmgrinfo_appinfo_filter_destroy(handle);
4724 printf("No of capp: %d\n", count);
4725 pkgmgrinfo_appinfo_filter_destroy(handle);
4730 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4733 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4734 * @brief This API destroys the application information filter handle freeing up all the resources
4736 * @par This API is for package-manager client application
4737 * @par Sync (or) Async : Synchronous API
4739 * @param[in] handle pointer to the application info filter handle.
4740 * @return 0 if success, error code(<0) if fail
4741 * @retval PMINFO_R_OK success
4742 * @retval PMINFO_R_EINVAL invalid argument
4743 * @retval PMINFO_R_ERROR internal error
4744 * @pre pkgmgrinfo_appinfo_filter_create()
4746 * @see pkgmgrinfo_appinfo_filter_count()
4747 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4749 static int get_capp_count()
4753 pkgmgrinfo_appinfo_filter_h handle;
4754 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4755 if (ret != PMINFO_R_OK)
4757 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4758 if (ret != PMINFO_R_OK) {
4759 pkgmgrinfo_appinfo_filter_destroy(handle);
4762 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4763 if (ret != PMINFO_R_OK) {
4764 pkgmgrinfo_appinfo_filter_destroy(handle);
4767 printf("No of capp: %d\n", count);
4768 pkgmgrinfo_appinfo_filter_destroy(handle);
4773 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4776 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4777 * @brief This API adds a boolean filter property to the filter handle
4779 * @par This API is for package-manager client application
4780 * @par Sync (or) Async : Synchronous API
4782 * @param[in] handle pointer to the application info filter handle.
4783 * @param[in] property boolean property name.
4784 * @param[in] value value corresponding to the property.
4785 * @return 0 if success, error code(<0) if fail
4786 * @retval PMINFO_R_OK success
4787 * @retval PMINFO_R_EINVAL invalid argument
4788 * @retval PMINFO_R_ERROR internal error
4789 * @pre pkgmgrinfo_appinfo_filter_create()
4790 * @post pkgmgrinfo_appinfo_filter_destroy()
4791 * @see pkgmgrinfo_appinfo_filter_count()
4792 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4794 static int get_taskmanageable_app_count()
4798 pkgmgrinfo_appinfo_filter_h handle;
4799 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4800 if (ret != PMINFO_R_OK)
4802 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4803 if (ret != PMINFO_R_OK) {
4804 pkgmgrinfo_appinfo_filter_destroy(handle);
4807 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4808 if (ret != PMINFO_R_OK) {
4809 pkgmgrinfo_appinfo_filter_destroy(handle);
4812 printf("No of taskmanageable apps: %d\n", count);
4813 pkgmgrinfo_appinfo_filter_destroy(handle);
4818 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4819 const char *property, const bool value);
4822 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4823 * @brief This API adds an integer filter property to the filter handle
4825 * @par This API is for package-manager client application
4826 * @par Sync (or) Async : Synchronous API
4828 * @param[in] handle pointer to the application info filter handle.
4829 * @param[in] property integer property name.
4830 * @param[in] value value corresponding to the property.
4831 * @return 0 if success, error code(<0) if fail
4832 * @retval PMINFO_R_OK success
4833 * @retval PMINFO_R_EINVAL invalid argument
4834 * @retval PMINFO_R_ERROR internal error
4835 * @pre pkgmgrinfo_appinfo_filter_create()
4836 * @post pkgmgrinfo_appinfo_filter_destroy()
4837 * @see pkgmgrinfo_appinfo_filter_count()
4838 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4840 static int get_taskmanageable_app_count()
4844 pkgmgrinfo_appinfo_filter_h handle;
4845 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4846 if (ret != PMINFO_R_OK)
4848 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4849 if (ret != PMINFO_R_OK) {
4850 pkgmgrinfo_appinfo_filter_destroy(handle);
4853 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4854 if (ret != PMINFO_R_OK) {
4855 pkgmgrinfo_appinfo_filter_destroy(handle);
4858 printf("No of apps: %d\n", count);
4859 pkgmgrinfo_appinfo_filter_destroy(handle);
4864 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4865 const char *property, const int value);
4868 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4869 * @brief This API adds a string filter property to the filter handle
4871 * @par This API is for package-manager client application
4872 * @par Sync (or) Async : Synchronous API
4874 * @param[in] handle pointer to the application info filter handle.
4875 * @param[in] property string property name.
4876 * @param[in] value value corresponding to the property.
4877 * @return 0 if success, error code(<0) if fail
4878 * @retval PMINFO_R_OK success
4879 * @retval PMINFO_R_EINVAL invalid argument
4880 * @retval PMINFO_R_ERROR internal error
4881 * @pre pkgmgrinfo_appinfo_filter_create()
4882 * @post pkgmgrinfo_appinfo_filter_destroy()
4883 * @see pkgmgrinfo_appinfo_filter_count()
4884 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4886 static int get_capp_count()
4890 pkgmgrinfo_appinfo_filter_h handle;
4891 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4892 if (ret != PMINFO_R_OK)
4894 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4895 if (ret != PMINFO_R_OK) {
4896 pkgmgrinfo_appinfo_filter_destroy(handle);
4899 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4900 if (ret != PMINFO_R_OK) {
4901 pkgmgrinfo_appinfo_filter_destroy(handle);
4904 printf("No of capp: %d\n", count);
4905 pkgmgrinfo_appinfo_filter_destroy(handle);
4910 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4911 const char *property, const char *value);
4914 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4915 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4917 * @par This API is for package-manager client application
4918 * @par Sync (or) Async : Synchronous API
4920 * @param[in] handle pointer to the application info filter handle.
4921 * @param[in] app_cb callback function.
4922 * @param[in] user_data user data to be passed to the callback function
4923 * @return 0 if success, error code(<0) if fail
4924 * @retval PMINFO_R_OK success
4925 * @retval PMINFO_R_EINVAL invalid argument
4926 * @retval PMINFO_R_ERROR internal error
4927 * @pre pkgmgrinfo_appinfo_filter_create()
4928 * @post pkgmgrinfo_appinfo_filter_destroy()
4929 * @see pkgmgrinfo_appinfo_filter_count()
4931 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4934 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4935 printf("appid : %s\n", appid);
4939 static int get_capp_list()
4942 pkgmgrinfo_appinfo_filter_h handle;
4943 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4944 if (ret != PMINFO_R_OK)
4946 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4947 if (ret != PMINFO_R_OK) {
4948 pkgmgrinfo_appinfo_filter_destroy(handle);
4951 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4952 if (ret != PMINFO_R_OK) {
4953 pkgmgrinfo_appinfo_filter_destroy(handle);
4956 pkgmgrinfo_appinfo_filter_destroy(handle);
4961 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4962 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4963 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4964 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4967 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4968 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4969 * @brief This API counts the application that satisfy the filter conditions
4971 * @par This API is for package-manager client application
4972 * @par Sync (or) Async : Synchronous API
4974 * @param[in] handle pointer to the application info filter handle.
4975 * @param[in] count pointer to store count value
4976 * @param[in] uid the addressee user id of the instruction
4977 * @return 0 if success, error code(<0) if fail
4978 * @retval PMINFO_R_OK success
4979 * @retval PMINFO_R_EINVAL invalid argument
4980 * @retval PMINFO_R_ERROR internal error
4981 * @pre pkgmgrinfo_appinfo_filter_create()
4982 * @post pkgmgrinfo_appinfo_filter_destroy()
4983 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4985 static int get_capp_count()
4989 pkgmgrinfo_appinfo_filter_h handle;
4990 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4991 if (ret != PMINFO_R_OK)
4993 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4994 if (ret != PMINFO_R_OK) {
4995 pkgmgrinfo_appinfo_filter_destroy(handle);
4998 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4999 if (ret != PMINFO_R_OK) {
5000 pkgmgrinfo_appinfo_filter_destroy(handle);
5003 printf("No of capp: %d\n", count);
5004 pkgmgrinfo_appinfo_filter_destroy(handle);
5009 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5010 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5012 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5013 * @brief This API creates the application's metadata information filter handle from db.
5015 * @par This API is for package-manager client application
5016 * @par Sync (or) Async : Synchronous API
5018 * @param[out] handle pointer to the application metadata info filter handle.
5019 * @return 0 if success, error code(<0) if fail
5020 * @retval PMINFO_R_OK success
5021 * @retval PMINFO_R_EINVAL invalid argument
5022 * @retval PMINFO_R_ERROR internal error
5024 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5025 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5027 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5030 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5031 printf("appid : %s\n", appid);
5035 static int get_app_list(const char *mkey, const char *mvalue)
5038 pkgmgrinfo_appinfo_metadata_filter_h handle;
5039 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5040 if (ret != PMINFO_R_OK)
5042 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5043 if (ret != PMINFO_R_OK) {
5044 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5047 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5048 if (ret != PMINFO_R_OK) {
5049 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5052 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5057 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5060 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5061 * @brief This API destroys the application's metadata information filter handle.
5063 * @par This API is for package-manager client application
5064 * @par Sync (or) Async : Synchronous API
5066 * @param[in] handle pointer to the application metadata info filter handle.
5067 * @return 0 if success, error code(<0) if fail
5068 * @retval PMINFO_R_OK success
5069 * @retval PMINFO_R_EINVAL invalid argument
5070 * @retval PMINFO_R_ERROR internal error
5071 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5073 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5075 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5078 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5079 printf("appid : %s\n", appid);
5083 static int get_app_list(const char *mkey, const char *mvalue)
5086 pkgmgrinfo_appinfo_metadata_filter_h handle;
5087 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5088 if (ret != PMINFO_R_OK)
5090 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5091 if (ret != PMINFO_R_OK) {
5092 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5095 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5096 if (ret != PMINFO_R_OK) {
5097 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5100 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5105 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5108 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5109 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5110 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5112 * @par This API is for package-manager client application
5113 * @par Sync (or) Async : Synchronous API
5115 * @param[in] handle pointer to the application metadata info filter handle.
5116 * @param[in] key pointer to metadata key
5117 * @param[in] value pointer to metadata value
5118 * @return 0 if success, error code(<0) if fail
5119 * @retval PMINFO_R_OK success
5120 * @retval PMINFO_R_EINVAL invalid argument
5121 * @retval PMINFO_R_ERROR internal error
5122 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5123 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5124 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5126 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5129 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5130 printf("appid : %s\n", appid);
5134 static int get_app_list(const char *mkey, const char *mvalue)
5137 pkgmgrinfo_appinfo_metadata_filter_h handle;
5138 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5139 if (ret != PMINFO_R_OK)
5141 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5142 if (ret != PMINFO_R_OK) {
5143 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5146 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5147 if (ret != PMINFO_R_OK) {
5148 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5151 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5156 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5157 const char *key, const char *value);
5160 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5161 * @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)
5162 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5163 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5164 * negative value, no more callbacks will be called and API will return.
5166 * @par This API is for package-manager client application
5167 * @par Sync (or) Async : Synchronous API
5169 * @param[in] handle pointer to the application metadata info filter handle.
5170 * @param[in] app_cb function pointer to callback
5171 * @param[in] user_data pointer to user data
5172 * @param[in] uid the addressee user id of the instruction
5173 * @return 0 if success, error code(<0) if fail
5174 * @retval PMINFO_R_OK success
5175 * @retval PMINFO_R_EINVAL invalid argument
5176 * @retval PMINFO_R_ERROR internal error
5177 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5178 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5180 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5183 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5184 printf("appid : %s\n", appid);
5188 static int get_app_list(const char *mkey, const char *mvalue)
5191 pkgmgrinfo_appinfo_metadata_filter_h handle;
5192 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5193 if (ret != PMINFO_R_OK)
5195 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5196 if (ret != PMINFO_R_OK) {
5197 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5200 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5201 if (ret != PMINFO_R_OK) {
5202 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5205 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5210 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5211 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5212 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5213 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5215 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5216 * @brief This API creates the package cert information handle to get data from db.
5218 * @par This API is for package-manager client application
5219 * @par Sync (or) Async : Synchronous API
5221 * @param[out] handle pointer to the package cert handle.
5222 * @return 0 if success, error code(<0) if fail
5223 * @retval PMINFO_R_OK success
5224 * @retval PMINFO_R_EINVAL invalid argument
5225 * @retval PMINFO_R_ERROR internal error
5227 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5228 * @see pkgmgrinfo_pkginfo_get_cert_value()
5229 * @see pkgmgrinfo_pkginfo_load_certinfo()
5231 static int get_cert_info(const char *pkgid)
5234 pkgmgrinfo_certinfo_h handle;
5235 char *auth_cert = NULL;
5236 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5237 if (ret != PMINFO_R_OK)
5239 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5240 if (ret != PMINFO_R_OK) {
5241 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5244 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5245 if (ret != PMINFO_R_OK) {
5246 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5249 printf("Author root certificate: %s\n", auth_root);
5250 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5255 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5258 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5259 * @brief This API loads the package cert information handle with data from db.
5261 * @par This API is for package-manager client application
5262 * @par Sync (or) Async : Synchronous API
5264 * @param[in] pkgid pointer to the package ID.
5265 * @param[in] handle pointer to the package cert handle.
5266 * @return 0 if success, error code(<0) if fail
5267 * @retval PMINFO_R_OK success
5268 * @retval PMINFO_R_EINVAL invalid argument
5269 * @retval PMINFO_R_ERROR internal error
5270 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5271 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5272 * @see pkgmgrinfo_pkginfo_get_cert_value()
5274 static int get_cert_info(const char *pkgid)
5277 pkgmgrinfo_certinfo_h handle;
5278 char *auth_cert = NULL;
5279 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5280 if (ret != PMINFO_R_OK)
5282 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5283 if (ret != PMINFO_R_OK) {
5284 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5287 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5288 if (ret != PMINFO_R_OK) {
5289 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5292 printf("Author root certificate: %s\n", auth_root);
5293 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5298 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5301 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5302 * @brief This API gets the package cert information from the handle
5304 * @par This API is for package-manager client application
5305 * @par Sync (or) Async : Synchronous API
5307 * @param[in] handle pointer to the package cert handle.
5308 * @param[in] cert_type certificate type
5309 * @param[out] cert_value pointer to hold certificate value
5310 * @return 0 if success, error code(<0) if fail
5311 * @retval PMINFO_R_OK success
5312 * @retval PMINFO_R_EINVAL invalid argument
5313 * @retval PMINFO_R_ERROR internal error
5314 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5315 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5316 * @see pkgmgrinfo_pkginfo_load_certinfo()
5318 static int get_cert_info(const char *pkgid)
5321 pkgmgrinfo_certinfo_h handle;
5322 char *auth_cert = NULL;
5323 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5324 if (ret != PMINFO_R_OK)
5326 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5327 if (ret != PMINFO_R_OK) {
5328 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5331 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5332 if (ret != PMINFO_R_OK) {
5333 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5336 printf("Author root certificate: %s\n", auth_root);
5337 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5342 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5345 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5346 * @brief This API destroys the package cert information handle freeing up all the resources
5348 * @par This API is for package-manager client application
5349 * @par Sync (or) Async : Synchronous API
5351 * @param[in] handle pointer to the package cert handle.
5352 * @return 0 if success, error code(<0) if fail
5353 * @retval PMINFO_R_OK success
5354 * @retval PMINFO_R_EINVAL invalid argument
5355 * @retval PMINFO_R_ERROR internal error
5356 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5358 * @see pkgmgrinfo_pkginfo_load_certinfo()
5360 static int get_cert_info(const char *pkgid)
5363 pkgmgrinfo_certinfo_h handle;
5364 char *auth_cert = NULL;
5365 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5366 if (ret != PMINFO_R_OK)
5368 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5369 if (ret != PMINFO_R_OK) {
5370 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5373 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5374 if (ret != PMINFO_R_OK) {
5375 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5378 printf("Author root certificate: %s\n", auth_root);
5379 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5384 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5387 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5388 * @brief This API deletes the package cert information from DB
5390 * @par This API is for package-manager client application
5391 * @par Sync (or) Async : Synchronous API
5393 * @param[in] pkgid pointer to the package ID.
5394 * @return 0 if success, error code(<0) if fail
5395 * @retval PMINFO_R_OK success
5396 * @retval PMINFO_R_EINVAL invalid argument
5397 * @retval PMINFO_R_ERROR internal error
5401 static int delete_cert_info(const char *pkgid)
5404 ret = pkgmgrinfo_delete_certinfo(pkgid);
5405 if (ret != PMINFO_R_OK)
5411 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5412 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5415 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5416 * @brief This API creates the package cert information handle to set data in db.
5418 * @par This API is for package-manager client application
5419 * @par Sync (or) Async : Synchronous API
5421 * @param[out] handle pointer to the package cert handle.
5422 * @return 0 if success, error code(<0) if fail
5423 * @retval PMINFO_R_OK success
5424 * @retval PMINFO_R_EINVAL invalid argument
5425 * @retval PMINFO_R_ERROR internal error
5427 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5428 * @see pkgmgrinfo_set_cert_value()
5429 * @see pkgmgrinfo_save_certinfo()
5431 static int set_cert_in_db(const char *pkgid)
5434 pkgmgrinfo_instcertinfo_h handle;
5435 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5436 if (ret != PMINFO_R_OK)
5438 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5439 if (ret != PMINFO_R_OK) {
5440 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5443 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5444 if (ret != PMINFO_R_OK) {
5445 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5448 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5453 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5456 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5457 * @brief This API sets the package cert information in the handle.
5459 * @par This API is for package-manager client application
5460 * @par Sync (or) Async : Synchronous API
5462 * @param[in] handle pointer to the package cert handle.
5463 * @param[in] cert_type certificate type.
5464 * @param[in] cert_value certificate value.
5465 * @return 0 if success, error code(<0) if fail
5466 * @retval PMINFO_R_OK success
5467 * @retval PMINFO_R_EINVAL invalid argument
5468 * @retval PMINFO_R_ERROR internal error
5469 * @pre pkgmgrinfo_create_certinfo_set_handle()
5470 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5471 * @see pkgmgrinfo_save_certinfo()
5473 static int set_cert_in_db(const char *pkgid)
5476 pkgmgrinfo_instcertinfo_h handle;
5477 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5478 if (ret != PMINFO_R_OK)
5480 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5481 if (ret != PMINFO_R_OK) {
5482 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5485 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5486 if (ret != PMINFO_R_OK) {
5487 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5490 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5495 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5498 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5499 * @brief This API saves the package cert information in the DB.
5501 * @par This API is for package-manager client application
5502 * @par Sync (or) Async : Synchronous API
5504 * @param[in] pkgid pointer to the package ID.
5505 * @param[in] handle pointer to the package cert handle.
5506 * @return 0 if success, error code(<0) if fail
5507 * @retval PMINFO_R_OK success
5508 * @retval PMINFO_R_EINVAL invalid argument
5509 * @retval PMINFO_R_ERROR internal error
5510 * @pre pkgmgrinfo_create_certinfo_set_handle()
5511 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5512 * @see pkgmgrinfo_save_certinfo()
5514 static int set_cert_in_db(const char *pkgid)
5517 pkgmgrinfo_instcertinfo_h handle;
5518 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5519 if (ret != PMINFO_R_OK)
5521 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5522 if (ret != PMINFO_R_OK) {
5523 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5526 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5527 if (ret != PMINFO_R_OK) {
5528 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5531 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5536 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5539 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5540 * @brief This API destroys the package cert information handle freeing up all the resources.
5542 * @par This API is for package-manager client application
5543 * @par Sync (or) Async : Synchronous API
5545 * @param[in] handle pointer to the package cert handle.
5546 * @return 0 if success, error code(<0) if fail
5547 * @retval PMINFO_R_OK success
5548 * @retval PMINFO_R_EINVAL invalid argument
5549 * @retval PMINFO_R_ERROR internal error
5550 * @pre pkgmgrinfo_create_certinfo_set_handle()
5552 * @see pkgmgrinfo_save_certinfo()
5554 static int set_cert_in_db(const char *pkgid)
5557 pkgmgrinfo_instcertinfo_h handle;
5558 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5559 if (ret != PMINFO_R_OK)
5561 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5562 if (ret != PMINFO_R_OK) {
5563 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5566 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5567 if (ret != PMINFO_R_OK) {
5568 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5571 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5576 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5579 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5580 * @brief This API gets the datacontrol info
5582 * @par This API is for package-manager client application
5583 * @par Sync (or) Async : Synchronous API
5585 * @param[in] providerid pointer to the providerid of dataconltrol.
5586 * @param[in] type pointer to the type of dataconltrol.
5587 * @param[out] appid pointer to hold appid, need to free after using
5588 * @param[out] access pointer to hold access, need to free after using
5589 * @return 0 if success, error code(<0) if fail
5590 * @retval PMINFO_R_OK success
5591 * @retval PMINFO_R_EINVAL invalid argument
5592 * @retval PMINFO_R_ERROR internal error
5595 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5598 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5599 * @brief This API gets the application 'guest mode visibility' value from the DB
5601 * @par This API is for package-manager client application
5602 * @par Sync (or) Async : Synchronous API
5604 * @param[in] handle pointer to application info handle
5605 * @param[out] status pointer to hold app guest mode visibility value
5606 * @return 0 if success, error code(<0) if fail
5607 * @retval PMINFO_R_OK success
5608 * @retval PMINFO_R_EINVAL invalid argument
5609 * @retval PMINFO_R_ERROR internal error
5610 * @pre pkgmgrinfo_appinfo_get_appinfo()
5611 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5612 * @see pkgmgrinfo_appinfo_get_appid()
5613 * @see pkgmgrinfo_appinfo_is_multiple()
5615 static int get_app_guestmode_visibility(const char *appid)
5619 pkgmgrinfo_appinfo_h handle;
5620 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5621 if (ret != PMINFO_R_OK)
5623 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5624 if (ret != PMINFO_R_OK) {
5625 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5628 printf("app guest mode visibility: %d\n", status);
5629 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5634 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5637 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5638 * @brief This API sets the package 'installed_storage' value in db
5640 * @par This API is for package-manager client application
5641 * @par Sync (or) Async : Synchronous API
5643 * @param[in] pkgid pointer to the package ID.
5644 * @param[in] location package install location
5645 * @param[in] external_pkg_path image path if pkg has installed at external storage
5646 * @return 0 if success, error code(<0) if fail
5647 * @retval PMINFO_R_OK success
5648 * @retval PMINFO_R_EINVAL invalid argument
5649 * @retval PMINFO_R_ERROR internal error
5651 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5655 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5656 if (ret != PMINFO_R_OK) {
5663 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
5664 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
5667 * @pkgmgrinfo client API
5671 * @brief listening status type in pkgmgrinfo.
5673 #define PMINFO_CLIENT_STATUS_ALL 0x00
5674 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5675 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5676 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5677 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5678 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5679 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5682 * @brief This APIs provides pkgmgrinfo client listener
5684 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5685 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5686 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5687 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5694 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5695 int flag, void *user_data, uid_t uid);
5696 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5697 int flag, void *user_data);
5698 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5699 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5701 int pkgmgrinfo_appinfo_get_installed_list_full(
5702 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5705 * @pkgmgrinfo client API end
5713 #endif /* __PKG_INFO_H__ */