1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ERROR_MULTIMODAL_H 17 #define ERROR_MULTIMODAL_H 18 19 #include <climits> 20 #include <errors.h> 21 22 namespace OHOS { 23 namespace MMI { 24 inline constexpr int32_t ERROR_UNSUPPORT { -2 }; 25 inline constexpr int32_t ARGV_VALID { 2 }; 26 inline constexpr int32_t ERROR_NO_PERMISSION { -201 }; 27 inline constexpr int32_t ERROR_KEYBOARD_NO_PERMISSION { 201 }; 28 inline constexpr int32_t ERROR_NOT_SYSAPI { 202 }; 29 inline constexpr int32_t ERROR_DEVICE_NOT_EXIST { 3900001 }; 30 inline constexpr int32_t ERROR_OPERATION_FREQUENT { -1001 }; 31 inline constexpr int32_t ERROR_DEVICE_NOT_SUPPORTED { -1002 }; 32 inline constexpr int32_t ERROR_APP_NOT_FOCUSED { 3900009 }; 33 inline constexpr int32_t ERROR_DEVICE_NO_POINTER { 3900010 }; 34 35 enum class AUTHORIZE_QUERY_STATE : int32_t { 36 OTHER_PID_IN_AUTHORIZATION_SELECTION = 0, 37 OTHER_PID_AUTHORIZED = 1, 38 UNAUTHORIZED = 2, 39 CURRENT_PID_IN_AUTHORIZATION_SELECTION = 3, 40 CURRENT_PID_AUTHORIZED = 4 41 }; 42 43 enum { 44 MODULE_CLIENT = 0x00, 45 MODULE_EVENT_SIMULATE = 0x01, 46 MODULE_SERVER = 0x02, 47 MODULE_UTIL = 0x03 48 }; 49 50 enum : int32_t { 51 ERROR_INVALID_SUBSCRIBE_ID = INT_MIN, 52 ERROR_INIT_CLIENT_FAILED, 53 ERROR_SUBSCRIBE_SERVER_FAILED, 54 ERROR_SUBSCRIBEID_NOT_EXIST, 55 ERROR_UNSUBSCRIBE_SERVER_FAILED, 56 ERROR_FIND_SUBSCRIBEID_FAILED, 57 ERROR_ONE_PROCESS_ONLY_SUPPORT_ONE, 58 ERROR_ALLOC_SUBSCRIBEINFO_FAILED, 59 ERROR_NO_SUBSCRIBE_INPUT_ACTIVE, 60 ERROR_HAD_UNSUBSCRIBE_INPUT_ACTIVE, 61 }; 62 63 enum { 64 // 文件打开失败 65 FILE_OPEN_FAIL = ErrCodeOffset(SUBSYS_MULTIMODAINPUT, MODULE_EVENT_SIMULATE), 66 // 流缓冲读取失败 67 STREAM_BUF_READ_FAIL, 68 // 事件注册失败 69 EVENT_REG_FAIL, 70 // 参数注入失败 71 PARAM_INPUT_FAIL 72 }; 73 74 enum { 75 // 发送消息失败 76 MSG_SEND_FAIL = 0x3E20000, //ErrCodeOffset(SUBSYS_MULTIMODAINPUT, MODULE_SERVER), 77 // 未知的事件 78 UNKNOWN_EVENT, 79 // 空指针 80 ERROR_NULL_POINTER, 81 // libinput初始化失败 82 LIBINPUT_INIT_FAIL, 83 // 无效的输入参数 84 PARAM_INPUT_INVALID, 85 // memcpy安全函数错误 86 MEMCPY_SEC_FUN_FAIL, 87 // 键盘事件封装失败 88 KEY_EVENT_PKG_FAIL, 89 // 多设备相同事件返回标志 90 MULTIDEVICE_SAME_EVENT_MARK, 91 // GESTURE_SWIPE事件封装失败 92 GESTURE_EVENT_PKG_FAIL, 93 // SA_Service初始化错误 94 SASERVICE_INIT_FAIL, 95 // 增加session错误 96 ADD_SESSION_FAIL, 97 // make_shared错误 98 MAKE_SHARED_FAIL, 99 // fcntl 函数调用错误 100 FCNTL_FAIL, 101 // 写入数据错误 102 PACKET_WRITE_FAIL, 103 // 读取数据错误 104 PACKET_READ_FAIL, 105 // 初始化画鼠标失败 106 POINTER_DRAW_INIT_FAIL, 107 // 多模服务未启动 108 MMISERVICE_NOT_RUNNING, 109 // 代理任务启动失败 110 ETASKS_INIT_FAIL, 111 // 委托任务wait超时 112 ETASKS_WAIT_TIMEOUT, 113 // 委托任务wait延期 114 ETASKS_WAIT_DEFERRED, 115 // 生成同步任务失败 116 ETASKS_POST_SYNCTASK_FAIL, 117 // 生成异步任务失败 118 ETASKS_POST_ASYNCTASK_FAIL, 119 // DUMP参数错误 120 DUMP_PARAM_ERR, 121 // 过滤器增加失败 122 ERROR_FILTER_ADD_FAIL, 123 // buffer过长失败 124 ERROR_OVER_SIZE_BUFFER, 125 }; 126 127 enum { 128 // 非标准化事件 129 NON_STD_EVENT = ErrCodeOffset(SUBSYS_MULTIMODAINPUT, MODULE_UTIL), 130 // 未处理的消息 131 UNPROC_MSG, 132 // 未知消息ID 133 UNKNOWN_MSG_ID, 134 // EPOLL创建失败 135 EPOLL_CREATE_FAIL, 136 // 修改EPOLL失败 137 EPOLL_MODIFY_FAIL, 138 // 流缓冲写入失败 139 STREAM_BUF_WRITE_FAIL, 140 // 值不符合预期 141 VAL_NOT_EXP, 142 // 没有足够的内存 143 MEM_NOT_ENOUGH, 144 // 内存越界 145 MEM_OUT_OF_BOUNDS, 146 // 没有找到session 147 SESSION_NOT_FOUND, 148 // 监听增加失败 149 INVALID_MONITOR_MON, 150 // 权限校验失败 151 PERMISSION_DENIED, 152 // 功能不支持 153 CAPABILITY_NOT_SUPPORTED, 154 // 无相应产品配置或产品配置不合法 155 MMI_ERR_NO_PRODUCT_CONFIG, 156 }; 157 } // namespace MMI 158 } // namespace OHOS 159 #endif // ERROR_MULTIMODAL_H 160