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.
32 * @file package-manager.h
33 * @author Sewook Park <sewook7.park@samsung.com>
35 * @brief This file declares API of slp-pkgmgr library
37 * @addtogroup APPLICATION_FRAMEWORK
40 * @defgroup PackageManager
41 * @section Header to use them:
43 * #include "package-manager.h"
46 * @addtogroup PackageManager
50 #ifndef __PKG_MANAGER_H__
51 #define __PKG_MANAGER_H__
56 #include <sys/types.h>
65 #define DEPRECATED __attribute__ ((__deprecated__))
71 * This is package manager
73 * Packaeg manager is used to install/uninstall the packages.\n
74 * package includes dpkg, java, widget, etc. and it can be added\n
75 * Security is considered on current package manager\n
80 * @file package-manager.h
81 * @brief Package Manager header
83 * Generated by Sewook Park <sewook7.park@samsung.com>
89 * @addtogroup PackageManager
94 * @brief pkgmgr info types.
96 #define PKGMGR_INFO_STR_PKGTYPE "pkg_type"
97 #define PKGMGR_INFO_STR_PKGNAME "pkg_name"
98 #define PKGMGR_INFO_STR_VERSION "version"
99 #define PKGMGR_INFO_STR_INSTALLED_SIZE "installed_size"
100 #define PKGMGR_INFO_STR_DATA_SIZE "data_size"
101 #define PKGMGR_INFO_STR_APP_SIZE "app_size"
102 #define PKGMGR_INFO_STR_INSTALLED_TIME "installed_time"
105 * @brief listening status type in pkgmgr.
107 #define PKGMGR_CLIENT_STATUS_ALL 0xFFFF
108 #define PKGMGR_CLIENT_STATUS_INSTALL 0x0001
109 #define PKGMGR_CLIENT_STATUS_UNINSTALL 0x0002
110 #define PKGMGR_CLIENT_STATUS_UPGRADE 0x0004
111 #define PKGMGR_CLIENT_STATUS_MOVE 0x0008
112 #define PKGMGR_CLIENT_STATUS_CLEAR_DATA 0x0010
113 #define PKGMGR_CLIENT_STATUS_INSTALL_PROGRESS 0x0020
114 #define PKGMGR_CLIENT_STATUS_GET_SIZE 0x0040
115 #define PKGMGR_CLIENT_STATUS_ENABLE_APP 0x0080
116 #define PKGMGR_CLIENT_STATUS_DISABLE_APP 0x0100
117 #define PKGMGR_CLIENT_STATUS_ENABLE_APP_SPLASH_SCREEN 0x0200
118 #define PKGMGR_CLIENT_STATUS_DISABLE_APP_SPLASH_SCREEN 0x0400
119 #define PKGMGR_CLIENT_STATUS_CLEAR_CACHE 0x0800
120 #define PKGMGR_CLIENT_STATUS_RES_COPY 0x1000
121 #define PKGMGR_CLIENT_STATUS_RES_CREATE_DIR 0x2000
122 #define PKGMGR_CLIENT_STATUS_RES_REMOVE 0x4000
123 #define PKGMGR_CLIENT_STATUS_RES_UNINSTALL 0x8000
127 #define PKG_SIZE_INFO_TOTAL "__TOTAL__"
128 #define PKG_CLEAR_ALL_CACHE "__ALL__"
130 * @brief Return values in pkgmgr.
132 typedef enum _pkgmgr_return_val {
133 PKGMGR_R_ESYSTEM = -9, /**< Severe system error */
134 PKGMGR_R_EIO = -8, /**< IO error */
135 PKGMGR_R_ENOMEM = -7, /**< Out of memory */
136 PKGMGR_R_ENOPKG = -6, /**< No such package */
137 PKGMGR_R_EPRIV = -5, /**< Privilege denied */
138 PKGMGR_R_ETIMEOUT = -4, /**< Timeout */
139 PKGMGR_R_EINVAL = -3, /**< Invalid argument */
140 PKGMGR_R_ECOMM = -2, /**< Comunication Error */
141 PKGMGR_R_ERROR = -1, /**< General error */
142 PKGMGR_R_OK = 0 /**< General success */
147 * @defgroup pkg_operate APIs to install /uninstall / activate application
150 * APIs to install /uninstall / activate application
151 * - Install application using application package filepath
152 * - Uninstall application using application package name
153 * - Activate application using application package name
159 * @addtogroup pkg_operate
163 typedef void pkgmgr_client;
164 typedef void pkgmgr_info;
165 typedef void pkgmgr_res_event_info;
169 long long cache_size;
171 long long ext_data_size;
172 long long ext_cache_size;
173 long long ext_app_size;
177 PM_UPDATEINFO_TYPE_NONE = 0,
178 PM_UPDATEINFO_TYPE_FORCE,
179 PM_UPDATEINFO_TYPE_OPTIONAL
180 } pkgmgr_updateinfo_type;
183 PM_RES_EVENT_PATH_STATE_NONE = 0,
184 PM_RES_EVENT_PATH_STATE_OK,
185 PM_RES_EVENT_PATH_STATE_FAILED
186 } pkgmgr_res_event_path_state;
191 pkgmgr_updateinfo_type type;
194 typedef struct _pkgmgr_res_event_info_t {
197 } pkgmgr_res_event_info_t;
199 typedef struct _res_event_path_state_t {
201 pkgmgr_res_event_path_state state;
202 } res_event_path_state_t;
204 typedef int (*pkgmgr_iter_fn)(const char *pkg_type, const char *pkgid,
205 const char *version, void *data);
207 typedef int (*pkgmgr_handler)(uid_t target_uid, int req_id, const char *pkg_type,
208 const char *pkgid, const char *key,
209 const char *val, const void *pmsg, void *data);
211 typedef int (*pkgmgr_app_handler)(uid_t target_uid, int req_id, const char *pkg_type,
212 const char *pkgid, const char *appid, const char *key,
213 const char *val, const void *pmsg, void *data);
215 typedef void (*pkgmgr_pkg_size_info_receive_cb)(pkgmgr_client *pc, const char *pkgid,
216 const pkg_size_info_t *size_info, void *user_data);
218 typedef void (*pkgmgr_total_pkg_size_info_receive_cb)(pkgmgr_client *pc,
219 const pkg_size_info_t *size_info, void *user_data);
221 typedef void (*pkgmgr_res_handler)(uid_t target_uid, int req_id,
222 const char *pkgid, const char *request_type, const char *status,
223 pkgmgr_res_event_info *handle, void *user_data);
225 typedef int (*pkgmgr_res_event_path_cb)(const char *path,
226 pkgmgr_res_event_path_state state, void *user_data);
228 typedef void (*pkgmgr_pkg_upgrade_handler)(unsigned int progress, void *user_data);
234 } pkgmgr_client_type;
242 PM_MOVE_TO_INTERNAL = 0,
243 PM_MOVE_TO_SDCARD = 1,
244 PM_MOVE_TO_EXTENDED = 2,
249 PM_REQUEST_GET_SIZE = 1,
250 PM_REQUEST_KILL_APP = 2,
251 PM_REQUEST_CHECK_APP = 3,
253 } pkgmgr_request_service_type;
256 /* sync, get data, total size for one requested pkgid */
257 PM_GET_TOTAL_SIZE = 0,
258 PM_GET_DATA_SIZE = 1,
260 /* async, get total used storage size */
263 /* async, get a pkgid's data, total size for all installed pkg */
264 PM_GET_SIZE_INFO = 3,
267 PM_GET_TOTAL_AND_DATA = 4,
268 PM_GET_SIZE_FILE = 5,
270 /* async, get data, cache, app size based on "pkg_size_info_t" */
271 PM_GET_PKG_SIZE_INFO = 6,
272 PM_GET_TOTAL_PKG_SIZE_INFO = 7,
274 } pkgmgr_getsize_type;
277 PM_RESTRICTION_MODE_ALL = 0x07,
278 PM_RESTRICTION_MODE_INSTALL = 0x01,
279 PM_RESTRICTION_MODE_UNINSTALL = 0x02,
280 PM_RESTRICTION_MODE_MOVE = 0x04,
281 } pkgmgr_restriction_mode;
284 * @brief This API creates pkgmgr client.
286 * This API is for package-manager client application.\n
288 * @param[in] ctype client type - PC_REQUEST, PC_LISTENING, PC_BROADCAST
289 * @return pkgmgr_client object
290 * @retval NULL on failure creating an object
292 pkgmgr_client *pkgmgr_client_new(pkgmgr_client_type ctype);
295 * @brief This API deletes pkgmgr client.
297 * This API is for package-manager client application.\n
299 * @param[in] pc pkgmgr_client
300 * @return Operation result;
301 * @retval PKGMGR_R_OK success
302 * @retval PKGMGR_R_EINVAL invalid argument
303 * @retval PKGMGR_R_ERROR internal error
305 int pkgmgr_client_free(pkgmgr_client *pc);
308 * @brief This API set information to install tep package.
309 * @details Use this API before calling installation API.
311 * This API is for package-manager client application.\n
313 * @param[in] pc pkgmgr_client
314 * @param[in] tep_path full path that tep file is located at
315 * @param[in] tep_move if TRUE, source file will be moved, else it will be copied
316 * @retval PKGMGR_R_OK success
317 * @retval PKGMGR_R_EINVAL invalid argument
319 int pkgmgr_client_set_tep_path(pkgmgr_client *pc, const char *tep_path, bool tep_move);
322 * @brief This API installs packages.
324 * This API is for package-manager client application.\n
326 * @param[in] pc pkgmgr_client
327 * @param[in] pkg_paths full paths that package file is located
328 * @param[in] n_pkgs number of packages
329 * @param[in] event_cb user callback
330 * @param[in] data user data
331 * @return request_id (>0) if success, error code(<0) if fail\n
332 * @retval PKGMGR_R_OK success
333 * @retval PKGMGR_R_EINVAL invalid argument
334 * @retval PKGMGR_R_ECOMM communication error
336 int pkgmgr_client_install_packages(pkgmgr_client *pc,
337 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
339 int pkgmgr_client_usr_install_packages(pkgmgr_client *pc,
340 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
341 void *data, uid_t uid);
344 * @brief This API installs package.
346 * This API is for package-manager client application.\n
348 * @param[in] pc pkgmgr_client
349 * @param[in] pkg_type package type
350 * @param[in] descriptor_path full path that descriptor is located
351 * @param[in] pkg_path full path that package file is located
352 * @param[in] optional_data optional data which is used for installation
353 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
354 * @param[in] event_cb user callback
355 * @param[in] data user data
356 * @return request_id (>0) if success, error code(<0) if fail\n
357 * @retval PKGMGR_R_OK success
358 * @retval PKGMGR_R_EINVAL invalid argument
359 * @retval PKGMGR_R_ECOMM communication error
361 int pkgmgr_client_install(pkgmgr_client *pc, const char *pkg_type,
362 const char *descriptor_path, const char *pkg_path,
363 const char *optional_data, pkgmgr_mode mode,
364 pkgmgr_handler event_cb, void *data);
365 int pkgmgr_client_usr_install(pkgmgr_client *pc, const char *pkg_type,
366 const char *descriptor_path, const char *pkg_path,
367 const char *optional_data, pkgmgr_mode mode,
368 pkgmgr_handler event_cb, void *data, uid_t uid);
371 * @brief This API reinstalls package.
373 * This API is for package-manager client application.\n
375 * @param[in] pc pkgmgr_client
376 * @param[in] pkg_type package type
377 * @param[in] pkg_path full path that package file is located
378 * @param[in] optional_data optional data which is used for installation
379 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
380 * @param[in] event_cb user callback
381 * @param[in] data user data
382 * @return request_id (>0) if success, error code(<0) if fail\n
383 * @retval PKGMGR_R_OK success
384 * @retval PKGMGR_R_EINVAL invalid argument
385 * @retval PKGMGR_R_ECOMM communication error
387 int pkgmgr_client_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
388 const char *optional_data, pkgmgr_mode mode,
389 pkgmgr_handler event_cb, void *data);
390 int pkgmgr_client_usr_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
391 const char *optional_data, pkgmgr_mode mode,
392 pkgmgr_handler event_cb, void *data, uid_t uid);
395 * @brief This API mount-installs packages.
397 * This API is for package-manager client application.\n
399 * @param[in] pc pkgmgr_client
400 * @param[in] pkg_paths full paths that package file is located
401 * @param[in] n_pkgs number of packages
402 * @param[in] event_cb user callback
403 * @param[in] data user data
404 * @return request_id (>0) if success, error code(<0) if fail\n
405 * @retval PKGMGR_R_OK success
406 * @retval PKGMGR_R_EINVAL invalid argument
407 * @retval PKGMGR_R_ECOMM communication error
409 int pkgmgr_client_mount_install_packages(pkgmgr_client *pc,
410 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
412 int pkgmgr_client_usr_mount_install_packages(pkgmgr_client *pc,
413 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
414 void *data, uid_t uid);
417 * @brief This API mount-installs package.
419 * This API is for package-manager client application.\n
421 * @param[in] pc pkgmgr_client
422 * @param[in] pkg_type package type
423 * @param[in] descriptor_path full path that descriptor is located
424 * @param[in] pkg_path full path that package file is located
425 * @param[in] optional_data optional data which is used for installation
426 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
427 * @param[in] event_cb user callback
428 * @param[in] data user data
429 * @return request_id (>0) if success, error code(<0) if fail\n
430 * @retval PKGMGR_R_OK success
431 * @retval PKGMGR_R_EINVAL invalid argument
432 * @retval PKGMGR_R_ECOMM communication error
434 int pkgmgr_client_mount_install(pkgmgr_client *pc, const char *pkg_type,
435 const char *descriptor_path, const char *pkg_path,
436 const char *optional_data, pkgmgr_mode mode,
437 pkgmgr_handler event_cb, void *data);
438 int pkgmgr_client_usr_mount_install(pkgmgr_client *pc, const char *pkg_type,
439 const char *descriptor_path, const char *pkg_path,
440 const char *optional_data, pkgmgr_mode mode,
441 pkgmgr_handler event_cb, void *data, uid_t uid);
444 * @brief This API uninstalls packages.
446 * This API is for package-manager client application.\n
448 * @param[in] pc pkgmgr_client
449 * @param[in] pkgids package ids
450 * @param[in] n_pkgs number of packages
451 * @param[in] event_cb user callback
452 * @param[in] data user data
453 * @return request_id (>0) if success, error code(<0) if fail\n
454 * @retval PKGMGR_R_OK success
455 * @retval PKGMGR_R_EINVAL invalid argument
456 * @retval PKGMGR_R_ECOMM communication error
458 int pkgmgr_client_uninstall_packages(pkgmgr_client *pc,
459 const char **pkgids, int n_pkgs, pkgmgr_handler event_cb,
461 int pkgmgr_client_usr_uninstall_packages(pkgmgr_client *pc,
462 const char **pkgids, int n_pkgs, pkgmgr_handler event_cb,
463 void *data, uid_t uid);
466 * @brief This API uninstalls package.
468 * This API is for package-manager client application.\n
470 * @param[in] pc pkgmgr_client
471 * @param[in] pkg_type package type
472 * @param[in] pkgid package id
473 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
474 * @param[in] event_cb user callback
475 * @param[in] data user data
476 * @param[in] uid the addressee user id of the instruction
477 * @return request_id (>0), error code(<0) if fail\n
478 * @retval PKGMGR_R_OK success
479 * @retval PKGMGR_R_EINVAL invalid argument
480 * @retval PKGMGR_R_ECOMM communication error
482 int pkgmgr_client_uninstall(pkgmgr_client *pc, const char *pkg_type,
483 const char *pkgid, pkgmgr_mode mode,
484 pkgmgr_handler event_cb, void *data);
485 int pkgmgr_client_usr_uninstall(pkgmgr_client *pc, const char *pkg_type,
486 const char *pkgid, pkgmgr_mode mode,
487 pkgmgr_handler event_cb, void *data, uid_t uid);
490 * @brief This API moves installed package to SD card or vice versa.
492 * This API is for package-manager client application.\n
494 * @param[in] pc pkgmgr_client
495 * @param[in] pkg_type package type
496 * @param[in] pkgid application package id
497 * @param[in] move_type move type
498 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
499 * @param[in] event_cb user callback
500 * @param[in] data user data
501 * @param[in] uid the addressee user id of the instruction
502 * @retval PKGMGR_R_OK success
503 * @retval PKGMGR_R_EINVAL invalid argument
504 * @retval PKGMGR_R_ERROR general error
506 int pkgmgr_client_move(pkgmgr_client *pc, const char *pkg_type,
507 const char *pkgid, pkgmgr_move_type move_type,
508 pkgmgr_handler event_cb, void *data);
509 int pkgmgr_client_usr_move(pkgmgr_client *pc, const char *pkg_type,
510 const char *pkgid, pkgmgr_move_type move_type,
511 pkgmgr_handler event_cb, void *data, uid_t uid);
514 * @brief This API registers the update information of given packages
516 * This API is for package-manager client application.\n
518 * @param[in] pc pkgmgr_client
519 * @param[in] update_info update information
520 * @param[in] uid the addressee user id of the instruction
521 * @retval PKGMGR_R_OK success
522 * @retval PKGMGR_R_EINVAL invalid argument
523 * @retval PKGMGR_R_ERROR general error
525 int pkgmgr_client_register_pkg_update_info(pkgmgr_client *pc,
526 pkg_update_info_t *update_info);
527 int pkgmgr_client_usr_register_pkg_update_info(pkgmgr_client *pc,
528 pkg_update_info_t *update_info, uid_t uid);
531 * @brief This API unregisters update information of certain package.
533 * This API is for package-manager client application.\n
535 * @param[in] pc pkgmgr_client
536 * @param[in] pkgid package id
537 * @param[in] uid the addressee user id of the instruction
538 * @retval PKGMGR_R_OK success
539 * @retval PKGMGR_R_EINVAL invalid argument
540 * @retval PKGMGR_R_ERROR general error
542 int pkgmgr_client_unregister_pkg_update_info(pkgmgr_client *pc, const char *pkgid);
543 int pkgmgr_client_usr_unregister_pkg_update_info(pkgmgr_client *pc,
544 const char *pkgid, uid_t uid);
547 * @brief This API unregister update information of all packages.
549 * This API is for package-manager client application.\n
551 * @param[in] pc pkgmgr_client
552 * @param[in] uid the addressee user id of the instruction
553 * @retval PKGMGR_R_OK success
554 * @retval PKGMGR_R_EINVAL invalid argument
555 * @retval PKGMGR_R_ERROR general error
557 int pkgmgr_client_unregister_all_pkg_update_info(pkgmgr_client *pc);
558 int pkgmgr_client_usr_unregister_all_pkg_update_info(pkgmgr_client *pc,
562 * @brief This API activates package.
564 * This API is for package-manager client application.\n
566 * @param[in] pc pkgmgr_client
567 * @param[in] pkg_type package type
568 * @param[in] pkgid package id
569 * @return request_id (>0) if success, error code(<0) if fail\n
570 * @retval PKGMGR_R_OK success
571 * @retval PKGMGR_R_EINVAL invalid argument
572 * @retval PKGMGR_R_ECOMM communication error
574 int pkgmgr_client_activate(pkgmgr_client *pc, const char *pkg_type,
576 int pkgmgr_client_usr_activate(pkgmgr_client *pc, const char *pkg_type,
577 const char *pkgid, uid_t uid);
580 * @brief This API activates multiple packages.
582 * This API is for package-manager client application.\n
584 * @param[in] pc pkgmgr_client
585 * @param[in] pkg_type package type
586 * @param[in] pkgids array of package ids
587 * @param[in] n_pkgs size of array
588 * @param[in] event_cb user callback
589 * @param[in] data user data
590 * @return request_id (>0) if success, error code(<0) if fail\n
591 * @retval PKGMGR_R_OK success
592 * @retval PKGMGR_R_EINVAL invalid argument
593 * @retval PKGMGR_R_ECOMM communication error
595 int pkgmgr_client_activate_packages(pkgmgr_client *pc, const char *pkg_type,
596 const char **pkgids, int n_pkgs,
597 pkgmgr_handler event_cb, void *data);
598 int pkgmgr_client_usr_activate_packages(pkgmgr_client *pc, const char *pkg_type,
599 const char **pkgids, int n_pkgs,
600 pkgmgr_handler event_cb, void *data, uid_t uid);
603 * @brief This API deactivates package.
605 * This API is for package-manager client application.\n
607 * @param[in] pc pkgmgr_client
608 * @param[in] pkg_type package type
609 * @param[in] pkgid package id
610 * @return request_id (>0) if success, error code(<0) if fail\n
611 * @retval PKGMGR_R_OK success
612 * @retval PKGMGR_R_EINVAL invalid argument
613 * @retval PKGMGR_R_ECOMM communication error
615 int pkgmgr_client_deactivate(pkgmgr_client *pc, const char *pkg_type,
617 int pkgmgr_client_usr_deactivate(pkgmgr_client *pc, const char *pkg_type,
618 const char *pkgid, uid_t uid);
621 * @brief This API deactivates multiple packages.
623 * This API is for package-manager client application.\n
625 * @param[in] pc pkgmgr_client
626 * @param[in] pkg_type package type
627 * @param[in] pkgids array of package ids
628 * @param[in] n_pkgs size of array
629 * @param[in] event_cb user callback
630 * @param[in] data user data
631 * @return request_id (>0) if success, error code(<0) if fail\n
632 * @retval PKGMGR_R_OK success
633 * @retval PKGMGR_R_EINVAL invalid argument
634 * @retval PKGMGR_R_ECOMM communication error
636 int pkgmgr_client_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
637 const char **pkgids, int n_pkgs,
638 pkgmgr_handler event_cb, void *data);
639 int pkgmgr_client_usr_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
640 const char **pkgids, int n_pkgs,
641 pkgmgr_handler event_cb, void *data, uid_t uid);
644 * @brief This API deactivates app.
646 * This API is for package-manager client application.\n
648 * @param[in] pc pkgmgr_client
649 * @param[in] appid applicaiton id
650 * @param[in] app_event_cb user callback
651 * @param[in] data user data
652 * @return request_id (>0) if success, error code(<0) if fail\n
653 * @retval PKGMGR_R_OK success
654 * @retval PKGMGR_R_EINVAL invalid argument
655 * @retval PKGMGR_R_ECOMM communication error
657 int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
658 int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
661 * @brief This API activates multiple apps.
663 * This API is for package-manager client application.\n
665 * @param[in] pc pkgmgr_client
666 * @param[in] appids array of application ids
667 * @param[in] n_apps size of array
668 * @param[in] app_event_cb user callback
669 * @param[in] data user data
670 * @return request_id (>0) if success, error code(<0) if fail\n
671 * @retval PKGMGR_R_OK success
672 * @retval PKGMGR_R_EINVAL invalid argument
673 * @retval PKGMGR_R_ECOMM communication error
675 int pkgmgr_client_activate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
676 int pkgmgr_client_usr_activate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
679 * @brief This API deactivates multiple apps.
681 * This API is for package-manager client application.\n
683 * @param[in] pc pkgmgr_client
684 * @param[in] appids array of application ids
685 * @param[in] n_apps size of array
686 * @param[in] app_event_cb user callback
687 * @param[in] data user data
688 * @return request_id (>0) if success, error code(<0) if fail\n
689 * @retval PKGMGR_R_OK success
690 * @retval PKGMGR_R_EINVAL invalid argument
691 * @retval PKGMGR_R_ECOMM communication error
693 int pkgmgr_client_deactivate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
694 int pkgmgr_client_usr_deactivate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
697 * @brief This API deactivates global app for user specified by uid.
699 * This API is for package-manager client application.\n
701 * @param[in] pc pkgmgr_client
702 * @param[in] appid applicaiton id
703 * @param[in] app_event_cb user callback
704 * @param[in] uid user id
705 * @param[in] data user data
706 * @return request_id (>0) if success, error code(<0) if fail\n
707 * @retval PKGMGR_R_OK success
708 * @retval PKGMGR_R_EINVAL invalid argument
709 * @retval PKGMGR_R_ECOMM communication error
711 int pkgmgr_client_deactivate_global_app_for_uid(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
714 * @brief This API activates app.
716 * This API is for package-manager client application.\n
718 * @param[in] pc pkgmgr_client
719 * @param[in] appid applicaiton id
720 * @param[in] app_event_cb user callback
721 * @param[in] uid user id
722 * @param[in] data user data
723 * @return request_id (>0) if success, error code(<0) if fail\n
724 * @retval PKGMGR_R_OK success
725 * @retval PKGMGR_R_EINVAL invalid argument
726 * @retval PKGMGR_R_ECOMM communication error
728 int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
729 int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
732 * @brief This API activates global app for user specified by uid.
734 * This API is for package-manager client application.\n
736 * @param[in] pc pkgmgr_client
737 * @param[in] appid applicaiton id
738 * @param[in] app_event_cb user callback
739 * @param[in] uid user id
740 * @param[in] data user data
741 * @return request_id (>0) if success, error code(<0) if fail\n
742 * @retval PKGMGR_R_OK success
743 * @retval PKGMGR_R_EINVAL invalid argument
744 * @retval PKGMGR_R_ECOMM communication error
746 int pkgmgr_client_activate_global_app_for_uid(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
749 * @brief This API deletes application's private data.
751 * This API is for package-manager client application.\n
753 * @remarks You should call this function with regular uid
754 * @param[in] pc pkgmgr_client
755 * @param[in] pkg_type package type
756 * @param[in] pkgid package id
757 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
758 * @return request_id (>0) if success, error code(<0) if fail\n
759 * @retval PKGMGR_R_OK success
760 * @retval PKGMGR_R_EINVAL invalid argument
761 * @retval PKGMGR_R_ECOMM communication error
763 int pkgmgr_client_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
764 const char *pkgid, pkgmgr_mode mode);
765 int pkgmgr_client_usr_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
766 const char *pkgid, pkgmgr_mode mode, uid_t uid);
770 * @brief This API deletes application's specific private data.
772 * This API is for package-manager client application.\n
774 * @remarks You should call this function with regular uid
775 * @param[in] pc pkgmgr_client
776 * @param[in] pkg_type package type
777 * @param[in] pkgid package id
778 * @param[in] file_path file path that is relative path from the givin package user data directory.
779 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
780 * @return request_id (>0) if success, error code(<0) if fail\n
781 * @retval PKGMGR_R_OK success
782 * @retval PKGMGR_R_EINVAL invalid argument
783 * @retval PKGMGR_R_ECOMM communication error
785 int pkgmgr_client_clear_user_data_with_path(pkgmgr_client *pc,
786 const char *pkg_type, const char *pkgid,
787 const char *file_path, pkgmgr_mode mode);
788 int pkgmgr_client_usr_clear_user_data_with_path(pkgmgr_client *pc,
789 const char *pkg_type, const char *pkgid, const char *file_path,
790 pkgmgr_mode mode, uid_t uid);
793 * @brief This API set status type to listen for the pkgmgr's broadcasting
795 * This API is for package-manager client application.\n
797 * @param[in] pc pkgmgr_client
798 * @param[in] status_type status type to listen
799 * @return request_id (>0) if success, error code(<0) if fail\n
800 * @retval PKGMGR_R_OK success
801 * @retval PKGMGR_R_EINVAL invalid argument
803 int pkgmgr_client_set_status_type(pkgmgr_client *pc, int status_type);
806 * @brief This API request to listen the pkgmgr's broadcasting
808 * This API is for package-manager client application.\n
810 * @param[in] pc pkgmgr_client
811 * @param[in] event_cb user callback
812 * @param[in] data user data
813 * @return request_id (>0) if success, error code(<0) if fail\n
814 * @retval PKGMGR_R_OK success
815 * @retval PKGMGR_R_EINVAL invalid argument
817 int pkgmgr_client_listen_status(pkgmgr_client *pc, pkgmgr_handler event_cb,
821 * @brief This API request to listen the pkgmgr's broadcasting about apps
823 * This API is for package-manager client application.\n
825 * @param[in] pc pkgmgr_client
826 * @param[in] event_cb user callback
827 * @param[in] data user data
828 * @return request_id (>0) if success, error code(<0) if fail\n
829 * @retval PKGMGR_R_OK success
830 * @retval PKGMGR_R_EINVAL invalid argument
832 int pkgmgr_client_listen_app_status(pkgmgr_client *pc, pkgmgr_app_handler event_cb,
836 * @brief This API request to listen the pkgmgr's broadcasting about resource copy
838 * This API is for package-manager client application.\n
840 * @param[in] pc pkgmgr_client
841 * @param[in] event_cb user callback
842 * @param[in] data user data
843 * @return request_id (>0) if success, error code(<0) if fail\n
844 * @retval PKGMGR_R_OK success
845 * @retval PKGMGR_R_EINVAL invalid argument
846 * @retval PKGMGR_R_ENOMEM out of memory
848 int pkgmgr_client_listen_res_status(pkgmgr_client *pc,
849 pkgmgr_res_handler event_cb, void *data);
852 * @brief This API request to listen the pkgmgr's broadcasting about upgrade event
854 * This API is for package-manager client application.\n
856 * @param[in] pc pkgmgr_client
857 * @param[in] event_cb user callback
858 * @param[in] data user data
859 * @return request_id (>0) if success, error code(<0) if fail\n
860 * @retval PKGMGR_R_OK success
861 * @retval PKGMGR_R_EINVAL invalid argument
862 * @retval PKGMGR_R_ENOMEM out of memory
864 int pkgmgr_client_listen_pkg_upgrade_status(pkgmgr_client *pc,
865 pkgmgr_pkg_upgrade_handler event_cb, void *data);
868 * @brief This API request to stop listen the pkgmgr's broadcasting
870 * This API is for package-manager client application.\n
872 * @param[in] pc pkgmgr_client
873 * @return 0 if success, error code(<0) if fail\n
874 * @retval PKGMGR_R_OK success
875 * @retval PKGMGR_R_EINVAL invalid argument
876 * @retval PKGMGR_R_ERROR internal error
878 int pkgmgr_client_remove_listen_status(pkgmgr_client *pc);
881 * @brief This API broadcasts pkgmgr's status
883 * This API is for package-manager client application.\n
885 * @param[in] pc pkgmgr_client
886 * @param[in] pkg_type package type
887 * @param[in] pkgid package id
888 * @param[in] key key to broadcast
889 * @param[in] val value to broadcast
890 * @return 0 if success, error code(<0) if fail\n
891 * @retval PKGMGR_R_OK success
892 * @retval PKGMGR_R_EINVAL invalid argument
894 int pkgmgr_client_broadcast_status(pkgmgr_client *pc, const char *pkg_type,
895 const char *pkgid, const char *key,
899 * @brief This API gets the package's information.
901 * This API is for package-manager client application.\n
903 * @param[in] pkg_path package file path to get infomation
904 * @return package entry pointer if success, NULL if fail\n
906 pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path);
909 * @brief This API get package information value
911 * This API is for package-manager client application.\n
913 * @param[in] pkg_info pointer for package info entry
914 * @return 0 if success, error code(<0) if fail\n
916 int pkgmgr_client_free_pkginfo(pkgmgr_info *pkg_info);
919 * @brief This API requests service
921 * This API is for package-manager client application.\n
923 * @param[in] service_type pkgmgr_request_service_type
924 * @param[in] service_mode mode which is used for addtional mode selection
925 * @param[in] pc pkgmgr_client
926 * @param[in] pkg_type package type
927 * @param[in] pkgid package id
928 * @param[in] custom_info custom information which is used for addtional information
929 * @param[in] event_cb user callback
930 * @param[in] data user data
931 * @return request_id (>0) if success, error code(<0) if fail\n
932 * @retval PKGMGR_R_OK success
933 * @retval PKGMGR_R_EINVAL invalid argument
934 * @retval PKGMGR_R_ECOMM communication error
936 int pkgmgr_client_request_service(pkgmgr_request_service_type service_type, int service_mode,
937 pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
938 const char *custom_info, pkgmgr_handler event_cb, void *data);
939 int pkgmgr_client_usr_request_service(pkgmgr_request_service_type service_type, int service_mode,
940 pkgmgr_client *pc, const char *pkg_type, const char *pkgid, uid_t uid,
941 const char *custom_info, pkgmgr_handler event_cb, void *data);
943 * @brief This API get package size
945 * This API is for package-manager client application.\n
947 * @param[in] pc pkgmgr_client
948 * @param[in] pkgid package id
949 * @param[in] get_type type for pkgmgr client request to get package size
950 * @param[in] event_cb user callback
951 * @param[in] data user data
952 * @return request_id (>0) if success, error code(<0) if fail\n
953 * @retval PKGMGR_R_OK success
954 * @retval PKGMGR_R_EINVAL invalid argument
955 * @retval PKGMGR_R_ECOMM communication error
957 int pkgmgr_client_get_size(pkgmgr_client *pc, const char *pkgid, pkgmgr_getsize_type get_type, pkgmgr_handler event_cb, void *data);
958 int pkgmgr_client_usr_get_size(pkgmgr_client *pc, const char *pkgid, pkgmgr_getsize_type get_type, pkgmgr_handler event_cb, void *data, uid_t uid);
961 * @brief Gets the package size information.
962 * @details The package size info is asynchronously obtained by the specified callback function.
964 * @param[in] pc The pointer to pkgmgr_client instance
965 * @param[in] pkgid The package ID
966 * @param[in] result_cb The asynchronous callback function to get the package size information
967 * @param[in] user_data User data to be passed to the callback function
969 * @return 0 on success, otherwise a negative error value
970 * @retval #PKGMGR_R_OK Successful
971 * @retval #PKGMGR_R_EINVAL Invalid parameter
972 * @retval #PKGMGR_R_ERROR Internal error
974 int pkgmgr_client_get_package_size_info(pkgmgr_client *pc, const char *pkgid, pkgmgr_pkg_size_info_receive_cb result_cb, void *user_data);
975 int pkgmgr_client_usr_get_package_size_info(pkgmgr_client *pc, const char *pkgid, pkgmgr_pkg_size_info_receive_cb result_cb, void *user_data, uid_t uid);
978 * @brief Gets the sum of the entire package size information.
979 * @details The package size info is asynchronously obtained by the specified callback function.
981 * @param[in] pc The pointer to pkgmgr_client instance
982 * @param[in] result_cb The asynchronous callback function to get the total package size information
983 * @param[in] user_data User data to be passed to the callback function
985 * @return 0 on success, otherwise a negative error value
986 * @retval #PKGMGR_R_OK Successful
987 * @retval #PKGMGR_R_EINVAL Invalid parameter
988 * @retval #PKGMGR_R_ERROR Internal error
990 int pkgmgr_client_get_total_package_size_info(pkgmgr_client *pc, pkgmgr_total_pkg_size_info_receive_cb result_cb, void *user_data);
991 int pkgmgr_client_usr_get_total_package_size_info(pkgmgr_client *pc, pkgmgr_total_pkg_size_info_receive_cb result_cb, void *user_data, uid_t uid);
994 * @brief This API removes cache directories
996 * This API is for package-manager client application.\n
998 * @remarks You should call this function with regular uid
999 * @param[in] pkgid package id
1000 * @return 0 if success, error code(<0) if fail\n
1001 * @retval PKGMGR_R_OK success
1002 * @retval PKGMGR_R_EINVAL invalid argument
1003 * @retval PKGMGR_R_EPRIV privilege denied
1004 * @retval PKGMGR_R_ERROR internal error
1006 int pkgmgr_client_clear_cache_dir(const char *pkgid);
1007 int pkgmgr_client_usr_clear_cache_dir(const char *pkgid, uid_t uid);
1010 * @brief This API removes all cache directories
1012 * This API is for package-manager client application.\n
1014 * @remarks You should call this function with regular uid
1015 * @return 0 if success, error code(<0) if fail\n
1016 * @retval PKGMGR_R_OK success
1017 * @retval PKGMGR_R_EINVAL invalid argument
1018 * @retval PKGMGR_R_EPRIV privilege denied
1019 * @retval PKGMGR_R_ERROR internal error
1021 int pkgmgr_client_clear_all_cache_dir(void);
1022 int pkgmgr_client_usr_clear_all_cache_dir(uid_t uid);
1025 * @brief Generates request for getting license
1027 * This API generates request for getting license.\n
1029 * @remarks You must release @a req_data and @a license_url by yourself.
1030 * @param[in] pc The pointer to pkgmgr_client instance
1031 * @param[in] resp_data The response data string of the purchase request
1032 * @param[out] req_data License request data
1033 * @param[out] license_url License acquisition url data
1034 * @return 0 if success, error code(<0) if fail\n
1035 * @retval PKGMGR_R_OK success
1036 * @retval PKGMGR_R_EINVAL invalid argument
1037 * @retval PKGMGR_R_ECOMM communication error
1038 * @retval PKGMGR_R_EPRIV privilege denied
1039 * @retval PKGMGR_R_ESYSTEM severe system error
1041 int pkgmgr_client_generate_license_request(pkgmgr_client *pc, const char *resp_data, char **req_data, char **license_url);
1044 * @brief Registers encrypted license
1046 * This API registers encrypted license.\n
1048 * @param[in] pc The pointer to pkgmgr_client instance
1049 * @param[in] resp_data The response data string of the purchase request
1050 * @return 0 if success, error code(<0) if fail\n
1051 * @retval PKGMGR_R_OK success
1052 * @retval PKGMGR_R_EINVAL invalid argument
1053 * @retval PKGMGR_R_ECOMM communication error
1054 * @retval PKGMGR_R_EPRIV privilege denied
1055 * @retval PKGMGR_R_ESYSTEM severe system error
1057 int pkgmgr_client_register_license(pkgmgr_client *pc, const char *resp_data);
1060 * @brief Decrypts contents which is encrypted
1062 * This API decrypts contents which is encrypted.\n
1064 * @param[in] pc The pointer to pkgmgr_client instance
1065 * @param[in] drm_file_path The pointer to pkgmgr_client instance
1066 * @param[in] decrypted_file_path The pointer to pkgmgr_client instance
1067 * @return 0 if success, error code(<0) if fail\n
1068 * @retval PKGMGR_R_OK success
1069 * @retval PKGMGR_R_EINVAL invalid argument
1070 * @retval PKGMGR_R_ECOMM communication error
1071 * @retval PKGMGR_R_EPRIV privilege denied
1072 * @retval PKGMGR_R_ESYSTEM severe system error
1074 int pkgmgr_client_decrypt_package(pkgmgr_client *pc, const char *drm_file_path, const char *decrypted_file_path);
1077 * @brief This API is enabled the splash screen
1079 * This API is for package-manager client application.\n
1081 * @param[in] pc pkgmgr_client
1082 * @param[in] appid applicaiton id
1083 * @return request_id (>0) if success, error code(<0) if fail\n
1084 * @retval PKGMGR_R_OK success
1085 * @retval PKGMGR_R_EINVAL invalid argument
1086 * @retval PKGMGR_R_ECOMM communication error
1087 * @retval PKGMGR_R_ENOMEM out of memory
1089 int pkgmgr_client_enable_splash_screen(pkgmgr_client *pc, const char *appid);
1090 int pkgmgr_client_usr_enable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
1093 * @brief This API is disabled the splash screen
1095 * This API is for package-manager client application.\n
1097 * @param[in] pc pkgmgr_client
1098 * @param[in] appid applicaiton id
1099 * @return request_id (>0) if success, error code(<0) if fail\n
1100 * @retval PKGMGR_R_OK success
1101 * @retval PKGMGR_R_EINVAL invalid argument
1102 * @retval PKGMGR_R_ECOMM communication error
1103 * @retval PKGMGR_R_ENOMEM out of memory
1105 int pkgmgr_client_disable_splash_screen(pkgmgr_client *pc, const char *appid);
1106 int pkgmgr_client_usr_disable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
1109 * @brief Set restriction mode
1111 * This API set restriction mode bit.\n
1113 * @param[in] pc The pointer to pkgmgr_client instance
1114 * @param[in] mode restriction mode bit
1115 * @return 0 if success, error code(<0) if fail\n
1116 * @retval PKGMGR_R_OK success
1117 * @retval PKGMGR_R_EINVAL invalid argument
1118 * @retval PKGMGR_R_ECOMM communication error
1119 * @retval PKGMGR_R_EPRIV privilege denied
1120 * @see pkgmgr_restriction_mode
1122 int pkgmgr_client_set_restriction_mode(pkgmgr_client *pc, int mode);
1123 int pkgmgr_client_usr_set_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
1126 * @brief Unset restriction mode
1128 * This API unset restriction mode bit.\n
1130 * @param[in] pc The pointer to pkgmgr_client instance
1131 * @param[in] mode restriction mode bit
1132 * @return 0 if success, error code(<0) if fail\n
1133 * @retval PKGMGR_R_OK success
1134 * @retval PKGMGR_R_EINVAL invalid argument
1135 * @retval PKGMGR_R_ECOMM communication error
1136 * @retval PKGMGR_R_EPRIV privilege denied
1137 * @see pkgmgr_restriction_mode
1139 int pkgmgr_client_unset_restriction_mode(pkgmgr_client *pc, int mode);
1140 int pkgmgr_client_usr_unset_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
1143 * @brief Get restriction mode
1145 * This API gets restriction mode bit.\n
1147 * @param[in] pc The pointer to pkgmgr_client instance
1148 * @param[out] mode restriction mode bit
1149 * @return 0 if success, error code(<0) if fail\n
1150 * @retval PKGMGR_R_OK success
1151 * @retval PKGMGR_R_EINVAL invalid argument
1152 * @retval PKGMGR_R_ECOMM communication error
1153 * @retval PKGMGR_R_EPRIV privilege denied
1154 * @see pkgmgr_restriction_mode
1156 int pkgmgr_client_get_restriction_mode(pkgmgr_client *pc, int *mode);
1157 int pkgmgr_client_usr_get_restriction_mode(pkgmgr_client *pc, int *mode, uid_t uid);
1160 * @brief Set restriction mode bit for package specified.
1161 * @details You can combine multiple status using OR operation which you want to restrict.
1163 * This API sets restriction bit for pkg operation to not allow user to do it.\n
1165 * @param[in] pc The pointer to pkgmgr_client instance
1166 * @param[in] pkgid pkgid to be restricted
1167 * @param[in] mode restriction mode bit
1168 * @return 0 if success, error code(<0) if fail\n
1169 * @retval PKGMGR_R_OK success
1170 * @retval PKGMGR_R_EINVAL invalid argument
1171 * @retval PKGMGR_R_ECOMM communication error
1172 * @retval PKGMGR_R_EPRIV privilege denied
1173 * @see pkgmgr_restriction_mode
1175 int pkgmgr_client_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1176 int pkgmgr_client_usr_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1179 * @brief Unset restriction mode bit for package specified
1180 * @details You can combine multiple status using OR operation which you want to unset
1182 * This API unsets restriction bit to remove restriction of pkg operation.
1184 * @param[in] pc The pointer to pkgmgr_client instance
1185 * @param[in] pkgid pkg id to be remove in restriction.
1186 * @param[in] mode restriction mode bit
1187 * @return 0 if success, error code(<0) if fail\n
1188 * @retval PKGMGR_R_OK success
1189 * @retval PKGMGR_R_EINVAL invalid argument
1190 * @retval PKGMGR_R_ECOMM communication error
1191 * @retval PKGMGR_R_EPRIV privilege denied
1192 * @see pkgmgr_restriction_mode
1194 int pkgmgr_client_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1195 int pkgmgr_client_usr_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1198 * @brief Get restriction bit of package operation
1200 * This API gets restriction bit for restricted package operation.\n
1202 * @param[in] pc The pointer to pkgmgr_client instance
1203 * @param[in] pkgid pkg id to be remove in restriction.
1204 * @param[out] mode restriction mode bit
1205 * @return 0 if success, error code(<0) if fail\n
1206 * @retval PKGMGR_R_OK success
1207 * @retval PKGMGR_R_EINVAL invalid argument
1208 * @retval PKGMGR_R_ECOMM communication error
1209 * @retval PKGMGR_R_EPRIV privilege denied
1210 * @see pkgmgr_restriction_mode
1212 int pkgmgr_client_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode);
1213 int pkgmgr_client_usr_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode, uid_t uid);
1216 * @brief Change application's label
1218 * This API sets label of application specified.\n
1220 * @param[in] pc The pointer to pkgmgr_client instance
1221 * @param[in] appid app id to be changed.
1222 * @param[in] label application's label to change.
1223 * @param[out] mode restriction mode bit
1224 * @return 0 if success, error code(<0) if fail\n
1225 * @retval PKGMGR_R_OK success
1226 * @retval PKGMGR_R_EINVAL invalid argument
1227 * @retval PKGMGR_R_ECOMM communication error
1229 int pkgmgr_client_set_app_label(pkgmgr_client *pc, char *appid, char *label);
1230 int pkgmgr_client_usr_set_app_label(pkgmgr_client *pc, char *appid, char *label, uid_t uid);
1233 * @brief Change application's icon
1235 * This API sets icon of application specified.\n
1237 * @param[in] pc The pointer to pkgmgr_client instance
1238 * @param[in] appid app id to be changed.
1239 * @param[in] icon_path application's icon path to change.
1240 * @return 0 if success, error code(<0) if fail\n
1241 * @retval PKGMGR_R_OK success
1242 * @retval PKGMGR_R_EINVAL invalid argument
1243 * @retval PKGMGR_R_ECOMM communication error
1245 int pkgmgr_client_set_app_icon(pkgmgr_client *pc, char *appid, char *icon_path);
1246 int pkgmgr_client_usr_set_app_icon(pkgmgr_client *pc, char *appid, char *icon_path, uid_t uid);
1249 * @brief Set debug mode
1251 * This API sets debug mode value for request.\n
1253 * @param[in] pc The pointer to pkgmgr_client instance
1254 * @param[in] debug_mode indicates the request is debug mode or not
1255 * @return 0 if success, error code(<0) if fail\n
1256 * @retval PKGMGR_R_OK success
1257 * @retval PKGMGR_R_EINVAL invalid argument
1259 int pkgmgr_client_set_debug_mode(pkgmgr_client *pc, bool debug_mode);
1262 * @brief Set skip optimization
1264 * This API sets skip optimization value for request.\n
1266 * @param[in] pc The pointer to pkgmgr_client instance
1267 * @param[in] skip_optimization indicates the request is skip optimization or not
1268 * @return 0 if success, error code(<0) if fail\n
1269 * @retval PKGMGR_R_OK success
1270 * @retval PKGMGR_R_EINVAL invalid argument
1272 int pkgmgr_client_set_skip_optimization(pkgmgr_client *pc, bool skip_optimization);
1275 * @brief Migrate legacy external image which is generated under 3.0
1277 * This API request the migration of external image.\n
1279 * @param[in] pc The pointer to pkgmgr_client instance
1280 * @param[in] pkgid pkg id which have legacy image
1281 * @return 0 if success, error code(<0) if fail\n
1282 * @retval PKGMGR_R_OK success
1283 * @retval PKGMGR_R_EINVAL invalid argument
1285 int pkgmgr_client_usr_migrate_external_image(pkgmgr_client *pc, const char *pkgid, uid_t uid);
1288 * @brief Add resource path to copy
1290 * This API adds path for resource copy request.\n
1292 * @param[in] pc The pointer to pkgmgr_client instance
1293 * @param[in] src_path Path of a resource that client want to copy
1294 * @param[in] dest_path Destination path to copy source path, if dest_path is null it will be set to root path of the package's sharing resource directory
1295 * @return 0 if success, error code(<0) if fail\n
1296 * @retval PKGMGR_R_OK success
1297 * @retval PKGMGR_R_EINVAL invalid argument
1298 * @retval PKGMGR_R_ENOMEM out of memory
1300 int pkgmgr_client_add_res_copy_path(pkgmgr_client *pc, const char *src_path, const char *dest_path);
1303 * @brief This API is for copy resources into shared directory exists for privileged resources.
1305 * This API is for package-manager client application.\n
1307 * @param[in] pc pkgmgr_client
1308 * @param[in] event_cb user callback
1309 * @param[in] data user data
1310 * @return request_id (>0) if success, error code(<0) if fail\n
1311 * @retval PKGMGR_R_ECOMM communication error
1312 * @retval PKGMGR_R_EINVAL invalid argument
1313 * @retval PKGMGR_R_ENOMEM out of memory
1314 * @retval PKGMGR_R_EPRIV privilege denied
1316 int pkgmgr_client_res_copy(pkgmgr_client *pc, pkgmgr_res_handler event_cb, void *user_data);
1319 * @brief Add directory path to create in the resource sharing directory of the package
1321 * This API adds directory path for resource create directory request.\n
1323 * @param[in] pc The pointer to pkgmgr_client instance
1324 * @param[in] dir_path Path of a directory that client want to create
1325 * @return PKGMGR_R_OK if success, error code(<0) if fail\n
1326 * @retval PKGMGR_R_OK success
1327 * @retval PKGMGR_R_EINVAL invalid argument
1328 * @retval PKGMGR_R_ENOMEM out of memory
1330 int pkgmgr_client_add_res_create_dir_path(pkgmgr_client *pc, const char *dir_path);
1333 * @brief This API create directories in the resource sharing directory of the package
1335 * This API is for package-manager client application.\n
1337 * @param[in] pc pkgmgr_client
1338 * @param[in] event_cb user callback
1339 * @param[in] data user data
1340 * @return request_id (>0) if success, error code(<0) if fail\n
1341 * @retval PKGMGR_R_ECOMM communication error
1342 * @retval PKGMGR_R_EINVAL invalid argument
1343 * @retval PKGMGR_R_ENOMEM out of memory
1344 * @retval PKGMGR_R_EPRIV privilege denied
1346 int pkgmgr_client_res_create_dir(pkgmgr_client *pc, pkgmgr_res_handler event_cb, void *user_data);
1349 * @brief Add resource path to remove
1351 * This API adds path for resource remove request.\n
1353 * @param[in] pc The pointer to pkgmgr_client instance
1354 * @param[in] res_path Path of a copied resource that client want to remove
1355 * @return PKGMGR_R_OK if success, error code(<0) if fail\n
1356 * @retval PKGMGR_R_OK success
1357 * @retval PKGMGR_R_EINVAL invalid argument
1358 * @retval PKGMGR_R_ENOMEM out of memory
1360 int pkgmgr_client_add_res_remove_path(pkgmgr_client *pc, const char *res_path);
1363 * @brief This API removes resources.
1365 * This API is for package-manager client application.\n
1367 * @param[in] pc pkgmgr_client
1368 * @param[in] event_cb user callback
1369 * @param[in] data user data
1370 * @return request_id (>0) if success, error code(<0) if fail\n
1371 * @retval PKGMGR_R_ECOMM communication error
1372 * @retval PKGMGR_R_EINVAL invalid argument
1373 * @retval PKGMGR_R_ENOMEM out of memory
1374 * @retval PKGMGR_R_EPRIV privilege denied
1376 int pkgmgr_client_res_remove(pkgmgr_client *pc, pkgmgr_res_handler event_cb, void *user_data);
1379 * @brief This API uninstall copied resources of the package.
1381 * This API is for package-manager client application.\n
1383 * @param[in] pc pkgmgr_client
1384 * @param[in] pkgid package id
1385 * @return PKGMGR_R_OK if success, error code(<0) if fail\n
1386 * @retval PKGMGR_R_OK success
1387 * @retval PKGMGR_R_ECOMM communication error
1388 * @retval PKGMGR_R_EINVAL invalid argument
1389 * @retval PKGMGR_R_ENOMEM out of memory
1390 * @retval PKGMGR_R_EPRIV privilege denied
1392 int pkgmgr_client_res_uninstall(pkgmgr_client *pc, const char *pkgid);
1393 int pkgmgr_client_res_usr_uninstall(pkgmgr_client *pc, const char *pkgid, uid_t uid);
1396 * @brief This API creates resource event info.
1398 * This API is for package-manager client application.\n
1400 * @return resource event info object
1401 * @retval NULL on failure creating an object
1403 pkgmgr_res_event_info *pkgmgr_res_event_info_new();
1406 * @brief This API delete resource event info.
1408 * This API is for package-manager client application.\n
1410 * @param[in] info resource event info
1411 * @return Operation result;
1412 * @retval PKGMGR_R_OK success
1413 * @retval PKGMGR_R_EINVAL invalid argument
1414 * @retval PKGMGR_R_ERROR internal error
1416 int pkgmgr_res_event_info_free(pkgmgr_res_event_info *info);
1419 * @brief This API sets the error code to resource event info handle.
1421 * This API is for package-manager client application.\n
1423 * @param[in] handle resource event information handle
1424 * @param[in] error_code error code about resource event
1425 * @retval PKGMGR_R_OK success
1426 * @retval PKGMGR_R_EINVAL invalid argument
1428 int pkgmgr_res_event_info_set_error_code(pkgmgr_res_event_info *handle,
1432 * @brief This API gets the error code from resource event info handle.
1434 * This API is for package-manager client application.\n
1436 * @param[in] handle resource event information handle
1437 * @param[out] error_code error code about resource event
1438 * @retval PKGMGR_R_OK success
1439 * @retval PKGMGR_R_EINVAL invalid argument
1441 int pkgmgr_res_event_info_get_error_code(pkgmgr_res_event_info *handle,
1445 * @brief This API adds the path state to resource event info handle.
1447 * This API is for package-manager client application.\n
1449 * @param[in] handle resource event information handle
1450 * @param[in] path path related resource event
1451 * @param[in] state state of the path
1452 * @retval PKGMGR_R_OK success
1453 * @retval PKGMGR_R_EINVAL invalid argument
1454 * @retval PKGMGR_R_ENOMEM out of memory
1456 int pkgmgr_res_event_info_add_path_state(pkgmgr_res_event_info *handle,
1457 const char *path, pkgmgr_res_event_path_state state);
1460 * @brief This API retrieve the path state from resource callback handle.
1462 * This API is for package-manager client application.\n
1464 * @param[in] handle resource event information handle
1465 * @param[in] callback callback to be invoked for each retrieved path
1466 * @param[in] user_data User data to be passed to the callback function
1467 * @retval PKGMGR_R_OK success
1468 * @retval PKGMGR_R_EINVAL invalid argument
1470 int pkgmgr_res_event_info_foreach_path(pkgmgr_res_event_info *handle,
1471 pkgmgr_res_event_path_cb callback, void *user_data);
1479 #endif /* __PKG_MANAGER_H__ */