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>
63 #define DEPRECATED __attribute__ ((__deprecated__))
69 * This is package manager
71 * Packaeg manager is used to install/uninstall the packages.\n
72 * package includes dpkg, java, widget, etc. and it can be added\n
73 * Security is considered on current package manager\n
78 * @file package-manager.h
79 * @brief Package Manager header
81 * Generated by Sewook Park <sewook7.park@samsung.com>
87 * @addtogroup PackageManager
92 * @brief pkgmgr info types.
94 #define PKGMGR_INFO_STR_PKGTYPE "pkg_type"
95 #define PKGMGR_INFO_STR_PKGNAME "pkg_name"
96 #define PKGMGR_INFO_STR_VERSION "version"
97 #define PKGMGR_INFO_STR_INSTALLED_SIZE "installed_size"
98 #define PKGMGR_INFO_STR_DATA_SIZE "data_size"
99 #define PKGMGR_INFO_STR_APP_SIZE "app_size"
100 #define PKGMGR_INFO_STR_INSTALLED_TIME "installed_time"
103 * @brief listening status type in pkgmgr.
105 #define PKGMGR_CLIENT_STATUS_ALL 0x0FFF
106 #define PKGMGR_CLIENT_STATUS_INSTALL 0x0001
107 #define PKGMGR_CLIENT_STATUS_UNINSTALL 0x0002
108 #define PKGMGR_CLIENT_STATUS_UPGRADE 0x0004
109 #define PKGMGR_CLIENT_STATUS_MOVE 0x0008
110 #define PKGMGR_CLIENT_STATUS_CLEAR_DATA 0x0010
111 #define PKGMGR_CLIENT_STATUS_INSTALL_PROGRESS 0x0020
112 #define PKGMGR_CLIENT_STATUS_GET_SIZE 0x0040
113 #define PKGMGR_CLIENT_STATUS_ENABLE_APP 0x0080
114 #define PKGMGR_CLIENT_STATUS_DISABLE_APP 0x0100
115 #define PKGMGR_CLIENT_STATUS_ENABLE_APP_SPLASH_SCREEN 0x0200
116 #define PKGMGR_CLIENT_STATUS_DISABLE_APP_SPLASH_SCREEN 0x0400
117 #define PKGMGR_CLIENT_STATUS_CLEAR_CACHE 0x0800
118 #define PKGMGR_CLIENT_STATUS_RES_COPY 0x1000
119 #define PKGMGR_CLIENT_STATUS_RES_CREATE_DIR 0x2000
120 #define PKGMGR_CLIENT_STATUS_RES_REMOVE 0x4000
121 #define PKGMGR_CLIENT_STATUS_RES_UNINSTALL 0x8000
125 #define PKG_SIZE_INFO_TOTAL "__TOTAL__"
126 #define PKG_CLEAR_ALL_CACHE "__ALL__"
128 * @brief Return values in pkgmgr.
130 typedef enum _pkgmgr_return_val {
131 PKGMGR_R_ESYSTEM = -9, /**< Severe system error */
132 PKGMGR_R_EIO = -8, /**< IO error */
133 PKGMGR_R_ENOMEM = -7, /**< Out of memory */
134 PKGMGR_R_ENOPKG = -6, /**< No such package */
135 PKGMGR_R_EPRIV = -5, /**< Privilege denied */
136 PKGMGR_R_ETIMEOUT = -4, /**< Timeout */
137 PKGMGR_R_EINVAL = -3, /**< Invalid argument */
138 PKGMGR_R_ECOMM = -2, /**< Comunication Error */
139 PKGMGR_R_ERROR = -1, /**< General error */
140 PKGMGR_R_OK = 0 /**< General success */
145 * @defgroup pkg_operate APIs to install /uninstall / activate application
148 * APIs to install /uninstall / activate application
149 * - Install application using application package filepath
150 * - Uninstall application using application package name
151 * - Activate application using application package name
157 * @addtogroup pkg_operate
161 typedef void pkgmgr_client;
162 typedef void pkgmgr_info;
163 typedef void pkgmgr_res_event_info;
167 long long cache_size;
169 long long ext_data_size;
170 long long ext_cache_size;
171 long long ext_app_size;
175 PM_UPDATEINFO_TYPE_NONE = 0,
176 PM_UPDATEINFO_TYPE_FORCE,
177 PM_UPDATEINFO_TYPE_OPTIONAL
178 } pkgmgr_updateinfo_type;
183 pkgmgr_updateinfo_type type;
186 typedef int (*pkgmgr_iter_fn)(const char *pkg_type, const char *pkgid,
187 const char *version, void *data);
189 typedef int (*pkgmgr_handler)(uid_t target_uid, int req_id, const char *pkg_type,
190 const char *pkgid, const char *key,
191 const char *val, const void *pmsg, void *data);
193 typedef int (*pkgmgr_app_handler)(uid_t target_uid, int req_id, const char *pkg_type,
194 const char *pkgid, const char *appid, const char *key,
195 const char *val, const void *pmsg, void *data);
197 typedef void (*pkgmgr_pkg_size_info_receive_cb)(pkgmgr_client *pc, const char *pkgid,
198 const pkg_size_info_t *size_info, void *user_data);
200 typedef void (*pkgmgr_total_pkg_size_info_receive_cb)(pkgmgr_client *pc,
201 const pkg_size_info_t *size_info, void *user_data);
203 typedef void (*pkgmgr_res_copy_handler)(uid_t target_uid, int req_id,
204 const char *pkgid, const char *request_type, const char *status,
205 pkgmgr_res_event_info *handle, void *user_data);
211 } pkgmgr_client_type;
219 PM_MOVE_TO_INTERNAL = 0,
220 PM_MOVE_TO_SDCARD = 1,
221 PM_MOVE_TO_EXTENDED = 2,
226 PM_REQUEST_GET_SIZE = 1,
227 PM_REQUEST_KILL_APP = 2,
228 PM_REQUEST_CHECK_APP = 3,
230 } pkgmgr_request_service_type;
233 /* sync, get data, total size for one requested pkgid */
234 PM_GET_TOTAL_SIZE = 0,
235 PM_GET_DATA_SIZE = 1,
237 /* async, get total used storage size */
240 /* async, get a pkgid's data, total size for all installed pkg */
241 PM_GET_SIZE_INFO = 3,
244 PM_GET_TOTAL_AND_DATA = 4,
245 PM_GET_SIZE_FILE = 5,
247 /* async, get data, cache, app size based on "pkg_size_info_t" */
248 PM_GET_PKG_SIZE_INFO = 6,
249 PM_GET_TOTAL_PKG_SIZE_INFO = 7,
251 } pkgmgr_getsize_type;
254 PM_RESTRICTION_MODE_ALL = 0x07,
255 PM_RESTRICTION_MODE_INSTALL = 0x01,
256 PM_RESTRICTION_MODE_UNINSTALL = 0x02,
257 PM_RESTRICTION_MODE_MOVE = 0x04,
258 } pkgmgr_restriction_mode;
261 * @brief This API creates pkgmgr client.
263 * This API is for package-manager client application.\n
265 * @param[in] ctype client type - PC_REQUEST, PC_LISTENING, PC_BROADCAST
266 * @return pkgmgr_client object
267 * @retval NULL on failure creating an object
269 pkgmgr_client *pkgmgr_client_new(pkgmgr_client_type ctype);
272 * @brief This API deletes pkgmgr client.
274 * This API is for package-manager client application.\n
276 * @param[in] pc pkgmgr_client
277 * @return Operation result;
278 * @retval PKGMGR_R_OK success
279 * @retval PKGMGR_R_EINVAL invalid argument
280 * @retval PKGMGR_R_ERROR internal error
282 int pkgmgr_client_free(pkgmgr_client *pc);
285 * @brief This API set information to install tep package.
286 * @details Use this API before calling installation API.
288 * This API is for package-manager client application.\n
290 * @param[in] pc pkgmgr_client
291 * @param[in] tep_path full path that tep file is located at
292 * @param[in] tep_move if TRUE, source file will be moved, else it will be copied
293 * @retval PKGMGR_R_OK success
294 * @retval PKGMGR_R_EINVAL invalid argument
296 int pkgmgr_client_set_tep_path(pkgmgr_client *pc, const char *tep_path, bool tep_move);
299 * @brief This API installs packages.
301 * This API is for package-manager client application.\n
303 * @param[in] pc pkgmgr_client
304 * @param[in] pkg_paths full paths that package file is located
305 * @param[in] n_pkgs number of packages
306 * @param[in] event_cb user callback
307 * @param[in] data user data
308 * @return request_id (>0) if success, error code(<0) if fail\n
309 * @retval PKGMGR_R_OK success
310 * @retval PKGMGR_R_EINVAL invalid argument
311 * @retval PKGMGR_R_ECOMM communication error
313 int pkgmgr_client_install_packages(pkgmgr_client *pc,
314 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
316 int pkgmgr_client_usr_install_packages(pkgmgr_client *pc,
317 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
318 void *data, uid_t uid);
321 * @brief This API installs package.
323 * This API is for package-manager client application.\n
325 * @param[in] pc pkgmgr_client
326 * @param[in] pkg_type package type
327 * @param[in] descriptor_path full path that descriptor is located
328 * @param[in] pkg_path full path that package file is located
329 * @param[in] optional_data optional data which is used for installation
330 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
331 * @param[in] event_cb user callback
332 * @param[in] data user data
333 * @return request_id (>0) if success, error code(<0) if fail\n
334 * @retval PKGMGR_R_OK success
335 * @retval PKGMGR_R_EINVAL invalid argument
336 * @retval PKGMGR_R_ECOMM communication error
338 int pkgmgr_client_install(pkgmgr_client *pc, const char *pkg_type,
339 const char *descriptor_path, const char *pkg_path,
340 const char *optional_data, pkgmgr_mode mode,
341 pkgmgr_handler event_cb, void *data);
342 int pkgmgr_client_usr_install(pkgmgr_client *pc, const char *pkg_type,
343 const char *descriptor_path, const char *pkg_path,
344 const char *optional_data, pkgmgr_mode mode,
345 pkgmgr_handler event_cb, void *data, uid_t uid);
348 * @brief This API reinstalls package.
350 * This API is for package-manager client application.\n
352 * @param[in] pc pkgmgr_client
353 * @param[in] pkg_type package type
354 * @param[in] pkg_path full path that package file is located
355 * @param[in] optional_data optional data which is used for installation
356 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
357 * @param[in] event_cb user callback
358 * @param[in] data user data
359 * @return request_id (>0) if success, error code(<0) if fail\n
360 * @retval PKGMGR_R_OK success
361 * @retval PKGMGR_R_EINVAL invalid argument
362 * @retval PKGMGR_R_ECOMM communication error
364 int pkgmgr_client_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
365 const char *optional_data, pkgmgr_mode mode,
366 pkgmgr_handler event_cb, void *data);
367 int pkgmgr_client_usr_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
368 const char *optional_data, pkgmgr_mode mode,
369 pkgmgr_handler event_cb, void *data, uid_t uid);
372 * @brief This API mount-installs packages.
374 * This API is for package-manager client application.\n
376 * @param[in] pc pkgmgr_client
377 * @param[in] pkg_paths full paths that package file is located
378 * @param[in] n_pkgs number of packages
379 * @param[in] event_cb user callback
380 * @param[in] data user data
381 * @return request_id (>0) if success, error code(<0) if fail\n
382 * @retval PKGMGR_R_OK success
383 * @retval PKGMGR_R_EINVAL invalid argument
384 * @retval PKGMGR_R_ECOMM communication error
386 int pkgmgr_client_mount_install_packages(pkgmgr_client *pc,
387 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
389 int pkgmgr_client_usr_mount_install_packages(pkgmgr_client *pc,
390 const char **pkg_paths, int n_pkgs, pkgmgr_handler event_cb,
391 void *data, uid_t uid);
394 * @brief This API mount-installs package.
396 * This API is for package-manager client application.\n
398 * @param[in] pc pkgmgr_client
399 * @param[in] pkg_type package type
400 * @param[in] descriptor_path full path that descriptor is located
401 * @param[in] pkg_path full path that package file is located
402 * @param[in] optional_data optional data which is used for installation
403 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
404 * @param[in] event_cb user callback
405 * @param[in] data user data
406 * @return request_id (>0) if success, error code(<0) if fail\n
407 * @retval PKGMGR_R_OK success
408 * @retval PKGMGR_R_EINVAL invalid argument
409 * @retval PKGMGR_R_ECOMM communication error
411 int pkgmgr_client_mount_install(pkgmgr_client *pc, const char *pkg_type,
412 const char *descriptor_path, const char *pkg_path,
413 const char *optional_data, pkgmgr_mode mode,
414 pkgmgr_handler event_cb, void *data);
415 int pkgmgr_client_usr_mount_install(pkgmgr_client *pc, const char *pkg_type,
416 const char *descriptor_path, const char *pkg_path,
417 const char *optional_data, pkgmgr_mode mode,
418 pkgmgr_handler event_cb, void *data, uid_t uid);
421 * @brief This API uninstalls packages.
423 * This API is for package-manager client application.\n
425 * @param[in] pc pkgmgr_client
426 * @param[in] pkgids package ids
427 * @param[in] n_pkgs number of packages
428 * @param[in] event_cb user callback
429 * @param[in] data user data
430 * @return request_id (>0) if success, error code(<0) if fail\n
431 * @retval PKGMGR_R_OK success
432 * @retval PKGMGR_R_EINVAL invalid argument
433 * @retval PKGMGR_R_ECOMM communication error
435 int pkgmgr_client_uninstall_packages(pkgmgr_client *pc,
436 const char **pkgids, int n_pkgs, pkgmgr_handler event_cb,
438 int pkgmgr_client_usr_uninstall_packages(pkgmgr_client *pc,
439 const char **pkgids, int n_pkgs, pkgmgr_handler event_cb,
440 void *data, uid_t uid);
443 * @brief This API uninstalls package.
445 * This API is for package-manager client application.\n
447 * @param[in] pc pkgmgr_client
448 * @param[in] pkg_type package type
449 * @param[in] pkgid package id
450 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
451 * @param[in] event_cb user callback
452 * @param[in] data user data
453 * @param[in] uid the addressee user id of the instruction
454 * @return request_id (>0), error code(<0) if fail\n
455 * @retval PKGMGR_R_OK success
456 * @retval PKGMGR_R_EINVAL invalid argument
457 * @retval PKGMGR_R_ECOMM communication error
459 int pkgmgr_client_uninstall(pkgmgr_client *pc, const char *pkg_type,
460 const char *pkgid, pkgmgr_mode mode,
461 pkgmgr_handler event_cb, void *data);
462 int pkgmgr_client_usr_uninstall(pkgmgr_client *pc, const char *pkg_type,
463 const char *pkgid, pkgmgr_mode mode,
464 pkgmgr_handler event_cb, void *data, uid_t uid);
467 * @brief This API moves installed package to SD card or vice versa.
469 * This API is for package-manager client application.\n
471 * @param[in] pc pkgmgr_client
472 * @param[in] pkg_type package type
473 * @param[in] pkgid application package id
474 * @param[in] move_type move type
475 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
476 * @param[in] event_cb user callback
477 * @param[in] data user data
478 * @param[in] uid the addressee user id of the instruction
479 * @retval PKGMGR_R_OK success
480 * @retval PKGMGR_R_EINVAL invalid argument
481 * @retval PKGMGR_R_ERROR general error
483 int pkgmgr_client_move(pkgmgr_client *pc, const char *pkg_type,
484 const char *pkgid, pkgmgr_move_type move_type,
485 pkgmgr_handler event_cb, void *data);
486 int pkgmgr_client_usr_move(pkgmgr_client *pc, const char *pkg_type,
487 const char *pkgid, pkgmgr_move_type move_type,
488 pkgmgr_handler event_cb, void *data, uid_t uid);
491 * @brief This API registers the update information of given packages
493 * This API is for package-manager client application.\n
495 * @param[in] pc pkgmgr_client
496 * @param[in] update_info update information
497 * @param[in] uid the addressee user id of the instruction
498 * @retval PKGMGR_R_OK success
499 * @retval PKGMGR_R_EINVAL invalid argument
500 * @retval PKGMGR_R_ERROR general error
502 int pkgmgr_client_register_pkg_update_info(pkgmgr_client *pc,
503 pkg_update_info_t *update_info);
504 int pkgmgr_client_usr_register_pkg_update_info(pkgmgr_client *pc,
505 pkg_update_info_t *update_info, uid_t uid);
508 * @brief This API unregisters update information of certain package.
510 * This API is for package-manager client application.\n
512 * @param[in] pc pkgmgr_client
513 * @param[in] pkgid package id
514 * @param[in] uid the addressee user id of the instruction
515 * @retval PKGMGR_R_OK success
516 * @retval PKGMGR_R_EINVAL invalid argument
517 * @retval PKGMGR_R_ERROR general error
519 int pkgmgr_client_unregister_pkg_update_info(pkgmgr_client *pc, const char *pkgid);
520 int pkgmgr_client_usr_unregister_pkg_update_info(pkgmgr_client *pc,
521 const char *pkgid, uid_t uid);
524 * @brief This API unregister update information of all packages.
526 * This API is for package-manager client application.\n
528 * @param[in] pc pkgmgr_client
529 * @param[in] uid the addressee user id of the instruction
530 * @retval PKGMGR_R_OK success
531 * @retval PKGMGR_R_EINVAL invalid argument
532 * @retval PKGMGR_R_ERROR general error
534 int pkgmgr_client_unregister_all_pkg_update_info(pkgmgr_client *pc);
535 int pkgmgr_client_usr_unregister_all_pkg_update_info(pkgmgr_client *pc,
539 * @brief This API activates package.
541 * This API is for package-manager client application.\n
543 * @param[in] pc pkgmgr_client
544 * @param[in] pkg_type package type
545 * @param[in] pkgid package id
546 * @return request_id (>0) if success, error code(<0) if fail\n
547 * @retval PKGMGR_R_OK success
548 * @retval PKGMGR_R_EINVAL invalid argument
549 * @retval PKGMGR_R_ECOMM communication error
551 int pkgmgr_client_activate(pkgmgr_client *pc, const char *pkg_type,
553 int pkgmgr_client_usr_activate(pkgmgr_client *pc, const char *pkg_type,
554 const char *pkgid, uid_t uid);
557 * @brief This API activates multiple packages.
559 * This API is for package-manager client application.\n
561 * @param[in] pc pkgmgr_client
562 * @param[in] pkg_type package type
563 * @param[in] pkgids array of package ids
564 * @param[in] n_pkgs size of array
565 * @param[in] event_cb user callback
566 * @param[in] data user data
567 * @return request_id (>0) if success, error code(<0) if fail\n
568 * @retval PKGMGR_R_OK success
569 * @retval PKGMGR_R_EINVAL invalid argument
570 * @retval PKGMGR_R_ECOMM communication error
572 int pkgmgr_client_activate_packages(pkgmgr_client *pc, const char *pkg_type,
573 const char **pkgids, int n_pkgs,
574 pkgmgr_handler event_cb, void *data);
575 int pkgmgr_client_usr_activate_packages(pkgmgr_client *pc, const char *pkg_type,
576 const char **pkgids, int n_pkgs,
577 pkgmgr_handler event_cb, void *data, uid_t uid);
580 * @brief This API deactivates package.
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] pkgid package id
587 * @return request_id (>0) if success, error code(<0) if fail\n
588 * @retval PKGMGR_R_OK success
589 * @retval PKGMGR_R_EINVAL invalid argument
590 * @retval PKGMGR_R_ECOMM communication error
592 int pkgmgr_client_deactivate(pkgmgr_client *pc, const char *pkg_type,
594 int pkgmgr_client_usr_deactivate(pkgmgr_client *pc, const char *pkg_type,
595 const char *pkgid, uid_t uid);
598 * @brief This API deactivates multiple packages.
600 * This API is for package-manager client application.\n
602 * @param[in] pc pkgmgr_client
603 * @param[in] pkg_type package type
604 * @param[in] pkgids array of package ids
605 * @param[in] n_pkgs size of array
606 * @param[in] event_cb user callback
607 * @param[in] data user data
608 * @return request_id (>0) if success, error code(<0) if fail\n
609 * @retval PKGMGR_R_OK success
610 * @retval PKGMGR_R_EINVAL invalid argument
611 * @retval PKGMGR_R_ECOMM communication error
613 int pkgmgr_client_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
614 const char **pkgids, int n_pkgs,
615 pkgmgr_handler event_cb, void *data);
616 int pkgmgr_client_usr_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
617 const char **pkgids, int n_pkgs,
618 pkgmgr_handler event_cb, void *data, uid_t uid);
621 * @brief This API deactivates app.
623 * This API is for package-manager client application.\n
625 * @param[in] pc pkgmgr_client
626 * @param[in] appid applicaiton id
627 * @param[in] app_event_cb user callback
628 * @param[in] data user data
629 * @return request_id (>0) if success, error code(<0) if fail\n
630 * @retval PKGMGR_R_OK success
631 * @retval PKGMGR_R_EINVAL invalid argument
632 * @retval PKGMGR_R_ECOMM communication error
634 int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
635 int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
638 * @brief This API activates multiple apps.
640 * This API is for package-manager client application.\n
642 * @param[in] pc pkgmgr_client
643 * @param[in] appids array of application ids
644 * @param[in] n_apps size of array
645 * @param[in] app_event_cb user callback
646 * @param[in] data user data
647 * @return request_id (>0) if success, error code(<0) if fail\n
648 * @retval PKGMGR_R_OK success
649 * @retval PKGMGR_R_EINVAL invalid argument
650 * @retval PKGMGR_R_ECOMM communication error
652 int pkgmgr_client_activate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
653 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);
656 * @brief This API deactivates multiple apps.
658 * This API is for package-manager client application.\n
660 * @param[in] pc pkgmgr_client
661 * @param[in] appids array of application ids
662 * @param[in] n_apps size of array
663 * @param[in] app_event_cb user callback
664 * @param[in] data user data
665 * @return request_id (>0) if success, error code(<0) if fail\n
666 * @retval PKGMGR_R_OK success
667 * @retval PKGMGR_R_EINVAL invalid argument
668 * @retval PKGMGR_R_ECOMM communication error
670 int pkgmgr_client_deactivate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
671 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);
674 * @brief This API deactivates global app for user specified by uid.
676 * This API is for package-manager client application.\n
678 * @param[in] pc pkgmgr_client
679 * @param[in] appid applicaiton id
680 * @param[in] app_event_cb user callback
681 * @param[in] uid user id
682 * @param[in] data user data
683 * @return request_id (>0) if success, error code(<0) if fail\n
684 * @retval PKGMGR_R_OK success
685 * @retval PKGMGR_R_EINVAL invalid argument
686 * @retval PKGMGR_R_ECOMM communication error
688 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);
691 * @brief This API activates app.
693 * This API is for package-manager client application.\n
695 * @param[in] pc pkgmgr_client
696 * @param[in] appid applicaiton id
697 * @param[in] app_event_cb user callback
698 * @param[in] uid user id
699 * @param[in] data user data
700 * @return request_id (>0) if success, error code(<0) if fail\n
701 * @retval PKGMGR_R_OK success
702 * @retval PKGMGR_R_EINVAL invalid argument
703 * @retval PKGMGR_R_ECOMM communication error
705 int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
706 int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
709 * @brief This API activates global app for user specified by uid.
711 * This API is for package-manager client application.\n
713 * @param[in] pc pkgmgr_client
714 * @param[in] appid applicaiton id
715 * @param[in] app_event_cb user callback
716 * @param[in] uid user id
717 * @param[in] data user data
718 * @return request_id (>0) if success, error code(<0) if fail\n
719 * @retval PKGMGR_R_OK success
720 * @retval PKGMGR_R_EINVAL invalid argument
721 * @retval PKGMGR_R_ECOMM communication error
723 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);
726 * @brief This API deletes application's private data.
728 * This API is for package-manager client application.\n
730 * @remarks You should call this function with regular uid
731 * @param[in] pc pkgmgr_client
732 * @param[in] pkg_type package type
733 * @param[in] pkgid package id
734 * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
735 * @return request_id (>0) if success, error code(<0) if fail\n
736 * @retval PKGMGR_R_OK success
737 * @retval PKGMGR_R_EINVAL invalid argument
738 * @retval PKGMGR_R_ECOMM communication error
740 int pkgmgr_client_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
741 const char *pkgid, pkgmgr_mode mode);
742 int pkgmgr_client_usr_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
743 const char *pkgid, pkgmgr_mode mode, uid_t uid);
745 * @brief This API set status type to listen for the pkgmgr's broadcasting
747 * This API is for package-manager client application.\n
749 * @param[in] pc pkgmgr_client
750 * @param[in] status_type status type to listen
751 * @return request_id (>0) if success, error code(<0) if fail\n
752 * @retval PKGMGR_R_OK success
753 * @retval PKGMGR_R_EINVAL invalid argument
755 int pkgmgr_client_set_status_type(pkgmgr_client *pc, int status_type);
758 * @brief This API request to listen the pkgmgr's broadcasting
760 * This API is for package-manager client application.\n
762 * @param[in] pc pkgmgr_client
763 * @param[in] event_cb user callback
764 * @param[in] data user data
765 * @return request_id (>0) if success, error code(<0) if fail\n
766 * @retval PKGMGR_R_OK success
767 * @retval PKGMGR_R_EINVAL invalid argument
769 int pkgmgr_client_listen_status(pkgmgr_client *pc, pkgmgr_handler event_cb,
773 * @brief This API request to listen the pkgmgr's broadcasting about apps
775 * This API is for package-manager client application.\n
777 * @param[in] pc pkgmgr_client
778 * @param[in] event_cb user callback
779 * @param[in] data user data
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
784 int pkgmgr_client_listen_app_status(pkgmgr_client *pc, pkgmgr_app_handler event_cb,
788 * @brief This API request to listen the pkgmgr's broadcasting about resource copy
790 * This API is for package-manager client application.\n
792 * @param[in] pc pkgmgr_client
793 * @param[in] event_cb user callback
794 * @param[in] data user data
795 * @return request_id (>0) if success, error code(<0) if fail\n
796 * @retval PKGMGR_R_OK success
797 * @retval PKGMGR_R_EINVAL invalid argument
798 * @retval PKGMGR_R_ENOMEM out of memory
800 int pkgmgr_client_listen_res_copy_status(pkgmgr_client *pc,
801 pkgmgr_res_copy_handler event_cb, void *data);
804 * @brief This API request to stop listen the pkgmgr's broadcasting
806 * This API is for package-manager client application.\n
808 * @param[in] pc pkgmgr_client
809 * @return 0 if success, error code(<0) if fail\n
810 * @retval PKGMGR_R_OK success
811 * @retval PKGMGR_R_EINVAL invalid argument
812 * @retval PKGMGR_R_ERROR internal error
814 int pkgmgr_client_remove_listen_status(pkgmgr_client *pc);
817 * @brief This API broadcasts pkgmgr's status
819 * This API is for package-manager client application.\n
821 * @param[in] pc pkgmgr_client
822 * @param[in] pkg_type package type
823 * @param[in] pkgid package id
824 * @param[in] key key to broadcast
825 * @param[in] val value to broadcast
826 * @return 0 if success, error code(<0) if fail\n
827 * @retval PKGMGR_R_OK success
828 * @retval PKGMGR_R_EINVAL invalid argument
830 int pkgmgr_client_broadcast_status(pkgmgr_client *pc, const char *pkg_type,
831 const char *pkgid, const char *key,
835 * @brief This API gets the package's information.
837 * This API is for package-manager client application.\n
839 * @param[in] pkg_path package file path to get infomation
840 * @return package entry pointer if success, NULL if fail\n
842 pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path);
845 * @brief This API get package information value
847 * This API is for package-manager client application.\n
849 * @param[in] pkg_info pointer for package info entry
850 * @return 0 if success, error code(<0) if fail\n
852 int pkgmgr_client_free_pkginfo(pkgmgr_info *pkg_info);
855 * @brief This API requests service
857 * This API is for package-manager client application.\n
859 * @param[in] service_type pkgmgr_request_service_type
860 * @param[in] service_mode mode which is used for addtional mode selection
861 * @param[in] pc pkgmgr_client
862 * @param[in] pkg_type package type
863 * @param[in] pkgid package id
864 * @param[in] custom_info custom information which is used for addtional information
865 * @param[in] event_cb user callback
866 * @param[in] data user data
867 * @return request_id (>0) if success, error code(<0) if fail\n
868 * @retval PKGMGR_R_OK success
869 * @retval PKGMGR_R_EINVAL invalid argument
870 * @retval PKGMGR_R_ECOMM communication error
872 int pkgmgr_client_request_service(pkgmgr_request_service_type service_type, int service_mode,
873 pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
874 const char *custom_info, pkgmgr_handler event_cb, void *data);
875 int pkgmgr_client_usr_request_service(pkgmgr_request_service_type service_type, int service_mode,
876 pkgmgr_client *pc, const char *pkg_type, const char *pkgid, uid_t uid,
877 const char *custom_info, pkgmgr_handler event_cb, void *data);
879 * @brief This API get package size
881 * This API is for package-manager client application.\n
883 * @param[in] pc pkgmgr_client
884 * @param[in] pkgid package id
885 * @param[in] get_type type for pkgmgr client request to get package size
886 * @param[in] event_cb user callback
887 * @param[in] data user data
888 * @return request_id (>0) if success, error code(<0) if fail\n
889 * @retval PKGMGR_R_OK success
890 * @retval PKGMGR_R_EINVAL invalid argument
891 * @retval PKGMGR_R_ECOMM communication error
893 int pkgmgr_client_get_size(pkgmgr_client *pc, const char *pkgid, pkgmgr_getsize_type get_type, pkgmgr_handler event_cb, void *data);
894 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);
897 * @brief Gets the package size information.
898 * @details The package size info is asynchronously obtained by the specified callback function.
900 * @param[in] pc The pointer to pkgmgr_client instance
901 * @param[in] pkgid The package ID
902 * @param[in] result_cb The asynchronous callback function to get the package size information
903 * @param[in] user_data User data to be passed to the callback function
905 * @return 0 on success, otherwise a negative error value
906 * @retval #PKGMGR_R_OK Successful
907 * @retval #PKGMGR_R_EINVAL Invalid parameter
908 * @retval #PKGMGR_R_ERROR Internal error
910 int pkgmgr_client_get_package_size_info(pkgmgr_client *pc, const char *pkgid, pkgmgr_pkg_size_info_receive_cb result_cb, void *user_data);
911 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);
914 * @brief Gets the sum of the entire package size information.
915 * @details The package size info is asynchronously obtained by the specified callback function.
917 * @param[in] pc The pointer to pkgmgr_client instance
918 * @param[in] result_cb The asynchronous callback function to get the total package size information
919 * @param[in] user_data User data to be passed to the callback function
921 * @return 0 on success, otherwise a negative error value
922 * @retval #PKGMGR_R_OK Successful
923 * @retval #PKGMGR_R_EINVAL Invalid parameter
924 * @retval #PKGMGR_R_ERROR Internal error
926 int pkgmgr_client_get_total_package_size_info(pkgmgr_client *pc, pkgmgr_total_pkg_size_info_receive_cb result_cb, void *user_data);
927 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);
930 * @brief This API removes cache directories
932 * This API is for package-manager client application.\n
934 * @remarks You should call this function with regular uid
935 * @param[in] pkgid package id
936 * @return 0 if success, error code(<0) if fail\n
937 * @retval PKGMGR_R_OK success
938 * @retval PKGMGR_R_EINVAL invalid argument
939 * @retval PKGMGR_R_EPRIV privilege denied
940 * @retval PKGMGR_R_ERROR internal error
942 int pkgmgr_client_clear_cache_dir(const char *pkgid);
943 int pkgmgr_client_usr_clear_cache_dir(const char *pkgid, uid_t uid);
946 * @brief This API removes all cache directories
948 * This API is for package-manager client application.\n
950 * @remarks You should call this function with regular uid
951 * @return 0 if success, error code(<0) if fail\n
952 * @retval PKGMGR_R_OK success
953 * @retval PKGMGR_R_EINVAL invalid argument
954 * @retval PKGMGR_R_EPRIV privilege denied
955 * @retval PKGMGR_R_ERROR internal error
957 int pkgmgr_client_clear_all_cache_dir(void);
958 int pkgmgr_client_usr_clear_all_cache_dir(uid_t uid);
961 * @brief Generates request for getting license
963 * This API generates request for getting license.\n
965 * @remarks You must release @a req_data and @a license_url by yourself.
966 * @param[in] pc The pointer to pkgmgr_client instance
967 * @param[in] resp_data The response data string of the purchase request
968 * @param[out] req_data License request data
969 * @param[out] license_url License acquisition url data
970 * @return 0 if success, error code(<0) if fail\n
971 * @retval PKGMGR_R_OK success
972 * @retval PKGMGR_R_EINVAL invalid argument
973 * @retval PKGMGR_R_ECOMM communication error
974 * @retval PKGMGR_R_EPRIV privilege denied
975 * @retval PKGMGR_R_ESYSTEM severe system error
977 int pkgmgr_client_generate_license_request(pkgmgr_client *pc, const char *resp_data, char **req_data, char **license_url);
980 * @brief Registers encrypted license
982 * This API registers encrypted license.\n
984 * @param[in] pc The pointer to pkgmgr_client instance
985 * @param[in] resp_data The response data string of the purchase request
986 * @return 0 if success, error code(<0) if fail\n
987 * @retval PKGMGR_R_OK success
988 * @retval PKGMGR_R_EINVAL invalid argument
989 * @retval PKGMGR_R_ECOMM communication error
990 * @retval PKGMGR_R_EPRIV privilege denied
991 * @retval PKGMGR_R_ESYSTEM severe system error
993 int pkgmgr_client_register_license(pkgmgr_client *pc, const char *resp_data);
996 * @brief Decrypts contents which is encrypted
998 * This API decrypts contents which is encrypted.\n
1000 * @param[in] pc The pointer to pkgmgr_client instance
1001 * @param[in] drm_file_path The pointer to pkgmgr_client instance
1002 * @param[in] decrypted_file_path The pointer to pkgmgr_client instance
1003 * @return 0 if success, error code(<0) if fail\n
1004 * @retval PKGMGR_R_OK success
1005 * @retval PKGMGR_R_EINVAL invalid argument
1006 * @retval PKGMGR_R_ECOMM communication error
1007 * @retval PKGMGR_R_EPRIV privilege denied
1008 * @retval PKGMGR_R_ESYSTEM severe system error
1010 int pkgmgr_client_decrypt_package(pkgmgr_client *pc, const char *drm_file_path, const char *decrypted_file_path);
1013 * @brief This API is enabled the splash screen
1015 * This API is for package-manager client application.\n
1017 * @param[in] pc pkgmgr_client
1018 * @param[in] appid applicaiton id
1019 * @return request_id (>0) if success, error code(<0) if fail\n
1020 * @retval PKGMGR_R_OK success
1021 * @retval PKGMGR_R_EINVAL invalid argument
1022 * @retval PKGMGR_R_ECOMM communication error
1023 * @retval PKGMGR_R_ENOMEM out of memory
1025 int pkgmgr_client_enable_splash_screen(pkgmgr_client *pc, const char *appid);
1026 int pkgmgr_client_usr_enable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
1029 * @brief This API is disabled the splash screen
1031 * This API is for package-manager client application.\n
1033 * @param[in] pc pkgmgr_client
1034 * @param[in] appid applicaiton id
1035 * @return request_id (>0) if success, error code(<0) if fail\n
1036 * @retval PKGMGR_R_OK success
1037 * @retval PKGMGR_R_EINVAL invalid argument
1038 * @retval PKGMGR_R_ECOMM communication error
1039 * @retval PKGMGR_R_ENOMEM out of memory
1041 int pkgmgr_client_disable_splash_screen(pkgmgr_client *pc, const char *appid);
1042 int pkgmgr_client_usr_disable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
1045 * @brief Set restriction mode
1047 * This API set restriction mode bit.\n
1049 * @param[in] pc The pointer to pkgmgr_client instance
1050 * @param[in] mode restriction mode bit
1051 * @return 0 if success, error code(<0) if fail\n
1052 * @retval PKGMGR_R_OK success
1053 * @retval PKGMGR_R_EINVAL invalid argument
1054 * @retval PKGMGR_R_ECOMM communication error
1055 * @retval PKGMGR_R_EPRIV privilege denied
1056 * @see pkgmgr_restriction_mode
1058 int pkgmgr_client_set_restriction_mode(pkgmgr_client *pc, int mode);
1059 int pkgmgr_client_usr_set_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
1062 * @brief Unset restriction mode
1064 * This API unset restriction mode bit.\n
1066 * @param[in] pc The pointer to pkgmgr_client instance
1067 * @param[in] mode restriction mode bit
1068 * @return 0 if success, error code(<0) if fail\n
1069 * @retval PKGMGR_R_OK success
1070 * @retval PKGMGR_R_EINVAL invalid argument
1071 * @retval PKGMGR_R_ECOMM communication error
1072 * @retval PKGMGR_R_EPRIV privilege denied
1073 * @see pkgmgr_restriction_mode
1075 int pkgmgr_client_unset_restriction_mode(pkgmgr_client *pc, int mode);
1076 int pkgmgr_client_usr_unset_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
1079 * @brief Get restriction mode
1081 * This API gets restriction mode bit.\n
1083 * @param[in] pc The pointer to pkgmgr_client instance
1084 * @param[out] mode restriction mode bit
1085 * @return 0 if success, error code(<0) if fail\n
1086 * @retval PKGMGR_R_OK success
1087 * @retval PKGMGR_R_EINVAL invalid argument
1088 * @retval PKGMGR_R_ECOMM communication error
1089 * @retval PKGMGR_R_EPRIV privilege denied
1090 * @see pkgmgr_restriction_mode
1092 int pkgmgr_client_get_restriction_mode(pkgmgr_client *pc, int *mode);
1093 int pkgmgr_client_usr_get_restriction_mode(pkgmgr_client *pc, int *mode, uid_t uid);
1096 * @brief Set restriction mode bit for package specified.
1097 * @details You can combine multiple status using OR operation which you want to restrict.
1099 * This API sets restriction bit for pkg operation to not allow user to do it.\n
1101 * @param[in] pc The pointer to pkgmgr_client instance
1102 * @param[in] pkgid pkgid to be restricted
1103 * @param[in] mode restriction mode bit
1104 * @return 0 if success, error code(<0) if fail\n
1105 * @retval PKGMGR_R_OK success
1106 * @retval PKGMGR_R_EINVAL invalid argument
1107 * @retval PKGMGR_R_ECOMM communication error
1108 * @retval PKGMGR_R_EPRIV privilege denied
1109 * @see pkgmgr_restriction_mode
1111 int pkgmgr_client_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1112 int pkgmgr_client_usr_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1115 * @brief Unset restriction mode bit for package specified
1116 * @details You can combine multiple status using OR operation which you want to unset
1118 * This API unsets restriction bit to remove restriction of pkg operation.
1120 * @param[in] pc The pointer to pkgmgr_client instance
1121 * @param[in] pkgid pkg id to be remove in restriction.
1122 * @param[in] mode restriction mode bit
1123 * @return 0 if success, error code(<0) if fail\n
1124 * @retval PKGMGR_R_OK success
1125 * @retval PKGMGR_R_EINVAL invalid argument
1126 * @retval PKGMGR_R_ECOMM communication error
1127 * @retval PKGMGR_R_EPRIV privilege denied
1128 * @see pkgmgr_restriction_mode
1130 int pkgmgr_client_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1131 int pkgmgr_client_usr_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1134 * @brief Get restriction bit of package operation
1136 * This API gets restriction bit for restricted package operation.\n
1138 * @param[in] pc The pointer to pkgmgr_client instance
1139 * @param[in] pkgid pkg id to be remove in restriction.
1140 * @param[out] mode restriction mode bit
1141 * @return 0 if success, error code(<0) if fail\n
1142 * @retval PKGMGR_R_OK success
1143 * @retval PKGMGR_R_EINVAL invalid argument
1144 * @retval PKGMGR_R_ECOMM communication error
1145 * @retval PKGMGR_R_EPRIV privilege denied
1146 * @see pkgmgr_restriction_mode
1148 int pkgmgr_client_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode);
1149 int pkgmgr_client_usr_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode, uid_t uid);
1152 * @brief Change application's label
1154 * This API sets label of application specified.\n
1156 * @param[in] pc The pointer to pkgmgr_client instance
1157 * @param[in] appid app id to be changed.
1158 * @param[in] label application's label to change.
1159 * @param[out] mode restriction mode bit
1160 * @return 0 if success, error code(<0) if fail\n
1161 * @retval PKGMGR_R_OK success
1162 * @retval PKGMGR_R_EINVAL invalid argument
1163 * @retval PKGMGR_R_ECOMM communication error
1165 int pkgmgr_client_set_app_label(pkgmgr_client *pc, char *appid, char *label);
1166 int pkgmgr_client_usr_set_app_label(pkgmgr_client *pc, char *appid, char *label, uid_t uid);
1169 * @brief Change application's icon
1171 * This API sets icon of application specified.\n
1173 * @param[in] pc The pointer to pkgmgr_client instance
1174 * @param[in] appid app id to be changed.
1175 * @param[in] icon_path application's icon path to change.
1176 * @return 0 if success, error code(<0) if fail\n
1177 * @retval PKGMGR_R_OK success
1178 * @retval PKGMGR_R_EINVAL invalid argument
1179 * @retval PKGMGR_R_ECOMM communication error
1181 int pkgmgr_client_set_app_icon(pkgmgr_client *pc, char *appid, char *icon_path);
1182 int pkgmgr_client_usr_set_app_icon(pkgmgr_client *pc, char *appid, char *icon_path, uid_t uid);
1185 * @brief Set debug mode
1187 * This API sets debug mode value for request.\n
1189 * @param[in] pc The pointer to pkgmgr_client instance
1190 * @param[in] debug_mode indicates the request is debug mode or not
1191 * @return 0 if success, error code(<0) if fail\n
1192 * @retval PKGMGR_R_OK success
1193 * @retval PKGMGR_R_EINVAL invalid argument
1195 int pkgmgr_client_set_debug_mode(pkgmgr_client *pc, bool debug_mode);
1198 * @brief Set skip optimization
1200 * This API sets skip optimization value for request.\n
1202 * @param[in] pc The pointer to pkgmgr_client instance
1203 * @param[in] skip_optimization indicates the request is skip optimization or not
1204 * @return 0 if success, error code(<0) if fail\n
1205 * @retval PKGMGR_R_OK success
1206 * @retval PKGMGR_R_EINVAL invalid argument
1208 int pkgmgr_client_set_skip_optimization(pkgmgr_client *pc, bool skip_optimization);
1211 * @brief Migrate legacy external image which is generated under 3.0
1213 * This API request the migration of external image.\n
1215 * @param[in] pc The pointer to pkgmgr_client instance
1216 * @param[in] pkgid pkg id which have legacy image
1217 * @return 0 if success, error code(<0) if fail\n
1218 * @retval PKGMGR_R_OK success
1219 * @retval PKGMGR_R_EINVAL invalid argument
1221 int pkgmgr_client_usr_migrate_external_image(pkgmgr_client *pc, const char *pkgid, uid_t uid);
1224 * @brief Add resource path to copy
1226 * This API adds path for resource copy request.\n
1228 * @param[in] pc The pointer to pkgmgr_client instance
1229 * @param[in] src_path Path of a resource that client want to copy
1230 * @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
1231 * @return 0 if success, error code(<0) if fail\n
1232 * @retval PKGMGR_R_OK success
1233 * @retval PKGMGR_R_EINVAL invalid argument
1234 * @retval PKGMGR_R_ENOMEM out of memory
1236 int pkgmgr_client_add_res_copy_path(pkgmgr_client *pc, const char *src_path, const char *dest_path);
1239 * @brief This API copy resources.
1241 * This API is for package-manager client application.\n
1243 * @param[in] pc pkgmgr_client
1244 * @param[in] event_cb user callback
1245 * @param[in] data user data
1246 * @return request_id (>0) if success, error code(<0) if fail\n
1247 * @retval PKGMGR_R_OK success
1248 * @retval PKGMGR_R_ECOMM communication error
1249 * @retval PKGMGR_R_EINVAL invalid argument
1250 * @retval PKGMGR_R_ENOMEM out of memory
1251 * @retval PKGMGR_R_EPRIV privilege denied
1253 int pkgmgr_client_res_copy(pkgmgr_client *pc, pkgmgr_res_copy_handler event_cb, void *user_data);
1256 * @brief Add directory path to create in the resource sharing directory of the package
1258 * This API adds directory path for resource create directory request.\n
1260 * @param[in] pc The pointer to pkgmgr_client instance
1261 * @param[in] dir_path Path of a directory that client want to create
1262 * @return 0 if success, error code(<0) if fail\n
1263 * @retval PKGMGR_R_OK success
1264 * @retval PKGMGR_R_EINVAL invalid argument
1265 * @retval PKGMGR_R_ENOMEM out of memory
1267 int pkgmgr_client_add_res_create_dir_path(pkgmgr_client *pc, const char *dir_path);
1270 * @brief This API create directories in the resource sharing directory of the package
1272 * This API is for package-manager client application.\n
1274 * @param[in] pc pkgmgr_client
1275 * @param[in] event_cb user callback
1276 * @param[in] data user data
1277 * @return request_id (>0) if success, error code(<0) if fail\n
1278 * @retval PKGMGR_R_OK success
1279 * @retval PKGMGR_R_ECOMM communication error
1280 * @retval PKGMGR_R_EINVAL invalid argument
1281 * @retval PKGMGR_R_ENOMEM out of memory
1282 * @retval PKGMGR_R_EPRIV privilege denied
1284 int pkgmgr_client_res_create_dir(pkgmgr_client *pc, pkgmgr_res_copy_handler event_cb, void *user_data);
1287 * @brief Add resource path to remove
1289 * This API adds path for resource remove request.\n
1291 * @param[in] pc The pointer to pkgmgr_client instance
1292 * @param[in] res_path Path of a copied resource that client want to remove
1293 * @return 0 if success, error code(<0) if fail\n
1294 * @retval PKGMGR_R_OK success
1295 * @retval PKGMGR_R_EINVAL invalid argument
1296 * @retval PKGMGR_R_ENOMEM out of memory
1298 int pkgmgr_client_add_res_remove_path(pkgmgr_client *pc, const char *res_path);
1301 * @brief This API removes resources.
1303 * This API is for package-manager client application.\n
1305 * @param[in] pc pkgmgr_client
1306 * @param[in] event_cb user callback
1307 * @param[in] data user data
1308 * @return request_id (>0) if success, error code(<0) if fail\n
1309 * @retval PKGMGR_R_OK success
1310 * @retval PKGMGR_R_ECOMM communication error
1311 * @retval PKGMGR_R_EINVAL invalid argument
1312 * @retval PKGMGR_R_ENOMEM out of memory
1313 * @retval PKGMGR_R_EPRIV privilege denied
1315 int pkgmgr_client_res_remove(pkgmgr_client *pc, pkgmgr_res_copy_handler event_cb, void *user_data);
1318 * @brief This API uninstall copied resources of the package.
1320 * This API is for package-manager client application.\n
1322 * @param[in] pc pkgmgr_client
1323 * @param[in] pkgid package id
1324 * @param[in] event_cb user callback
1325 * @param[in] user_data user data
1326 * @return request_id (>0) if success, error code(<0) if fail\n
1327 * @retval PKGMGR_R_OK success
1328 * @retval PKGMGR_R_ECOMM communication error
1329 * @retval PKGMGR_R_EINVAL invalid argument
1330 * @retval PKGMGR_R_ENOMEM out of memory
1331 * @retval PKGMGR_R_EPRIV privilege denied
1333 int pkgmgr_client_res_uninstall(pkgmgr_client *pc, const char *pkgid, pkgmgr_res_copy_handler event_cb, void *user_data);
1334 int pkgmgr_client_res_usr_uninstall(pkgmgr_client *pc, const char *pkgid, pkgmgr_res_copy_handler event_cb, void *user_data, uid_t uid);
1337 * @brief This API creates resource event info.
1339 * This API is for package-manager client application.\n
1341 * @return resource event info object
1342 * @retval NULL on failure creating an object
1344 pkgmgr_res_event_info *pkgmgr_res_event_info_new();
1347 * @brief This API delete resource event info.
1349 * This API is for package-manager client application.\n
1351 * @param[in] info resource event info
1352 * @return Operation result;
1353 * @retval PKGMGR_R_OK success
1354 * @retval PKGMGR_R_EINVAL invalid argument
1355 * @retval PKGMGR_R_ERROR internal error
1357 int pkgmgr_res_event_info_free(pkgmgr_res_event_info *info);
1360 * @brief This API gets the error code from resource callback handle
1362 * This API is for package-manager client application.\n
1364 * @param[in] handle resource event information handle
1365 * @param[in] error_code error code about resource event
1366 * @retval PKGMGR_R_OK success
1367 * @retval PKGMGR_R_EINVAL invalid argument
1369 int pkgmgr_res_event_info_set_error_code(pkgmgr_res_event_info *handle, int error_code);
1372 * @brief This API gets the error code from resource callback handle
1374 * This API is for package-manager client application.\n
1376 * @param[in] handle resource event information handle
1377 * @param[out] error_code error code about resource event
1378 * @retval PKGMGR_R_OK success
1379 * @retval PKGMGR_R_EINVAL invalid argument
1381 int pkgmgr_res_event_info_get_error_code(pkgmgr_res_event_info *handle, int *error_code);
1389 #endif /* __PKG_MANAGER_H__ */