Remove unused APIs
[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         PM_MOVE_TO_EXTENDED = 2,
213 } pkgmgr_move_type;
214
215 typedef enum {
216         PM_REQUEST_MOVE = 0,
217         PM_REQUEST_GET_SIZE = 1,
218         PM_REQUEST_KILL_APP = 2,
219         PM_REQUEST_CHECK_APP = 3,
220         PM_REQUEST_MAX
221 } pkgmgr_request_service_type;
222
223 typedef enum {
224         /* sync, get data, total size for one requested pkgid */
225         PM_GET_TOTAL_SIZE = 0,
226         PM_GET_DATA_SIZE = 1,
227
228         /* async, get total used storage size */
229         PM_GET_ALL_PKGS = 2,
230
231         /* async, get a pkgid's data, total size for all installed pkg */
232         PM_GET_SIZE_INFO = 3,
233
234         /* deprecated */
235         PM_GET_TOTAL_AND_DATA = 4,
236         PM_GET_SIZE_FILE = 5,
237
238         /* async, get data, cache, app size based on "pkg_size_info_t" */
239         PM_GET_PKG_SIZE_INFO = 6,
240         PM_GET_TOTAL_PKG_SIZE_INFO = 7,
241         PM_GET_MAX
242 } pkgmgr_getsize_type;
243
244 typedef enum {
245         PM_RESTRICTION_MODE_ALL = 0x07,
246         PM_RESTRICTION_MODE_INSTALL = 0x01,
247         PM_RESTRICTION_MODE_UNINSTALL = 0x02,
248         PM_RESTRICTION_MODE_MOVE = 0x04,
249 } pkgmgr_restriction_mode;
250
251 /**
252  * @brief       This API creates pkgmgr client.
253  *
254  * This API is for package-manager client application.\n
255  *
256  * @param[in]   ctype   client type - PC_REQUEST, PC_LISTENING, PC_BROADCAST
257  * @return      pkgmgr_client object
258  * @retval      NULL    on failure creating an object
259 */
260 pkgmgr_client *pkgmgr_client_new(pkgmgr_client_type ctype);
261
262 /**
263  * @brief       This API deletes pkgmgr client.
264  *
265  * This API is for package-manager client application.\n
266  *
267  * @param[in]   pc      pkgmgr_client
268  * @return      Operation result;
269  * @retval      PKGMGR_R_OK     success
270  * @retval      PKGMGR_R_EINVAL invalid argument
271  * @retval      PKGMGR_R_ERROR  internal error
272 */
273 int pkgmgr_client_free(pkgmgr_client *pc);
274
275 /**
276  * @brief       This API set information to install tep package.
277  * @details     Use this API before calling installation API.
278  *
279  * This API is for package-manager client application.\n
280  *
281  * @param[in]   pc      pkgmgr_client
282  * @param[in]   tep_path        full path that tep file is located at
283  * @param[in]   tep_move        if TRUE, source file will be moved, else it will be copied
284  * @retval      PKGMGR_R_OK     success
285  * @retval      PKGMGR_R_EINVAL invalid argument
286 */
287 int pkgmgr_client_set_tep_path(pkgmgr_client *pc, const char *tep_path, bool tep_move);
288
289 /**
290  * @brief       This API installs package.
291  *
292  * This API is for package-manager client application.\n
293  *
294  * @param[in]   pc      pkgmgr_client
295  * @param[in]   pkg_type                package type
296  * @param[in]   descriptor_path full path that descriptor is located
297  * @param[in]   pkg_path                full path that package file is located
298  * @param[in]   optional_data   optional data which is used for installation
299  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
300  * @param[in]   event_cb        user callback
301  * @param[in]   data            user data
302  * @return      request_id (>0) if success, error code(<0) if fail\n
303  * @retval      PKGMGR_R_OK     success
304  * @retval      PKGMGR_R_EINVAL invalid argument
305  * @retval      PKGMGR_R_ECOMM  communication error
306 */
307 int pkgmgr_client_install(pkgmgr_client *pc, const char *pkg_type,
308                             const char *descriptor_path, const char *pkg_path,
309                             const char *optional_data, pkgmgr_mode mode,
310                             pkgmgr_handler event_cb, void *data);
311 int pkgmgr_client_usr_install(pkgmgr_client *pc, const char *pkg_type,
312                             const char *descriptor_path, const char *pkg_path,
313                             const char *optional_data, pkgmgr_mode mode,
314                             pkgmgr_handler event_cb, void *data, uid_t uid);
315 /**
316  * @brief       This API reinstalls package.
317  *
318  * This API is for package-manager client application.\n
319  *
320  * @param[in]   pc      pkgmgr_client
321  * @param[in]   pkg_type                package type
322  * @param[in]   pkg_path                full path that package file is located
323  * @param[in]   optional_data   optional data which is used for installation
324  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
325  * @param[in]   event_cb        user callback
326  * @param[in]   data            user data
327  * @return      request_id (>0) if success, error code(<0) if fail\n
328  * @retval      PKGMGR_R_OK     success
329  * @retval      PKGMGR_R_EINVAL invalid argument
330  * @retval      PKGMGR_R_ECOMM  communication error
331 */
332 int pkgmgr_client_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
333                             const char *optional_data, pkgmgr_mode mode,
334                             pkgmgr_handler event_cb, void *data);
335 int pkgmgr_client_usr_reinstall(pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
336                                   const char *optional_data, pkgmgr_mode mode,
337                               pkgmgr_handler event_cb, void *data, uid_t uid);
338
339 /**
340  * @brief       This API mount-installs package.
341  *
342  * This API is for package-manager client application.\n
343  *
344  * @param[in]   pc      pkgmgr_client
345  * @param[in]   pkg_type                package type
346  * @param[in]   descriptor_path full path that descriptor is located
347  * @param[in]   pkg_path                full path that package file is located
348  * @param[in]   optional_data   optional data which is used for installation
349  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
350  * @param[in]   event_cb        user callback
351  * @param[in]   data            user data
352  * @return      request_id (>0) if success, error code(<0) if fail\n
353  * @retval      PKGMGR_R_OK     success
354  * @retval      PKGMGR_R_EINVAL invalid argument
355  * @retval      PKGMGR_R_ECOMM  communication error
356 */
357 int pkgmgr_client_mount_install(pkgmgr_client *pc, const char *pkg_type,
358                             const char *descriptor_path, const char *pkg_path,
359                             const char *optional_data, pkgmgr_mode mode,
360                             pkgmgr_handler event_cb, void *data);
361 int pkgmgr_client_usr_mount_install(pkgmgr_client *pc, const char *pkg_type,
362                             const char *descriptor_path, const char *pkg_path,
363                             const char *optional_data, pkgmgr_mode mode,
364                             pkgmgr_handler event_cb, void *data, uid_t uid);
365
366 /**
367  * @brief       This API uninstalls package.
368  *
369  * This API is for package-manager client application.\n
370  *
371  * @param[in]   pc      pkgmgr_client
372  * @param[in]   pkg_type                package type
373  * @param[in]   pkgid   package id
374  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
375  * @param[in]   event_cb        user callback
376  * @param[in]   data            user data
377  * @param[in]   uid     the addressee user id of the instruction
378  * @return      request_id (>0), error code(<0) if fail\n
379  * @retval      PKGMGR_R_OK     success
380  * @retval      PKGMGR_R_EINVAL invalid argument
381  * @retval      PKGMGR_R_ECOMM  communication error
382 */
383 int pkgmgr_client_uninstall(pkgmgr_client *pc, const char *pkg_type,
384                                 const char *pkgid, pkgmgr_mode mode,
385                                 pkgmgr_handler event_cb, void *data);
386 int pkgmgr_client_usr_uninstall(pkgmgr_client *pc, const char *pkg_type,
387                                 const char *pkgid, pkgmgr_mode mode,
388                                 pkgmgr_handler event_cb, void *data, uid_t uid);
389
390 /**
391  * @brief       This API moves installed package to SD card or vice versa.
392  *
393  * This API is for package-manager client application.\n
394  *
395  * @param[in]   pc      pkgmgr_client
396  * @param[in]   pkg_type                package type
397  * @param[in]   pkgid   application package id
398  * @param[in]   move_type               move type
399  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
400  * @param[in]   event_cb        user callback
401  * @param[in]   data    user data
402  * @param[in]   uid     the addressee user id of the instruction
403  * @retval      PKGMGR_R_OK     success
404  * @retval      PKGMGR_R_EINVAL invalid argument
405  * @retval      PKGMGR_R_ERROR  general error
406 */
407 int pkgmgr_client_move(pkgmgr_client *pc, const char *pkg_type,
408                                 const char *pkgid, pkgmgr_move_type move_type,
409                                 pkgmgr_handler event_cb, void *data);
410 int pkgmgr_client_usr_move(pkgmgr_client *pc, const char *pkg_type,
411                                 const char *pkgid, pkgmgr_move_type move_type,
412                                 pkgmgr_handler event_cb, void *data, uid_t uid);
413
414 /**
415  * @brief       This API registers the update information of given packages
416  *
417  * This API is for package-manager client application.\n
418  *
419  * @param[in]   pc      pkgmgr_client
420  * @param[in]   update_info     update information
421  * @param[in]   uid     the addressee user id of the instruction
422  * @retval      PKGMGR_R_OK     success
423  * @retval      PKGMGR_R_EINVAL invalid argument
424  * @retval      PKGMGR_R_ERROR  general error
425 */
426 int pkgmgr_client_register_pkg_update_info(pkgmgr_client *pc,
427                                 pkg_update_info_t *update_info);
428 int pkgmgr_client_usr_register_pkg_update_info(pkgmgr_client *pc,
429                                 pkg_update_info_t *update_info, uid_t uid);
430
431 /**
432  * @brief       This API unregisters update information of certain package.
433  *
434  * This API is for package-manager client application.\n
435  *
436  * @param[in]   pc      pkgmgr_client
437  * @param[in]   pkgid   package id
438  * @param[in]   uid     the addressee user id of the instruction
439  * @retval      PKGMGR_R_OK     success
440  * @retval      PKGMGR_R_EINVAL invalid argument
441  * @retval      PKGMGR_R_ERROR  general error
442 */
443 int pkgmgr_client_unregister_pkg_update_info(pkgmgr_client *pc, const char *pkgid);
444 int pkgmgr_client_usr_unregister_pkg_update_info(pkgmgr_client *pc,
445                                 const char *pkgid, uid_t uid);
446
447 /**
448  * @brief       This API unregister update information of all packages.
449  *
450  * This API is for package-manager client application.\n
451  *
452  * @param[in]   pc      pkgmgr_client
453  * @param[in]   uid     the addressee user id of the instruction
454  * @retval      PKGMGR_R_OK     success
455  * @retval      PKGMGR_R_EINVAL invalid argument
456  * @retval      PKGMGR_R_ERROR  general error
457 */
458 int pkgmgr_client_unregister_all_pkg_update_info(pkgmgr_client *pc);
459 int pkgmgr_client_usr_unregister_all_pkg_update_info(pkgmgr_client *pc,
460                                 uid_t uid);
461
462 /**
463  * @brief       This API activates package.
464  *
465  * This API is for package-manager client application.\n
466  *
467  * @param[in]   pc      pkgmgr_client
468  * @param[in]   pkg_type                package type
469  * @param[in]   pkgid   package id
470  * @return      request_id (>0) if success, error code(<0) if fail\n
471  * @retval      PKGMGR_R_OK     success
472  * @retval      PKGMGR_R_EINVAL invalid argument
473  * @retval      PKGMGR_R_ECOMM  communication error
474 */
475 int pkgmgr_client_activate(pkgmgr_client *pc, const char *pkg_type,
476                                 const char *pkgid);
477 int pkgmgr_client_usr_activate(pkgmgr_client *pc, const char *pkg_type,
478                                 const char *pkgid, uid_t uid);
479
480 /**
481  * @brief       This API activates multiple packages.
482  *
483  * This API is for package-manager client application.\n
484  *
485  * @param[in]   pc      pkgmgr_client
486  * @param[in]   pkg_type                package type
487  * @param[in]   pkgids  array of package ids
488  * @param[in]   n_pkgs  size of array
489  * @param[in]   event_cb        user callback
490  * @param[in]   data    user data
491  * @return      request_id (>0) if success, error code(<0) if fail\n
492  * @retval      PKGMGR_R_OK     success
493  * @retval      PKGMGR_R_EINVAL invalid argument
494  * @retval      PKGMGR_R_ECOMM  communication error
495 */
496 int pkgmgr_client_activate_packages(pkgmgr_client *pc, const char *pkg_type,
497                                 const char **pkgids, int n_pkgs,
498                                 pkgmgr_handler event_cb, void *data);
499 int pkgmgr_client_usr_activate_packages(pkgmgr_client *pc, const char *pkg_type,
500                                 const char **pkgids, int n_pkgs,
501                                 pkgmgr_handler event_cb, void *data, uid_t uid);
502
503 /**
504  * @brief       This API deactivates package.
505  *
506  * This API is for package-manager client application.\n
507  *
508  * @param[in]   pc      pkgmgr_client
509  * @param[in]   pkg_type                package type
510  * @param[in]   pkgid   package id
511  * @return      request_id (>0) if success, error code(<0) if fail\n
512  * @retval      PKGMGR_R_OK     success
513  * @retval      PKGMGR_R_EINVAL invalid argument
514  * @retval      PKGMGR_R_ECOMM  communication error
515 */
516 int pkgmgr_client_deactivate(pkgmgr_client *pc, const char *pkg_type,
517                                  const char *pkgid);
518 int pkgmgr_client_usr_deactivate(pkgmgr_client *pc, const char *pkg_type,
519                                  const char *pkgid, uid_t uid);
520
521 /**
522  * @brief       This API deactivates multiple packages.
523  *
524  * This API is for package-manager client application.\n
525  *
526  * @param[in]   pc      pkgmgr_client
527  * @param[in]   pkg_type                package type
528  * @param[in]   pkgids  array of package ids
529  * @param[in]   n_pkgs  size of array
530  * @param[in]   event_cb        user callback
531  * @param[in]   data    user data
532  * @return      request_id (>0) if success, error code(<0) if fail\n
533  * @retval      PKGMGR_R_OK     success
534  * @retval      PKGMGR_R_EINVAL invalid argument
535  * @retval      PKGMGR_R_ECOMM  communication error
536 */
537 int pkgmgr_client_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
538                                  const char **pkgids, int n_pkgs,
539                                  pkgmgr_handler event_cb, void *data);
540 int pkgmgr_client_usr_deactivate_packages(pkgmgr_client *pc, const char *pkg_type,
541                                  const char **pkgids, int n_pkgs,
542                                  pkgmgr_handler event_cb, void *data, uid_t uid);
543
544 /**
545  * @brief       This API deactivates app.
546  *
547  * This API is for package-manager client application.\n
548  *
549  * @param[in]   pc      pkgmgr_client
550  * @param[in]   appid   applicaiton id
551  * @param[in]   app_event_cb    user callback
552  * @param[in]   data    user data
553  * @return      request_id (>0) if success, error code(<0) if fail\n
554  * @retval      PKGMGR_R_OK     success
555  * @retval      PKGMGR_R_EINVAL invalid argument
556  * @retval      PKGMGR_R_ECOMM  communication error
557 */
558 int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
559 int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
560
561 /**
562  * @brief       This API activates multiple apps.
563  *
564  * This API is for package-manager client application.\n
565  *
566  * @param[in]   pc      pkgmgr_client
567  * @param[in]   appids  array of application ids
568  * @param[in]   n_apps  size of array
569  * @param[in]   app_event_cb    user callback
570  * @param[in]   data    user data
571  * @return      request_id (>0) if success, error code(<0) if fail\n
572  * @retval      PKGMGR_R_OK     success
573  * @retval      PKGMGR_R_EINVAL invalid argument
574  * @retval      PKGMGR_R_ECOMM  communication error
575 */
576 int pkgmgr_client_activate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
577 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);
578
579 /**
580  * @brief       This API deactivates multiple apps.
581  *
582  * This API is for package-manager client application.\n
583  *
584  * @param[in]   pc      pkgmgr_client
585  * @param[in]   appids  array of application ids
586  * @param[in]   n_apps  size of array
587  * @param[in]   app_event_cb    user callback
588  * @param[in]   data    user data
589  * @return      request_id (>0) if success, error code(<0) if fail\n
590  * @retval      PKGMGR_R_OK     success
591  * @retval      PKGMGR_R_EINVAL invalid argument
592  * @retval      PKGMGR_R_ECOMM  communication error
593 */
594 int pkgmgr_client_deactivate_apps(pkgmgr_client *pc, const char **appids, int n_apps, pkgmgr_app_handler app_event_cb, void *data);
595 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);
596
597 /**
598  * @brief       This API deactivates global app for user specified by uid.
599  *
600  * This API is for package-manager client application.\n
601  *
602  * @param[in]   pc      pkgmgr_client
603  * @param[in]   appid   applicaiton id
604  * @param[in]   app_event_cb    user callback
605  * @param[in]   uid     user id
606  * @param[in]   data    user data
607  * @return      request_id (>0) if success, error code(<0) if fail\n
608  * @retval      PKGMGR_R_OK     success
609  * @retval      PKGMGR_R_EINVAL invalid argument
610  * @retval      PKGMGR_R_ECOMM  communication error
611 */
612 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);
613
614 /**
615  * @brief       This API activates app.
616  *
617  * This API is for package-manager client application.\n
618  *
619  * @param[in]   pc      pkgmgr_client
620  * @param[in]   appid   applicaiton id
621  * @param[in]   app_event_cb    user callback
622  * @param[in]   uid     user id
623  * @param[in]   data    user data
624  * @return      request_id (>0) if success, error code(<0) if fail\n
625  * @retval      PKGMGR_R_OK     success
626  * @retval      PKGMGR_R_EINVAL invalid argument
627  * @retval      PKGMGR_R_ECOMM  communication error
628 */
629 int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data);
630 int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid);
631
632 /**
633  * @brief       This API activates global app for user specified by uid.
634  *
635  * This API is for package-manager client application.\n
636  *
637  * @param[in]   pc      pkgmgr_client
638  * @param[in]   appid   applicaiton id
639  * @param[in]   app_event_cb    user callback
640  * @param[in]   uid     user id
641  * @param[in]   data    user data
642  * @return      request_id (>0) if success, error code(<0) if fail\n
643  * @retval      PKGMGR_R_OK     success
644  * @retval      PKGMGR_R_EINVAL invalid argument
645  * @retval      PKGMGR_R_ECOMM  communication error
646 */
647 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);
648
649 /**
650  * @brief       This API deletes application's private data.
651  *
652  * This API is for package-manager client application.\n
653  *
654  * @remarks     You should call this function with regular uid
655  * @param[in]   pc      pkgmgr_client
656  * @param[in]   pkg_type                package type
657  * @param[in]   pkgid   package id
658  * @param[in]   mode            installation mode  - PM_DEFAULT, PM_QUIET
659  * @return      request_id (>0) if success, error code(<0) if fail\n
660  * @retval      PKGMGR_R_OK     success
661  * @retval      PKGMGR_R_EINVAL invalid argument
662  * @retval      PKGMGR_R_ECOMM  communication error
663 */
664 int pkgmgr_client_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
665                                 const char *appid, pkgmgr_mode mode);
666 int pkgmgr_client_usr_clear_user_data(pkgmgr_client *pc, const char *pkg_type,
667                                 const char *appid, pkgmgr_mode mode, uid_t uid);
668 /**
669  * @brief       This API set status type to listen for the pkgmgr's broadcasting
670  *
671  * This API is for package-manager client application.\n
672  *
673  * @param[in]   pc      pkgmgr_client
674  * @param[in]   status_type     status type to listen
675  * @return      request_id (>0) if success, error code(<0) if fail\n
676  * @retval      PKGMGR_R_OK     success
677  * @retval      PKGMGR_R_EINVAL invalid argument
678 */
679 int pkgmgr_client_set_status_type(pkgmgr_client *pc, int status_type);
680
681 /**
682  * @brief       This API request to listen the pkgmgr's broadcasting
683  *
684  * This API is for package-manager client application.\n
685  *
686  * @param[in]   pc      pkgmgr_client
687  * @param[in]   event_cb        user callback
688  * @param[in]   data            user data
689  * @return      request_id (>0) if success, error code(<0) if fail\n
690  * @retval      PKGMGR_R_OK     success
691  * @retval      PKGMGR_R_EINVAL invalid argument
692 */
693 int pkgmgr_client_listen_status(pkgmgr_client *pc, pkgmgr_handler event_cb,
694                                     void *data);
695
696 /**
697  * @brief       This API request to listen the pkgmgr's broadcasting about apps
698  *
699  * This API is for package-manager client application.\n
700  *
701  * @param[in]   pc      pkgmgr_client
702  * @param[in]   event_cb        user callback
703  * @param[in]   data            user data
704  * @return      request_id (>0) if success, error code(<0) if fail\n
705  * @retval      PKGMGR_R_OK     success
706  * @retval      PKGMGR_R_EINVAL invalid argument
707 */
708 int pkgmgr_client_listen_app_status(pkgmgr_client *pc, pkgmgr_app_handler event_cb,
709                                     void *data);
710
711 /**
712  * @brief       This API request to stop listen the pkgmgr's broadcasting
713  *
714  * This API is for package-manager client application.\n
715  *
716  * @param[in]   pc      pkgmgr_client
717  * @return      0 if success, error code(<0) if fail\n
718  * @retval      PKGMGR_R_OK     success
719  * @retval      PKGMGR_R_EINVAL invalid argument
720  * @retval      PKGMGR_R_ERROR          internal error
721 */
722 int pkgmgr_client_remove_listen_status(pkgmgr_client *pc);
723
724 /**
725  * @brief       This API broadcasts pkgmgr's status
726  *
727  * This API is for package-manager client application.\n
728  *
729  * @param[in]   pc      pkgmgr_client
730  * @param[in]   pkg_type                package type
731  * @param[in]   pkgid   package id
732  * @param[in]   key             key to broadcast
733  * @param[in]   val             value to broadcast
734  * @return      0 if success, error code(<0) if fail\n
735  * @retval      PKGMGR_R_OK     success
736  * @retval      PKGMGR_R_EINVAL invalid argument
737 */
738 int pkgmgr_client_broadcast_status(pkgmgr_client *pc, const char *pkg_type,
739                                          const char *pkgid,  const char *key,
740                                          const char *val);
741
742 /**
743  * @brief       This API  gets the package's information.
744  *
745  *              This API is for package-manager client application.\n
746  *
747  * @param[in]   pkg_path                package file path to get infomation
748  * @return      package entry pointer if success, NULL if fail\n
749 */
750 pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path);
751
752 /**
753  * @brief       This API  get package information value
754  *
755  *              This API is for package-manager client application.\n
756  *
757  * @param[in]   pkg_info                        pointer for package info entry
758  * @return      0 if success, error code(<0) if fail\n
759 */
760 int pkgmgr_client_free_pkginfo(pkgmgr_info *pkg_info);
761
762 /**
763  * @brief       This API requests service
764  *
765  * This API is for package-manager client application.\n
766  *
767  * @param[in]   service_type            pkgmgr_request_service_type
768  * @param[in]   service_mode            mode which is used for addtional mode selection
769  * @param[in]   pc                      pkgmgr_client
770  * @param[in]   pkg_type                package type
771  * @param[in]   pkgid                   package id
772  * @param[in]   custom_info             custom information which is used for addtional information
773  * @param[in]   event_cb                user callback
774  * @param[in]   data                    user data
775  * @return      request_id (>0) if success, error code(<0) if fail\n
776  * @retval      PKGMGR_R_OK     success
777  * @retval      PKGMGR_R_EINVAL invalid argument
778  * @retval      PKGMGR_R_ECOMM  communication error
779 */
780 int pkgmgr_client_request_service(pkgmgr_request_service_type service_type, int service_mode,
781                                         pkgmgr_client *pc, const char *pkg_type, const char *pkgid,
782                                         const char *custom_info, pkgmgr_handler event_cb, void *data);
783 int pkgmgr_client_usr_request_service(pkgmgr_request_service_type service_type, int service_mode,
784                                         pkgmgr_client *pc, const char *pkg_type, const char *pkgid, uid_t uid,
785                                         const char *custom_info, pkgmgr_handler event_cb, void *data);
786 /**
787  * @brief       This API get package size
788  *
789  * This API is for package-manager client application.\n
790  *
791  * @param[in]   pc                              pkgmgr_client
792  * @param[in]   pkgid                   package id
793  * @param[in]   get_type                type for pkgmgr client request to get package size
794  * @param[in]   event_cb                user callback
795  * @param[in]   data                    user data
796  * @return      request_id (>0) if success, error code(<0) if fail\n
797  * @retval      PKGMGR_R_OK     success
798  * @retval      PKGMGR_R_EINVAL invalid argument
799  * @retval      PKGMGR_R_ECOMM  communication error
800 */
801 int pkgmgr_client_get_size(pkgmgr_client *pc, const char *pkgid, pkgmgr_getsize_type get_type, pkgmgr_handler event_cb, void *data);
802 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);
803
804 /**
805  * @brief               Gets the package size information.
806  * @details             The package size info is asynchronously obtained by the specified callback function.
807  *
808  * @param[in] pc                The pointer to pkgmgr_client instance
809  * @param[in] pkgid             The package ID
810  * @param[in] result_cb The asynchronous callback function to get the package size information
811  * @param[in] user_data User data to be passed to the callback function
812  *
813  * @return 0 on success, otherwise a negative error value
814  * @retval #PKGMGR_R_OK                 Successful
815  * @retval #PKGMGR_R_EINVAL             Invalid parameter
816  * @retval #PKGMGR_R_ERROR              Internal error
817  */
818 int pkgmgr_client_get_package_size_info(pkgmgr_client *pc, const char *pkgid, pkgmgr_pkg_size_info_receive_cb result_cb, void *user_data);
819 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);
820
821 /**
822  * @brief               Gets the sum of the entire package size information.
823  * @details             The package size info is asynchronously obtained by the specified callback function.
824  *
825  * @param[in] pc                The pointer to pkgmgr_client instance
826  * @param[in] result_cb The asynchronous callback function to get the total package size information
827  * @param[in] user_data User data to be passed to the callback function
828  *
829  * @return 0 on success, otherwise a negative error value
830  * @retval #PKGMGR_R_OK                 Successful
831  * @retval #PKGMGR_R_EINVAL             Invalid parameter
832  * @retval #PKGMGR_R_ERROR              Internal error
833  */
834 int pkgmgr_client_get_total_package_size_info(pkgmgr_client *pc, pkgmgr_total_pkg_size_info_receive_cb result_cb, void *user_data);
835 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);
836
837 /**
838  * @brief       This API removes cache directories
839  *
840  * This API is for package-manager client application.\n
841  *
842  * @remarks     You should call this function with regular uid
843  * @param[in]   pkgid                   package id
844  * @return      0 if success, error code(<0) if fail\n
845  * @retval      PKGMGR_R_OK     success
846  * @retval      PKGMGR_R_EINVAL invalid argument
847  * @retval      PKGMGR_R_EPRIV privilege denied
848  * @retval      PKGMGR_R_ERROR  internal error
849 */
850 int pkgmgr_client_clear_cache_dir(const char *pkgid);
851 int pkgmgr_client_usr_clear_cache_dir(const char *pkgid, uid_t uid);
852
853 /**
854  * @brief       This API removes all cache directories
855  *
856  * This API is for package-manager client application.\n
857  *
858  * @remarks     You should call this function with regular uid
859  * @return      0 if success, error code(<0) if fail\n
860  * @retval      PKGMGR_R_OK     success
861  * @retval      PKGMGR_R_EINVAL invalid argument
862  * @retval      PKGMGR_R_EPRIV privilege denied
863  * @retval      PKGMGR_R_ERROR  internal error
864 */
865 int pkgmgr_client_clear_all_cache_dir(void);
866 int pkgmgr_client_usr_clear_all_cache_dir(uid_t uid);
867
868 /**
869  * @brief       Generates request for getting license
870  *
871  * This API generates request for getting license.\n
872  *
873  * @remarks     You must release @a req_data and @a license_url by yourself.
874  * @param[in]   pc      The pointer to pkgmgr_client instance
875  * @param[in]   resp_data       The response data string of the purchase request
876  * @param[out]  req_data        License request data
877  * @param[out]  license_url     License acquisition url data
878  * @return      0 if success, error code(<0) if fail\n
879  * @retval      PKGMGR_R_OK     success
880  * @retval      PKGMGR_R_EINVAL invalid argument
881  * @retval      PKGMGR_R_ECOMM  communication error
882  * @retval      PKGMGR_R_EPRIV  privilege denied
883  * @retval      PKGMGR_R_ESYSTEM        severe system error
884  */
885 int pkgmgr_client_generate_license_request(pkgmgr_client *pc, const char *resp_data, char **req_data, char **license_url);
886
887 /**
888  * @brief       Registers encrypted license
889  *
890  * This API registers encrypted license.\n
891  *
892  * @param[in]   pc      The pointer to pkgmgr_client instance
893  * @param[in]   resp_data       The response data string of the purchase request
894  * @return      0 if success, error code(<0) if fail\n
895  * @retval      PKGMGR_R_OK     success
896  * @retval      PKGMGR_R_EINVAL invalid argument
897  * @retval      PKGMGR_R_ECOMM  communication error
898  * @retval      PKGMGR_R_EPRIV privilege denied
899  * @retval      PKGMGR_R_ESYSTEM        severe system error
900  */
901 int pkgmgr_client_register_license(pkgmgr_client *pc, const char *resp_data);
902
903 /**
904  * @brief       Decrypts contents which is encrypted
905  *
906  * This API decrypts contents which is encrypted.\n
907  *
908  * @param[in]   pc      The pointer to pkgmgr_client instance
909  * @param[in]   drm_file_path   The pointer to pkgmgr_client instance
910  * @param[in]   decrypted_file_path     The pointer to pkgmgr_client instance
911  * @return      0 if success, error code(<0) if fail\n
912  * @retval      PKGMGR_R_OK     success
913  * @retval      PKGMGR_R_EINVAL invalid argument
914  * @retval      PKGMGR_R_ECOMM  communication error
915  * @retval      PKGMGR_R_EPRIV privilege denied
916  * @retval      PKGMGR_R_ESYSTEM        severe system error
917  */
918 int pkgmgr_client_decrypt_package(pkgmgr_client *pc, const char *drm_file_path, const char *decrypted_file_path);
919
920 /**
921  * @brief       This API is enabled the splash screen
922  *
923  * This API is for package-manager client application.\n
924  *
925  * @param[in]   pc      pkgmgr_client
926  * @param[in]   appid   applicaiton id
927  * @return      request_id (>0) if success, error code(<0) if fail\n
928  * @retval      PKGMGR_R_OK             success
929  * @retval      PKGMGR_R_EINVAL         invalid argument
930  * @retval      PKGMGR_R_ECOMM          communication error
931  * @retval      PKGMGR_R_ENOMEM         out of memory
932  */
933 int pkgmgr_client_enable_splash_screen(pkgmgr_client *pc, const char *appid);
934 int pkgmgr_client_usr_enable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
935
936 /**
937  * @brief       This API is disabled the splash screen
938  *
939  * This API is for package-manager client application.\n
940  *
941  * @param[in]   pc      pkgmgr_client
942  * @param[in]   appid   applicaiton id
943  * @return      request_id (>0) if success, error code(<0) if fail\n
944  * @retval      PKGMGR_R_OK             success
945  * @retval      PKGMGR_R_EINVAL         invalid argument
946  * @retval      PKGMGR_R_ECOMM          communication error
947  * @retval      PKGMGR_R_ENOMEM         out of memory
948  */
949 int pkgmgr_client_disable_splash_screen(pkgmgr_client *pc, const char *appid);
950 int pkgmgr_client_usr_disable_splash_screen(pkgmgr_client *pc, const char *appid, uid_t uid);
951
952 /**
953  * @brief       Set restriction mode
954  *
955  * This API set restriction mode bit.\n
956  *
957  * @param[in]   pc      The pointer to pkgmgr_client instance
958  * @param[in]   mode    restriction mode bit
959  * @return      0 if success, error code(<0) if fail\n
960  * @retval      PKGMGR_R_OK     success
961  * @retval      PKGMGR_R_EINVAL invalid argument
962  * @retval      PKGMGR_R_ECOMM  communication error
963  * @retval      PKGMGR_R_EPRIV privilege denied
964  * @see pkgmgr_restriction_mode
965  */
966 int pkgmgr_client_set_restriction_mode(pkgmgr_client *pc, int mode);
967 int pkgmgr_client_usr_set_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
968
969 /**
970  * @brief       Unset restriction mode
971  *
972  * This API unset restriction mode bit.\n
973  *
974  * @param[in]   pc      The pointer to pkgmgr_client instance
975  * @param[in]   mode    restriction mode bit
976  * @return      0 if success, error code(<0) if fail\n
977  * @retval      PKGMGR_R_OK     success
978  * @retval      PKGMGR_R_EINVAL invalid argument
979  * @retval      PKGMGR_R_ECOMM  communication error
980  * @retval      PKGMGR_R_EPRIV privilege denied
981  * @see pkgmgr_restriction_mode
982  */
983 int pkgmgr_client_unset_restriction_mode(pkgmgr_client *pc, int mode);
984 int pkgmgr_client_usr_unset_restriction_mode(pkgmgr_client *pc, int mode, uid_t uid);
985
986 /**
987  * @brief       Get restriction mode
988  *
989  * This API gets restriction mode bit.\n
990  *
991  * @param[in]   pc      The pointer to pkgmgr_client instance
992  * @param[out]  mode    restriction mode bit
993  * @return      0 if success, error code(<0) if fail\n
994  * @retval      PKGMGR_R_OK     success
995  * @retval      PKGMGR_R_EINVAL invalid argument
996  * @retval      PKGMGR_R_ECOMM  communication error
997  * @retval      PKGMGR_R_EPRIV privilege denied
998  * @see pkgmgr_restriction_mode
999  */
1000 int pkgmgr_client_get_restriction_mode(pkgmgr_client *pc, int *mode);
1001 int pkgmgr_client_usr_get_restriction_mode(pkgmgr_client *pc, int *mode, uid_t uid);
1002
1003 /**
1004  * @brief       Set restriction mode bit for package specified.
1005  * @details     You can combine multiple status using OR operation which you want to restrict.
1006  *
1007  * This API sets restriction bit for pkg operation to not allow user to do it.\n
1008  *
1009  * @param[in]   pc      The pointer to pkgmgr_client instance
1010  * @param[in]   pkgid   pkgid  to be restricted
1011  * @param[in]  mode restriction mode bit
1012  * @return      0 if success, error code(<0) if fail\n
1013  * @retval      PKGMGR_R_OK     success
1014  * @retval      PKGMGR_R_EINVAL invalid argument
1015  * @retval      PKGMGR_R_ECOMM  communication error
1016  * @retval      PKGMGR_R_EPRIV privilege denied
1017  * @see pkgmgr_restriction_mode
1018  */
1019 int pkgmgr_client_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1020 int pkgmgr_client_usr_set_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1021
1022 /**
1023  * @brief       Unset restriction mode bit for package specified
1024  * @details     You can combine multiple status using OR operation which you want to unset
1025  *
1026  * This API unsets restriction bit to remove restriction of pkg operation.
1027  *
1028  * @param[in]   pc      The pointer to pkgmgr_client instance
1029  * @param[in]   pkgid   pkg id to be remove in restriction.
1030  * @param[in]  mode restriction mode bit
1031  * @return      0 if success, error code(<0) if fail\n
1032  * @retval      PKGMGR_R_OK     success
1033  * @retval      PKGMGR_R_EINVAL invalid argument
1034  * @retval      PKGMGR_R_ECOMM  communication error
1035  * @retval      PKGMGR_R_EPRIV privilege denied
1036  * @see pkgmgr_restriction_mode
1037  */
1038 int pkgmgr_client_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode);
1039 int pkgmgr_client_usr_unset_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int mode, uid_t uid);
1040
1041 /**
1042  * @brief       Get restriction bit of package operation
1043  *
1044  * This API gets restriction bit for restricted package operation.\n
1045  *
1046  * @param[in]   pc      The pointer to pkgmgr_client instance
1047  * @param[in]   pkgid   pkg id to be remove in restriction.
1048  * @param[out]  mode    restriction mode bit
1049  * @return      0 if success, error code(<0) if fail\n
1050  * @retval      PKGMGR_R_OK     success
1051  * @retval      PKGMGR_R_EINVAL invalid argument
1052  * @retval      PKGMGR_R_ECOMM  communication error
1053  * @retval      PKGMGR_R_EPRIV privilege denied
1054  * @see pkgmgr_restriction_mode
1055  */
1056 int pkgmgr_client_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode);
1057 int pkgmgr_client_usr_get_pkg_restriction_mode(pkgmgr_client *pc, const char *pkgid, int *mode, uid_t uid);
1058
1059 /**
1060  * @brief       Change application's label
1061  *
1062  * This API sets label of application specified.\n
1063  *
1064  * @param[in]   pc      The pointer to pkgmgr_client instance
1065  * @param[in]   appid   app id to be changed.
1066  * @param[in]   label   application's label to change.
1067  * @param[out]  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  */
1073 int pkgmgr_client_set_app_label(pkgmgr_client *pc, char *appid, char *label);
1074 int pkgmgr_client_usr_set_app_label(pkgmgr_client *pc, char *appid, char *label, uid_t uid);
1075
1076 /**
1077  * @brief       Change application's icon
1078  *
1079  * This API sets icon of application specified.\n
1080  *
1081  * @param[in]   pc              The pointer to pkgmgr_client instance
1082  * @param[in]   appid           app id to be changed.
1083  * @param[in]   icon_path       application's icon path to change.
1084  * @return      0 if success, error code(<0) if fail\n
1085  * @retval      PKGMGR_R_OK     success
1086  * @retval      PKGMGR_R_EINVAL invalid argument
1087  * @retval      PKGMGR_R_ECOMM  communication error
1088  */
1089 int pkgmgr_client_set_app_icon(pkgmgr_client *pc, char *appid, char *icon_path);
1090 int pkgmgr_client_usr_set_app_icon(pkgmgr_client *pc, char *appid, char *icon_path, uid_t uid);
1091
1092 /**
1093  * @brief       Set debug mode
1094  *
1095  * This API sets debug mode value for request.\n
1096  *
1097  * @param[in]   pc      The pointer to pkgmgr_client instance
1098  * @param[in]   debug_mode      indicates the request is debug mode or not
1099  * @return      0 if success, error code(<0) if fail\n
1100  * @retval      PKGMGR_R_OK     success
1101  * @retval      PKGMGR_R_EINVAL invalid argument
1102  */
1103 int pkgmgr_client_set_debug_mode(pkgmgr_client *pc, bool debug_mode);
1104
1105 /**
1106  * @brief       Set skip optimization
1107  *
1108  * This API sets skip optimization value for request.\n
1109  *
1110  * @param[in]   pc      The pointer to pkgmgr_client instance
1111  * @param[in]   skip_optimization       indicates the request is skip optimization or not
1112  * @return      0 if success, error code(<0) if fail\n
1113  * @retval      PKGMGR_R_OK     success
1114  * @retval      PKGMGR_R_EINVAL invalid argument
1115  */
1116 int pkgmgr_client_set_skip_optimization(pkgmgr_client *pc, bool skip_optimization);
1117
1118 /**
1119  * @brief       Migrate legacy external image which is generated under 3.0
1120  *
1121  * This API request the migration of external image.\n
1122  *
1123  * @param[in]   pc      The pointer to pkgmgr_client instance
1124  * @param[in]   pkgid   pkg id which have legacy image
1125  * @return      0 if success, error code(<0) if fail\n
1126  * @retval      PKGMGR_R_OK     success
1127  * @retval      PKGMGR_R_EINVAL invalid argument
1128  */
1129 int pkgmgr_client_usr_migrate_external_image(pkgmgr_client *pc, const char *pkgid, uid_t uid);
1130
1131 /** @} */
1132
1133
1134 #ifdef __cplusplus
1135 }
1136 #endif
1137 #endif                          /* __PKG_MANAGER_H__ */
1138 /**
1139  * @}
1140  * @}
1141  */
1142