4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 #ifndef _PKGMGR_SERVER_H_
24 #define _PKGMGR_SERVER_H_
26 #include <sys/types.h>
35 #define LOG_TAG "PKGMGR_SERVER"
38 #define ERR(fmt, args...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
42 #define DBG(fmt, args...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
46 #define INFO(fmt, args...) LOGI("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
49 #define MAX_REQ_ID_LEN 256
50 #define MAX_PKG_TYPE_LEN 128
51 #define MAX_PKG_NAME_LEN 256
52 #define MAX_PKG_ARGS_LEN 4096
53 #define DESKTOP_FILE_DIRS_NUM 1024
57 REQUEST_TYPE_MOUNT_INSTALL,
58 REQUEST_TYPE_REINSTALL,
59 REQUEST_TYPE_UNINSTALL,
61 REQUEST_TYPE_ENABLE_PKG,
62 REQUEST_TYPE_DISABLE_PKG,
63 REQUEST_TYPE_ENABLE_APP,
64 REQUEST_TYPE_DISABLE_APP,
66 REQUEST_TYPE_CLEARDATA,
67 REQUEST_TYPE_CLEARCACHE,
68 REQUEST_TYPE_ENABLE_GLOBAL_APP_FOR_UID,
69 REQUEST_TYPE_DISABLE_GLOBAL_APP_FOR_UID,
72 REQUEST_TYPE_GENERATE_LICENSE_REQUEST,
73 REQUEST_TYPE_REGISTER_LICENSE,
74 REQUEST_TYPE_DECRYPT_PACKAGE,
75 REQUEST_TYPE_ENABLE_APP_SPLASH_SCREEN,
76 REQUEST_TYPE_DISABLE_APP_SPLASH_SCREEN,
77 REQUEST_TYPE_SET_RESTRICTION_MODE,
78 REQUEST_TYPE_UNSET_RESTRICTION_MODE,
79 REQUEST_TYPE_GET_RESTRICTION_MODE,
82 gboolean queue_job(void *data);
83 int _return_value_to_caller(const char *req_key, GVariant *result);
84 int _init_request_handler(void);
85 void _fini_request_handler(void);
86 void _send_app_signal(uid_t uid, const char *req_id,
87 const char *pkgid, const char *appid,
88 const char *key, const char *val, int req_type);
89 void _send_fail_signal(struct backend_job *job);
90 int _set_restriction_mode(uid_t uid, const char *pkgid, int mode);
91 int _unset_restriction_mode(uid_t uid, const char *pkgid, int mode);
92 int _get_restriction_mode(uid_t uid, const char *pkgid, int *mode);
94 #endif/* _PKGMGR_SERVER_H_ */