52a486a4fcebdb93ba1383991c9854cb4b81dc8b
[platform/core/appfw/slp-pkgmgr.git] / client / include / package-manager.h
1 /*
2  * slp-pkgmgr
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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>
8  *
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
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  */
22
23
24
25
26
27
28
29
30
31 /**
32  * @file                package-manager.h
33  * @author              Sewook Park <sewook7.park@samsung.com>
34  * @version             0.1
35  * @brief               This file declares API of slp-pkgmgr library
36  *
37  * @addtogroup APPLICATION_FRAMEWORK
38  * @{
39  *
40   * @defgroup   PackageManager
41  * @section             Header to use them:
42  * @code
43  * #include "package-manager.h"
44  * @endcode
45  *
46  * @addtogroup PackageManager
47  * @{
48  */
49
50 #ifndef __PKG_MANAGER_H__
51 #define __PKG_MANAGER_H__
52
53 #include <errno.h>
54 #include <stdbool.h>
55 #include <stdio.h>
56 #include <sys/types.h>
57
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61
62 #ifndef DEPRECATED
63 #define DEPRECATED      __attribute__ ((__deprecated__))
64 #endif
65
66 /**
67  * @mainpage
68  *
69  * This is package manager
70  *
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
74  *
75  */
76
77 /**
78  * @file        package-manager.h
79  * @brief Package Manager header
80  *
81  * Generated by    Sewook Park <sewook7.park@samsung.com>
82  */
83
84
85
86 /**
87  * @addtogroup PackageManager
88  * @{
89  */
90
91 /**
92  * @brief pkgmgr info types.
93  */
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"
101
102 /**
103  * @brief listening status type in pkgmgr.
104  */
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
119 /** @} */
120
121 #define PKG_SIZE_INFO_TOTAL "__TOTAL__"
122 #define PKG_CLEAR_ALL_CACHE "__ALL__"
123 /**
124  * @brief Return values in pkgmgr.
125  */
126 typedef enum _pkgmgr_return_val {
127         PKGMGR_R_ESYSTEM = -9,          /**< Severe system error */
128         PKGMGR_R_EIO = -8,              /**< IO error */
129         PKGMGR_R_ENOMEM = -7,           /**< Out of memory */
130         PKGMGR_R_ENOPKG = -6,           /**< No such package */
131         PKGMGR_R_EPRIV = -5,            /**< Privilege denied */
132         PKGMGR_R_ETIMEOUT = -4,         /**< Timeout */
133         PKGMGR_R_EINVAL = -3,           /**< Invalid argument */
134         PKGMGR_R_ECOMM = -2,            /**< Comunication Error */
135         PKGMGR_R_ERROR = -1,            /**< General error */
136         PKGMGR_R_OK = 0                 /**< General success */
137 } pkgmgr_return_val;
138 /** @} */
139
140 /**
141  * @defgroup pkg_operate        APIs to install /uninstall / activate application
142  * @ingroup pkgmgr
143  * @brief
144  *      APIs to install /uninstall / activate application
145  *      - Install application using application package filepath
146  *      - Uninstall application using application package name
147  *      - Activate application using application package name
148  *
149  */
150
151
152 /**
153  * @addtogroup pkg_operate
154  * @{
155  */
156
157 typedef void pkgmgr_client;
158 typedef void pkgmgr_info;
159
160 typedef struct {
161         long long data_size;
162         long long cache_size;
163         long long app_size;
164         long long ext_data_size;
165         long long ext_cache_size;
166         long long ext_app_size;
167 } pkg_size_info_t;
168
169 typedef enum {
170         PM_UPDATEINFO_TYPE_NONE = 0,
171         PM_UPDATEINFO_TYPE_FORCE,
172         PM_UPDATEINFO_TYPE_OPTIONAL
173 } pkgmgr_updateinfo_type;
174
175 typedef struct {
176         char *pkgid;
177         char *version;
178         pkgmgr_updateinfo_type type;
179 } pkg_update_info_t;
180
181 typedef int (*pkgmgr_iter_fn)(const char *pkg_type, const char *pkgid,
182                                 const char *version, void *data);
183
184 typedef int (*pkgmgr_handler)(uid_t target_uid, int req_id, const char *pkg_type,
185                                 const char *pkgid, const char *key,
186                                 const char *val, const void *pmsg, void *data);
187
188 typedef int (*pkgmgr_app_handler)(uid_t target_uid, int req_id, const char *pkg_type,
189                                 const char *pkgid, const char *appid, const char *key,
190                                 const char *val, const void *pmsg, void *data);
191
192 typedef void (*pkgmgr_pkg_size_info_receive_cb)(pkgmgr_client *pc, const char *pkgid,
193                 const pkg_size_info_t *size_info, void *user_data);
194
195 typedef void (*pkgmgr_total_pkg_size_info_receive_cb)(pkgmgr_client *pc,
196                 const pkg_size_info_t *size_info, void *user_data);
197
198 typedef enum {
199         PC_REQUEST = 0,
200         PC_LISTENING,
201         PC_BROADCAST,
202 } pkgmgr_client_type;
203
204 typedef enum {
205         PM_DEFAULT,
206         PM_QUIET
207 } pkgmgr_mode;
208
209 typedef enum {
210         PM_MOVE_TO_INTERNAL = 0,
211         PM_MOVE_TO_SDCARD = 1,
212 } pkgmgr_move_type;
213
214 typedef enum {
215         PM_REQUEST_MOVE = 0,
216         PM_REQUEST_GET_SIZE = 1,
217         PM_REQUEST_KILL_APP = 2,
218         PM_REQUEST_CHECK_APP = 3,
219         PM_REQUEST_MAX
220 } pkgmgr_request_service_type;
221
222 typedef enum {
223         /* sync, get data, total size for one requested pkgid */
224         PM_GET_TOTAL_SIZE = 0,
225         PM_GET_DATA_SIZE = 1,
226
227         /* async, get total used storage size */
228         PM_GET_ALL_PKGS = 2,
229
230         /* async, get a pkgid's data, total size for all installed pkg */
231         PM_GET_SIZE_INFO = 3,
232
233         /* deprecated */
234         PM_GET_TOTAL_AND_DATA = 4,
235         PM_GET_SIZE_FILE = 5,
236
237         /* async, get data, cache, app size based on "pkg_size_info_t" */
238         PM_GET_PKG_SIZE_INFO = 6,
239         PM_GET_TOTAL_PKG_SIZE_INFO = 7,
240         PM_GET_MAX
241 } pkgmgr_getsize_type;
242
243 typedef enum {
244         PM_RESTRICTION_MODE_ALL = 0x07,
245         PM_RESTRICTION_MODE_INSTALL = 0x01,
246         PM_RESTRICTION_MODE_UNINSTALL = 0x02,
247         PM_RESTRICTION_MODE_MOVE = 0x04,
248 } pkgmgr_restriction_mode;
249
250 /**
251  * @brief       This API creates pkgmgr client.
252  *
253  * This API is for package-manager client application.\n
254  *
255  * @param[in]   ctype   client type - PC_REQUEST, PC_LISTENING, PC_BROADCAST
256  * @return      pkgmgr_client object
257  * @retval      NULL    on failure creating an object
258 */
259 pkgmgr_client *pkgmgr_client_new(pkgmgr_client_type ctype);
260
261 /**
262  * @brief       This API deletes pkgmgr client.
263  *
264  * This API is for package-manager client application.\n
265  *
266  * @param[in]   pc      pkgmgr_client
267  * @return      Operation result;
268  * @retval      PKGMGR_R_OK     success
269  * @retval      PKGMGR_R_EINVAL invalid argument
270  * @retval      PKGMGR_R_ERROR  internal error
271 */
272 int pkgmgr_client_free(pkgmgr_client *pc);
273
274 /**
275  * @brief       This API set information to install tep package.
276  * @details     Use this API before calling installation API.
277  *
278  * This API is for package-manager client application.\n
279  *
280  * @param[in]   pc      pkgmgr_client
281  * @param[in]   tep_path        full path that tep file is located at
282  * @param[in]   tep_move        if TRUE, source file will be moved, else it will be copied
283  * @retval      PKGMGR_R_OK     success
284  * @retval      PKGMGR_R_EINVAL invalid argument
285 */
286 int pkgmgr_client_set_tep_path(pkgmgr_client *pc, const char *tep_path, bool tep_move);
287
288 /**
289  * @brief       This API installs package.
290  *
291  * This API is for package-manager client application.\n
292  *
293  * @param[in]   pc      pkgmgr_client
294  * @param[in]   pkg_type                package type
295  * @param[in]   descriptor_path full path that descriptor is located
296  * @param[in]   pkg_path                full path that package file is located
297  * @param[in]   optional_data   optional data which is used for installation
298  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
299  * @param[in]   event_cb        user callback
300  * @param[in]   data            user data
301  * @return      request_id (>0) if success, error code(<0) if fail\n
302  * @retval      PKGMGR_R_OK     success
303  * @retval      PKGMGR_R_EINVAL invalid argument
304  * @retval      PKGMGR_R_ECOMM  communication error
305 */
306 int pkgmgr_client_install(pkgmgr_client *pc, const char *pkg_type,
307                             const char *descriptor_path, const char *pkg_path,
308                             const char *optional_data, pkgmgr_mode mode,
309                             pkgmgr_handler event_cb, void *data);
310 int pkgmgr_client_usr_install(pkgmgr_client *pc, const char *pkg_type,
311                             const char *descriptor_path, const char *pkg_path,
312                             const char *optional_data, pkgmgr_mode mode,
313                             pkgmgr_handler event_cb, void *data, uid_t uid);
314 /**
315  * @brief       This API reinstalls package.
316  *
317  * This API is for package-manager client application.\n
318  *
319  * @param[in]   pc      pkgmgr_client
320  * @param[in]   pkg_type                package type
321  * @param[in]   pkg_path                full path that package file is located
322  * @param[in]   optional_data   optional data which is used for installation
323  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
324  * @param[in]   event_cb        user callback
325  * @param[in]   data            user data
326  * @return      request_id (>0) if success, error code(<0) if fail\n
327  * @retval      PKGMGR_R_OK     success
328  * @retval      PKGMGR_R_EINVAL invalid argument
329  * @retval      PKGMGR_R_ECOMM  communication error
330 */
331 int pkgmgr_client_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
332                             const char *optional_data, pkgmgr_mode mode,
333                             pkgmgr_handler event_cb, void *data);
334 int pkgmgr_client_usr_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
335                                   const char *optional_data, pkgmgr_mode mode,
336                               pkgmgr_handler event_cb, void *data, uid_t uid);
337
338 /**
339  * @brief       This API mount-installs package.
340  *
341  * This API is for package-manager client application.\n
342  *
343  * @param[in]   pc      pkgmgr_client
344  * @param[in]   pkg_type                package type
345  * @param[in]   descriptor_path full path that descriptor is located
346  * @param[in]   pkg_path                full path that package file is located
347  * @param[in]   optional_data   optional data which is used for installation
348  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
349  * @param[in]   event_cb        user callback
350  * @param[in]   data            user data
351  * @return      request_id (>0) if success, error code(<0) if fail\n
352  * @retval      PKGMGR_R_OK     success
353  * @retval      PKGMGR_R_EINVAL invalid argument
354  * @retval      PKGMGR_R_ECOMM  communication error
355 */
356 int pkgmgr_client_mount_install(pkgmgr_client *pc, const char *pkg_type,
357                             const char *descriptor_path, const char *pkg_path,
358                             const char *optional_data, pkgmgr_mode mode,
359                             pkgmgr_handler event_cb, void *data);
360 int pkgmgr_client_usr_mount_install(pkgmgr_client *pc, const char *pkg_type,
361                             const char *descriptor_path, const char *pkg_path,
362                             const char *optional_data, pkgmgr_mode mode,
363                             pkgmgr_handler event_cb, void *data, uid_t uid);
364
365 /**
366  * @brief       This API uninstalls package.
367  *
368  * This API is for package-manager client application.\n
369  *
370  * @param[in]   pc      pkgmgr_client
371  * @param[in]   pkg_type                package type
372  * @param[in]   pkgid   package id
373  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
374  * @param[in]   event_cb        user callback
375  * @param[in]   data            user data
376  * @param[in]   uid     the addressee user id of the instruction
377  * @return      request_id (>0), error code(<0) if fail\n
378  * @retval      PKGMGR_R_OK     success
379  * @retval      PKGMGR_R_EINVAL invalid argument
380  * @retval      PKGMGR_R_ECOMM  communication error
381 */
382 int pkgmgr_client_uninstall(pkgmgr_client *pc, const char *pkg_type,
383                                 const char *pkgid, pkgmgr_mode mode,
384                                 pkgmgr_handler event_cb, void *data);
385 int pkgmgr_client_usr_uninstall(pkgmgr_client *pc, const char *pkg_type,
386                                 const char *pkgid, pkgmgr_mode mode,
387                                 pkgmgr_handler event_cb, void *data, uid_t uid);
388
389 /**
390  * @brief       This API moves installed package to SD card or vice versa.
391  *
392  * This API is for package-manager client application.\n
393  *
394  * @param[in]   pc      pkgmgr_client
395  * @param[in]   pkg_type                package type
396  * @param[in]   pkgid   application package id
397  * @param[in]   move_type               PM_MOVE_TO_INTERNAL or PM_MOVE_TO_SDCARD
398  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
399  * @param[in]   event_cb        user callback
400  * @param[in]   data    user data
401  * @param[in]   uid     the addressee user id of the instruction
402  * @retval      PKGMGR_R_OK     success
403  * @retval      PKGMGR_R_EINVAL invalid argument
404  * @retval      PKGMGR_R_ERROR  general error
405 */
406 int pkgmgr_client_move(pkgmgr_client *pc, const char *pkg_type,
407                                 const char *pkgid, pkgmgr_move_type move_type,
408                                 pkgmgr_handler event_cb, void *data);
409 int pkgmgr_client_usr_move(pkgmgr_client *pc, const char *pkg_type,
410                                 const char *pkgid, pkgmgr_move_type move_type,
411                                 pkgmgr_handler event_cb, void *data, uid_t uid);
412
413 /**
414  * @brief       This API registers the update information of given packages
415  *
416  * This API is for package-manager client application.\n
417  *
418  * @param[in]   pc      pkgmgr_client
419  * @param[in]   update_info     update information
420  * @param[in]   uid     the addressee user id of the instruction
421  * @retval      PKGMGR_R_OK     success
422  * @retval      PKGMGR_R_EINVAL invalid argument
423  * @retval      PKGMGR_R_ERROR  general error
424 */
425 int pkgmgr_client_register_pkg_update_info(pkgmgr_client *pc,
426                                 pkg_update_info_t *update_info);
427 int pkgmgr_client_usr_register_pkg_update_info(pkgmgr_client *pc,
428                                 pkg_update_info_t *update_info, uid_t uid);
429
430 /**
431  * @brief       This API unregisters update information of certain package.
432  *
433  * This API is for package-manager client application.\n
434  *
435  * @param[in]   pc      pkgmgr_client
436  * @param[in]   pkgid   package id
437  * @param[in]   uid     the addressee user id of the instruction
438  * @retval      PKGMGR_R_OK     success
439  * @retval      PKGMGR_R_EINVAL invalid argument
440  * @retval      PKGMGR_R_ERROR  general error
441 */
442 int pkgmgr_client_unregister_pkg_update_info(pkgmgr_client *pc, const char *pkgid);
443 int pkgmgr_client_usr_unregister_pkg_update_info(pkgmgr_client *pc,
444                                 const char *pkgid, uid_t uid);
445
446 /**
447  * @brief       This API unregister update information of all packages.
448  *
449  * This API is for package-manager client application.\n
450  *
451  * @param[in]   pc      pkgmgr_client
452  * @param[in]   uid     the addressee user id of the instruction
453  * @retval      PKGMGR_R_OK     success
454  * @retval      PKGMGR_R_EINVAL invalid argument
455  * @retval      PKGMGR_R_ERROR  general error
456 */
457 int pkgmgr_client_unregister_all_pkg_update_info(pkgmgr_client *pc);
458 int pkgmgr_client_usr_unregister_all_pkg_update_info(pkgmgr_client *pc,
459                                 uid_t uid);
460
461 /**
462  * @brief       This API activates package.
463  *
464  * This API is for package-manager client application.\n
465  *
466  * @param[in]   pc      pkgmgr_client
467  * @param[in]   pkg_type                package type
468  * @param[in]   pkgid   package id
469  * @return      request_id (>0) if success, error code(<0) if fail\n
470  * @retval      PKGMGR_R_OK     success
471  * @retval      PKGMGR_R_EINVAL invalid argument
472  * @retval      PKGMGR_R_ECOMM  communication error
473 */
474 int pkgmgr_client_activate(pkgmgr_client *pc, const char *pkg_type,
475                                 const char *pkgid);
476 int pkgmgr_client_usr_activate(pkgmgr_client *pc, const char *pkg_type,
477                                 const char *pkgid, uid_t uid);
478
479 /**
480  * @brief       This API activates multiple packages.
481  *
482  * This API is for package-manager client application.\n
483  *
484  * @param[in]   pc      pkgmgr_client
485  * @param[in]   pkg_type                package type
486  * @param[in]   pkgids  array of package ids
487  * @param[in]   n_pkgs  size of array
488  * @param[in]   event_cb        user callback
489  * @param[in]   data    user data
490  * @return      request_id (>0) if success, error code(<0) if fail\n
491  * @retval      PKGMGR_R_OK     success
492  * @retval      PKGMGR_R_EINVAL invalid argument
493  * @retval      PKGMGR_R_ECOMM  communication error
494 */
495 int pkgmgr_client_activate_packages(pkgmgr_client *pc, const char *pkg_type,
496                                 const char **pkgids, int n_pkgs,
497                                 pkgmgr_handler event_cb, void *data);
498 int pkgmgr_client_usr_activate_packages(pkgmgr_client *pc, const char *pkg_type,
499                                 const char **pkgids, int n_pkgs,
500                                 pkgmgr_handler event_cb, void *data, uid_t uid);
501
502 /**
503  * @brief       This API deactivates package.
504  *
505  * This API is for package-manager client application.\n
506  *
507  * @param[in]   pc      pkgmgr_client
508  * @param[in]   pkg_type                package type
509  * @param[in]   pkgid   package id
510  * @return      request_id (>0) if success, error code(<0) if fail\n
511  * @retval      PKGMGR_R_OK     success
512  * @retval      PKGMGR_R_EINVAL invalid argument
513  * @retval      PKGMGR_R_ECOMM  communication error
514 */
515 int pkgmgr_client_deactivate(pkgmgr_client *pc, const char *pkg_type,
516                                  const char *pkgid);
517 int pkgmgr_client_usr_deactivate(pkgmgr_client *pc, const char *pkg_type,
518                                  const char *pkgid, uid_t uid);
519
520 /**
521  * @brief       This API deactivates multiple packages.
522  *
523  * This API is for package-manager client application.\n
524  *
525  * @param[in]   pc      pkgmgr_client
526  * @param[in]   pkg_type                package type
527  * @param[in]   pkgids  array of package ids
528  * @param[in]   n_pkgs  size of array
529  * @param[in]   event_cb        user callback
530  * @param[in]   data    user data
531  * @return      request_id (>0) if success, error code(<0) if fail\n
532  * @retval      PKGMGR_R_OK     success
533  * @retval      PKGMGR_R_EINVAL invalid argument
534  * @retval      PKGMGR_R_ECOMM  communication error
535 */
536 int pkgmgr_client_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
537                                  const char **pkgids, int n_pkgs,
538                                  pkgmgr_handler event_cb, void *data);
539 int pkgmgr_client_usr_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
540                                  const char **pkgids, int n_pkgs,
541                                  pkgmgr_handler event_cb, void *data, uid_t uid);
542
543 /**
544  * @brief       This API deactivates app.
545  *
546  * This API is for package-manager client application.\n
547  *
548  * @param[in]   pc      pkgmgr_client
549  * @param[in]   appid   applicaiton id
550  * @param[in]   app_event_cb    user callback
551  * @param[in]   data    user data
552  * @return      request_id (>0) if success, error code(<0) if fail\n
553  * @retval      PKGMGR_R_OK     success
554  * @retval      PKGMGR_R_EINVAL invalid argument
555  * @retval      PKGMGR_R_ECOMM  communication error
556 */
557 int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
558 int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
559
560 /**
561  * @brief       This API activates multiple apps.
562  *
563  * This API is for package-manager client application.\n
564  *
565  * @param[in]   pc      pkgmgr_client
566  * @param[in]   appids  array of application ids
567  * @param[in]   n_apps  size of array
568  * @param[in]   app_event_cb    user callback
569  * @param[in]   data    user data
570  * @return      request_id (>0) if success, error code(<0) if fail\n
571  * @retval      PKGMGR_R_OK     success
572  * @retval      PKGMGR_R_EINVAL invalid argument
573  * @retval      PKGMGR_R_ECOMM  communication error
574 */
575 int pkgmgr_client_activate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
576 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);
577
578 /**
579  * @brief       This API deactivates multiple apps.
580  *
581  * This API is for package-manager client application.\n
582  *
583  * @param[in]   pc      pkgmgr_client
584  * @param[in]   appids  array of application ids
585  * @param[in]   n_apps  size of array
586  * @param[in]   app_event_cb    user callback
587  * @param[in]   data    user data
588  * @return      request_id (>0) if success, error code(<0) if fail\n
589  * @retval      PKGMGR_R_OK     success
590  * @retval      PKGMGR_R_EINVAL invalid argument
591  * @retval      PKGMGR_R_ECOMM  communication error
592 */
593 int pkgmgr_client_deactivate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
594 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);
595
596 /**
597  * @brief       This API deactivates global app for user specified by uid.
598  *
599  * This API is for package-manager client application.\n
600  *
601  * @param[in]   pc      pkgmgr_client
602  * @param[in]   appid   applicaiton id
603  * @param[in]   app_event_cb    user callback
604  * @param[in]   uid     user id
605  * @param[in]   data    user data
606  * @return      request_id (>0) if success, error code(<0) if fail\n
607  * @retval      PKGMGR_R_OK     success
608  * @retval      PKGMGR_R_EINVAL invalid argument
609  * @retval      PKGMGR_R_ECOMM  communication error
610 */
611 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);
612
613 /**
614  * @brief       This API activates app.
615  *
616  * This API is for package-manager client application.\n
617  *
618  * @param[in]   pc      pkgmgr_client
619  * @param[in]   appid   applicaiton id
620  * @param[in]   app_event_cb    user callback
621  * @param[in]   uid     user id
622  * @param[in]   data    user data
623  * @return      request_id (>0) if success, error code(<0) if fail\n
624  * @retval      PKGMGR_R_OK     success
625  * @retval      PKGMGR_R_EINVAL invalid argument
626  * @retval      PKGMGR_R_ECOMM  communication error
627 */
628 int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
629 int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
630
631 /**
632  * @brief       This API activates global app for user specified by uid.
633  *
634  * This API is for package-manager client application.\n
635  *
636  * @param[in]   pc      pkgmgr_client
637  * @param[in]   appid   applicaiton id
638  * @param[in]   app_event_cb    user callback
639  * @param[in]   uid     user id
640  * @param[in]   data    user data
641  * @return      request_id (>0) if success, error code(<0) if fail\n
642  * @retval      PKGMGR_R_OK     success
643  * @retval      PKGMGR_R_EINVAL invalid argument
644  * @retval      PKGMGR_R_ECOMM  communication error
645 */
646 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);
647
648 /**
649  * @brief       This API deletes application's private data.
650  *
651  * This API is for package-manager client application.\n
652  *
653  * @remarks     You should call this function with regular uid
654  * @param[in]   pc      pkgmgr_client
655  * @param[in]   pkg_type                package type
656  * @param[in]   pkgid   package id
657  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
658  * @return      request_id (>0) if success, error code(<0) if fail\n
659  * @retval      PKGMGR_R_OK     success
660  * @retval      PKGMGR_R_EINVAL invalid argument
661  * @retval      PKGMGR_R_ECOMM  communication error
662 */
663 int pkgmgr_client_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
664                                 const char *appid, pkgmgr_mode mode);
665 int pkgmgr_client_usr_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
666                                 const char *appid, pkgmgr_mode mode, uid_t uid);
667 /**
668  * @brief       This API set status type to listen for the pkgmgr's broadcasting
669  *
670  * This API is for package-manager client application.\n
671  *
672  * @param[in]   pc      pkgmgr_client
673  * @param[in]   status_type     status type to listen
674  * @return      request_id (>0) if success, error code(<0) if fail\n
675  * @retval      PKGMGR_R_OK     success
676  * @retval      PKGMGR_R_EINVAL invalid argument
677 */
678 int pkgmgr_client_set_status_type(pkgmgr_client *pc, int status_type);
679
680 /**
681  * @brief       This API request to listen the pkgmgr's broadcasting
682  *
683  * This API is for package-manager client application.\n
684  *
685  * @param[in]   pc      pkgmgr_client
686  * @param[in]   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 */
692 int pkgmgr_client_listen_status(pkgmgr_client *pc, pkgmgr_handler event_cb,
693                                     void *data);
694
695 /**
696  * @brief       This API request to listen the pkgmgr's broadcasting about apps
697  *
698  * This API is for package-manager client application.\n
699  *
700  * @param[in]   pc      pkgmgr_client
701  * @param[in]   event_cb        user callback
702  * @param[in]   data            user data
703  * @return      request_id (>0) if success, error code(<0) if fail\n
704  * @retval      PKGMGR_R_OK     success
705  * @retval      PKGMGR_R_EINVAL invalid argument
706 */
707 int pkgmgr_client_listen_app_status(pkgmgr_client *pc, pkgmgr_app_handler event_cb,
708                                     void *data);
709
710 /**
711  * @brief       This API request to stop listen the pkgmgr's broadcasting
712  *
713  * This API is for package-manager client application.\n
714  *
715  * @param[in]   pc      pkgmgr_client
716  * @return      0 if success, error code(<0) if fail\n
717  * @retval      PKGMGR_R_OK     success
718  * @retval      PKGMGR_R_EINVAL invalid argument
719  * @retval      PKGMGR_R_ERROR          internal error
720 */
721 int pkgmgr_client_remove_listen_status(pkgmgr_client *pc);
722
723 /**
724  * @brief       This API broadcasts pkgmgr's status
725  *
726  * This API is for package-manager client application.\n
727  *
728  * @param[in]   pc      pkgmgr_client
729  * @param[in]   pkg_type                package type
730  * @param[in]   pkgid   package id
731  * @param[in]   key             key to broadcast
732  * @param[in]   val             value to broadcast
733  * @return      0 if success, error code(<0) if fail\n
734  * @retval      PKGMGR_R_OK     success
735  * @retval      PKGMGR_R_EINVAL invalid argument
736 */
737 int pkgmgr_client_broadcast_status(pkgmgr_client *pc, const char *pkg_type,
738                                          const char *pkgid,  const char *key,
739                                          const char *val);
740
741 /**
742  * @brief       This API  gets the package's information.
743  *
744  *              This API is for package-manager client application.\n
745  *
746  * @param[in]   pkg_path                package file path to get infomation
747  * @return      package entry pointer if success, NULL if fail\n
748 */
749 pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path);
750
751 /**
752  * @brief       This API  get package information value
753  *
754  *              This API is for package-manager client application.\n
755  *
756  * @param[in]   pkg_info                        pointer for package info entry
757  * @return      0 if success, error code(<0) if fail\n
758 */
759 int pkgmgr_client_free_pkginfo(pkgmgr_info *pkg_info);
760
761 /**
762  * @brief       This API requests service
763  *
764  * This API is for package-manager client application.\n
765  *
766  * @param[in]   service_type            pkgmgr_request_service_type
767  * @param[in]   service_mode            mode which is used for addtional mode selection
768  * @param[in]   pc                      pkgmgr_client
769  * @param[in]   pkg_type                package type
770  * @param[in]   pkgid                   package id
771  * @param[in]   custom_info             custom information which is used for addtional information
772  * @param[in]   event_cb                user callback
773  * @param[in]   data                    user data
774  * @return      request_id (>0) if success, error code(<0) if fail\n
775  * @retval      PKGMGR_R_OK     success
776  * @retval      PKGMGR_R_EINVAL invalid argument
777  * @retval      PKGMGR_R_ECOMM  communication error
778 */
779 int pkgmgr_client_request_service(pkgmgr_request_service_type service_type, int service_mode,
780                                         pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
781                                         const char *custom_info, pkgmgr_handler event_cb, void *data);
782 int pkgmgr_client_usr_request_service(pkgmgr_request_service_type service_type, int service_mode,
783                                         pkgmgr_client *pc, const char *pkg_type, const char *pkgid, uid_t uid,
784                                         const char *custom_info, pkgmgr_handler event_cb, void *data);
785 /**
786  * @brief       This API get package size
787  *
788  * This API is for package-manager client application.\n
789  *
790  * @param[in]   pc                              pkgmgr_client
791  * @param[in]   pkgid                   package id
792  * @param[in]   get_type                type for pkgmgr client request to get package size
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_ECOMM  communication error
799 */
800 int pkgmgr_client_get_size(pkgmgr_client *pc, const char *pkgid, pkgmgr_getsize_type get_type, pkgmgr_handler event_cb, void *data);
801 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);
802
803 /**
804  * @brief               Gets the package size information.
805  * @details             The package size info is asynchronously obtained by the specified callback function.
806  *
807  * @param[in] pc                The pointer to pkgmgr_client instance
808  * @param[in] pkgid             The package ID
809  * @param[in] result_cb The asynchronous callback function to get the package size information
810  * @param[in] user_data User data to be passed to the callback function
811  *
812  * @return 0 on success, otherwise a negative error value
813  * @retval #PKGMGR_R_OK                 Successful
814  * @retval #PKGMGR_R_EINVAL             Invalid parameter
815  * @retval #PKGMGR_R_ERROR              Internal error
816  */
817 int pkgmgr_client_get_package_size_info(pkgmgr_client *pc, const char *pkgid, pkgmgr_pkg_size_info_receive_cb result_cb, void *user_data);
818 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);
819
820 /**
821  * @brief               Gets the sum of the entire package size information.
822  * @details             The package size info is asynchronously obtained by the specified callback function.
823  *
824  * @param[in] pc                The pointer to pkgmgr_client instance
825  * @param[in] result_cb The asynchronous callback function to get the total package size information
826  * @param[in] user_data User data to be passed to the callback function
827  *
828  * @return 0 on success, otherwise a negative error value
829  * @retval #PKGMGR_R_OK                 Successful
830  * @retval #PKGMGR_R_EINVAL             Invalid parameter
831  * @retval #PKGMGR_R_ERROR              Internal error
832  */
833 int pkgmgr_client_get_total_package_size_info(pkgmgr_client *pc, pkgmgr_total_pkg_size_info_receive_cb result_cb, void *user_data);
834 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);
835
836 /**
837  * @brief               Gets size information of each installed packages.
838  * @details             The package size info is asynchronously obtained by callback function added by pkgmgr_client_listen_status.
839  *
840  * @return 0 on success, otherwise a negative error value
841  * @retval #PKGMGR_R_OK                 Successful
842  * @retval #PKGMGR_R_EINVAL             Invalid parameter
843  * @retval #PKGMGR_R_ECOMM              communication error
844  * @retval #PKGMGR_R_ERROR              Internal error
845  */
846 int pkgmgr_client_request_size_info(void);
847 int pkgmgr_client_usr_request_size_info(uid_t uid);
848
849 /**
850  * @brief       This API removes cache directories
851  *
852  * This API is for package-manager client application.\n
853  *
854  * @remarks     You should call this function with regular uid
855  * @param[in]   pkgid                   package id
856  * @return      0 if success, error code(<0) if fail\n
857  * @retval      PKGMGR_R_OK     success
858  * @retval      PKGMGR_R_EINVAL invalid argument
859  * @retval      PKGMGR_R_EPRIV privilege denied
860  * @retval      PKGMGR_R_ERROR  internal error
861 */
862 int pkgmgr_client_clear_cache_dir(const char *pkgid);
863 int pkgmgr_client_usr_clear_cache_dir(const char *pkgid, uid_t uid);
864
865 /**
866  * @brief       This API removes all cache directories
867  *
868  * This API is for package-manager client application.\n
869  *
870  * @remarks     You should call this function with regular uid
871  * @return      0 if success, error code(<0) if fail\n
872  * @retval      PKGMGR_R_OK     success
873  * @retval      PKGMGR_R_EINVAL invalid argument
874  * @retval      PKGMGR_R_EPRIV privilege denied
875  * @retval      PKGMGR_R_ERROR  internal error
876 */
877 int pkgmgr_client_clear_all_cache_dir(void);
878 int pkgmgr_client_usr_clear_all_cache_dir(uid_t uid);
879
880 /**
881  * @brief       Generates request for getting license
882  *
883  * This API generates request for getting license.\n
884  *
885  * @remarks     You must release @a req_data and @a license_url by yourself.
886  * @param[in]   pc      The pointer to pkgmgr_client instance
887  * @param[in]   resp_data       The response data string of the purchase request
888  * @param[out]  req_data        License request data
889  * @param[out]  license_url     License acquisition url data
890  * @return      0 if success, error code(<0) if fail\n
891  * @retval      PKGMGR_R_OK     success
892  * @retval      PKGMGR_R_EINVAL invalid argument
893  * @retval      PKGMGR_R_ECOMM  communication error
894  * @retval      PKGMGR_R_EPRIV  privilege denied
895  * @retval      PKGMGR_R_ESYSTEM        severe system error
896  */
897 int pkgmgr_client_generate_license_request(pkgmgr_client *pc, const char *resp_data, char **req_data, char **license_url);
898
899 /**
900  * @brief       Registers encrypted license
901  *
902  * This API registers encrypted license.\n
903  *
904  * @param[in]   pc      The pointer to pkgmgr_client instance
905  * @param[in]   resp_data       The response data string of the purchase request
906  * @return      0 if success, error code(<0) if fail\n
907  * @retval      PKGMGR_R_OK     success
908  * @retval      PKGMGR_R_EINVAL invalid argument
909  * @retval      PKGMGR_R_ECOMM  communication error
910  * @retval      PKGMGR_R_EPRIV privilege denied
911  * @retval      PKGMGR_R_ESYSTEM        severe system error
912  */
913 int pkgmgr_client_register_license(pkgmgr_client *pc, const char *resp_data);
914
915 /**
916  * @brief       Decrypts contents which is encrypted
917  *
918  * This API decrypts contents which is encrypted.\n
919  *
920  * @param[in]   pc      The pointer to pkgmgr_client instance
921  * @param[in]   drm_file_path   The pointer to pkgmgr_client instance
922  * @param[in]   decrypted_file_path     The pointer to pkgmgr_client instance
923  * @return      0 if success, error code(<0) if fail\n
924  * @retval      PKGMGR_R_OK     success
925  * @retval      PKGMGR_R_EINVAL invalid argument
926  * @retval      PKGMGR_R_ECOMM  communication error
927  * @retval      PKGMGR_R_EPRIV privilege denied
928  * @retval      PKGMGR_R_ESYSTEM        severe system error
929  */
930 int pkgmgr_client_decrypt_package(pkgmgr_client *pc, const char *drm_file_path, const char *decrypted_file_path);
931
932 /**
933  * @brief       This API is enabled the splash screen
934  *
935  * This API is for package-manager client application.\n
936  *
937  * @param[in]   pc      pkgmgr_client
938  * @param[in]   appid   applicaiton id
939  * @return      request_id (>0) if success, error code(<0) if fail\n
940  * @retval      PKGMGR_R_OK             success
941  * @retval      PKGMGR_R_EINVAL         invalid argument
942  * @retval      PKGMGR_R_ECOMM          communication error
943  * @retval      PKGMGR_R_ENOMEM         out of memory
944  */
945 int pkgmgr_client_enable_splash_screen(pkgmgr_client *pc, const char *appid);
946 int pkgmgr_client_usr_enable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
947
948 /**
949  * @brief       This API is disabled the splash screen
950  *
951  * This API is for package-manager client application.\n
952  *
953  * @param[in]   pc      pkgmgr_client
954  * @param[in]   appid   applicaiton id
955  * @return      request_id (>0) if success, error code(<0) if fail\n
956  * @retval      PKGMGR_R_OK             success
957  * @retval      PKGMGR_R_EINVAL         invalid argument
958  * @retval      PKGMGR_R_ECOMM          communication error
959  * @retval      PKGMGR_R_ENOMEM         out of memory
960  */
961 int pkgmgr_client_disable_splash_screen(pkgmgr_client *pc, const char *appid);
962 int pkgmgr_client_usr_disable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
963
964 /**
965  * @brief       Set restriction mode
966  *
967  * This API set restriction mode bit.\n
968  *
969  * @param[in]   pc      The pointer to pkgmgr_client instance
970  * @param[in]   mode    restriction mode bit
971  * @return      0 if success, error code(<0) if fail\n
972  * @retval      PKGMGR_R_OK     success
973  * @retval      PKGMGR_R_EINVAL invalid argument
974  * @retval      PKGMGR_R_ECOMM  communication error
975  * @retval      PKGMGR_R_EPRIV privilege denied
976  * @see pkgmgr_restriction_mode
977  */
978 int pkgmgr_client_set_restriction_mode(pkgmgr_client *pc, int mode);
979 int pkgmgr_client_usr_set_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
980
981 /**
982  * @brief       Unset restriction mode
983  *
984  * This API unset restriction mode bit.\n
985  *
986  * @param[in]   pc      The pointer to pkgmgr_client instance
987  * @param[in]   mode    restriction mode bit
988  * @return      0 if success, error code(<0) if fail\n
989  * @retval      PKGMGR_R_OK     success
990  * @retval      PKGMGR_R_EINVAL invalid argument
991  * @retval      PKGMGR_R_ECOMM  communication error
992  * @retval      PKGMGR_R_EPRIV privilege denied
993  * @see pkgmgr_restriction_mode
994  */
995 int pkgmgr_client_unset_restriction_mode(pkgmgr_client *pc, int mode);
996 int pkgmgr_client_usr_unset_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
997
998 /**
999  * @brief       Get restriction mode
1000  *
1001  * This API gets restriction mode bit.\n
1002  *
1003  * @param[in]   pc      The pointer to pkgmgr_client instance
1004  * @param[out]  mode    restriction mode bit
1005  * @return      0 if success, error code(<0) if fail\n
1006  * @retval      PKGMGR_R_OK     success
1007  * @retval      PKGMGR_R_EINVAL invalid argument
1008  * @retval      PKGMGR_R_ECOMM  communication error
1009  * @retval      PKGMGR_R_EPRIV privilege denied
1010  * @see pkgmgr_restriction_mode
1011  */
1012 int pkgmgr_client_get_restriction_mode(pkgmgr_client *pc, int *mode);
1013 int pkgmgr_client_usr_get_restriction_mode(pkgmgr_client *pc, int *mode, uid_t uid);
1014
1015 /**
1016  * @brief       Set restriction mode bit for package specified.
1017  * @details     You can combine multiple status using OR operation which you want to restrict.
1018  *
1019  * This API sets restriction bit for pkg operation to not allow user to do it.\n
1020  *
1021  * @param[in]   pc      The pointer to pkgmgr_client instance
1022  * @param[in]   pkgid   pkgid  to be restricted
1023  * @param[in]  mode restriction mode bit
1024  * @return      0 if success, error code(<0) if fail\n
1025  * @retval      PKGMGR_R_OK     success
1026  * @retval      PKGMGR_R_EINVAL invalid argument
1027  * @retval      PKGMGR_R_ECOMM  communication error
1028  * @retval      PKGMGR_R_EPRIV privilege denied
1029  * @see pkgmgr_restriction_mode
1030  */
1031 int pkgmgr_client_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1032 int pkgmgr_client_usr_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1033
1034 /**
1035  * @brief       Unset restriction mode bit for package specified
1036  * @details     You can combine multiple status using OR operation which you want to unset
1037  *
1038  * This API unsets restriction bit to remove restriction of pkg operation.
1039  *
1040  * @param[in]   pc      The pointer to pkgmgr_client instance
1041  * @param[in]   pkgid   pkg id to be remove in restriction.
1042  * @param[in]  mode restriction mode bit
1043  * @return      0 if success, error code(<0) if fail\n
1044  * @retval      PKGMGR_R_OK     success
1045  * @retval      PKGMGR_R_EINVAL invalid argument
1046  * @retval      PKGMGR_R_ECOMM  communication error
1047  * @retval      PKGMGR_R_EPRIV privilege denied
1048  * @see pkgmgr_restriction_mode
1049  */
1050 int pkgmgr_client_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1051 int pkgmgr_client_usr_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1052
1053 /**
1054  * @brief       Get restriction bit of package operation
1055  *
1056  * This API gets restriction bit for restricted package operation.\n
1057  *
1058  * @param[in]   pc      The pointer to pkgmgr_client instance
1059  * @param[in]   pkgid   pkg id to be remove in restriction.
1060  * @param[out]  mode    restriction mode bit
1061  * @return      0 if success, error code(<0) if fail\n
1062  * @retval      PKGMGR_R_OK     success
1063  * @retval      PKGMGR_R_EINVAL invalid argument
1064  * @retval      PKGMGR_R_ECOMM  communication error
1065  * @retval      PKGMGR_R_EPRIV privilege denied
1066  * @see pkgmgr_restriction_mode
1067  */
1068 int pkgmgr_client_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode);
1069 int pkgmgr_client_usr_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode, uid_t uid);
1070
1071 /**
1072  * @brief       Change application's label
1073  *
1074  * This API sets label of application specified.\n
1075  *
1076  * @param[in]   pc      The pointer to pkgmgr_client instance
1077  * @param[in]   appid   app id to be changed.
1078  * @param[in]   label   application's label to change.
1079  * @param[out]  mode    restriction mode bit
1080  * @return      0 if success, error code(<0) if fail\n
1081  * @retval      PKGMGR_R_OK     success
1082  * @retval      PKGMGR_R_EINVAL invalid argument
1083  * @retval      PKGMGR_R_ECOMM  communication error
1084  */
1085 int pkgmgr_client_set_app_label(pkgmgr_client *pc, char *appid, char *label);
1086 int pkgmgr_client_usr_set_app_label(pkgmgr_client *pc, char *appid, char *label, uid_t uid);
1087
1088 /**
1089  * @brief       Set debug mode
1090  *
1091  * This API sets debug mode value for request.\n
1092  *
1093  * @param[in]   pc      The pointer to pkgmgr_client instance
1094  * @param[in]   debug_mode      indicates the request is debug mode or not
1095  * @return      0 if success, error code(<0) if fail\n
1096  * @retval      PKGMGR_R_OK     success
1097  * @retval      PKGMGR_R_EINVAL invalid argument
1098  */
1099 int pkgmgr_client_set_debug_mode(pkgmgr_client *pc, bool debug_mode);
1100
1101 /**
1102  * @brief       Migrate legacy external image which is generated under 3.0
1103  *
1104  * This API request the migration of external image.\n
1105  *
1106  * @param[in]   pc      The pointer to pkgmgr_client instance
1107  * @param[in]   pkgid   pkg id which have legacy image
1108  * @return      0 if success, error code(<0) if fail\n
1109  * @retval      PKGMGR_R_OK     success
1110  * @retval      PKGMGR_R_EINVAL invalid argument
1111  */
1112 int pkgmgr_client_usr_migrate_external_image(pkgmgr_client *pc, const char *pkgid, uid_t uid);
1113
1114 /** @} */
1115
1116
1117 #ifdef __cplusplus
1118 }
1119 #endif
1120 #endif                          /* __PKG_MANAGER_H__ */
1121 /**
1122  * @}
1123  * @}
1124  */
1125