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 FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_APPEXECFWK_ERRORS_H 17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_APPEXECFWK_ERRORS_H 18 19 #include "errors.h" 20 21 namespace OHOS { 22 enum { 23 APPEXECFWK_MODULE_COMMON = 0x00, 24 APPEXECFWK_MODULE_APPMGR = 0x01, 25 APPEXECFWK_MODULE_BUNDLEMGR = 0x02, 26 APPEXECFWK_MODULE_FORMMGR = 0x03, 27 APPEXECFWK_MODULE_APPEXECFWK = 0x08, 28 // Reserved 0x03 ~ 0x0f for new modules, Event related modules start from 0x10 29 APPEXECFWK_MODULE_EVENTMGR = 0x10 30 }; 31 32 // Error code for Common 33 constexpr ErrCode APPEXECFWK_COMMON_ERR_OFFSET = ErrCodeOffset(SUBSYS_APPEXECFWK, APPEXECFWK_MODULE_COMMON); 34 enum { 35 ERR_APPEXECFWK_SERVICE_NOT_READY = APPEXECFWK_COMMON_ERR_OFFSET + 1, 36 ERR_APPEXECFWK_SERVICE_NOT_CONNECTED, 37 ERR_APPEXECFWK_INVALID_UID, 38 ERR_APPEXECFWK_INVALID_PID, 39 ERR_APPEXECFWK_PARCEL_ERROR, 40 ERR_APPEXECFWK_FAILED_SERVICE_DIED, 41 ERR_APPEXECFWK_OPERATION_TIME_OUT, 42 }; 43 44 // Error code for AppMgr 45 constexpr ErrCode APPEXECFWK_APPMGR_ERR_OFFSET = ErrCodeOffset(SUBSYS_APPEXECFWK, APPEXECFWK_MODULE_APPMGR); 46 enum { 47 ERR_APPEXECFWK_ASSEMBLE_START_MSG_FAILED = APPEXECFWK_APPMGR_ERR_OFFSET + 1, 48 ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, 49 ERR_APPEXECFWK_BAD_APPSPAWN_CLIENT, 50 ERR_APPEXECFWK_BAD_APPSPAWN_SOCKET, 51 ERR_APPEXECFWK_SOCKET_READ_FAILED, 52 ERR_APPEXECFWK_SOCKET_WRITE_FAILED 53 }; 54 55 // Error code for BundleMgr 56 constexpr ErrCode APPEXECFWK_BUNDLEMGR_ERR_OFFSET = ErrCodeOffset(SUBSYS_APPEXECFWK, APPEXECFWK_MODULE_BUNDLEMGR); 57 enum { 58 // the install error code from 0x0001 ~ 0x0020. 59 ERR_APPEXECFWK_INSTALL_INTERNAL_ERROR = APPEXECFWK_BUNDLEMGR_ERR_OFFSET + 0x0001, // 8519681 60 ERR_APPEXECFWK_INSTALL_HOST_INSTALLER_FAILED, 61 ERR_APPEXECFWK_INSTALL_PARSE_FAILED, 62 ERR_APPEXECFWK_INSTALL_VERSION_DOWNGRADE, 63 ERR_APPEXECFWK_INSTALL_VERIFICATION_FAILED, 64 ERR_APPEXECFWK_INSTALL_PARAM_ERROR, 65 ERR_APPEXECFWK_INSTALL_PERMISSION_DENIED, 66 ERR_APPEXECFWK_INSTALL_ENTRY_ALREADY_EXIST, 67 ERR_APPEXECFWK_INSTALL_STATE_ERROR, 68 ERR_APPEXECFWK_INSTALL_FILE_PATH_INVALID, 69 ERR_APPEXECFWK_INSTALL_INVALID_HAP_NAME, 70 ERR_APPEXECFWK_INSTALL_INVALID_BUNDLE_FILE, 71 ERR_APPEXECFWK_INSTALL_INVALID_HAP_SIZE, 72 ERR_APPEXECFWK_INSTALL_GENERATE_UID_ERROR, 73 ERR_APPEXECFWK_INSTALL_INSTALLD_SERVICE_ERROR, 74 ERR_APPEXECFWK_INSTALL_BUNDLE_MGR_SERVICE_ERROR, 75 ERR_APPEXECFWK_INSTALL_ALREADY_EXIST, 76 ERR_APPEXECFWK_INSTALL_BUNDLENAME_NOT_SAME, 77 ERR_APPEXECFWK_INSTALL_VERSIONCODE_NOT_SAME, 78 ERR_APPEXECFWK_INSTALL_VERSIONNAME_NOT_SAME, 79 ERR_APPEXECFWK_INSTALL_VENDOR_NOT_SAME, 80 ERR_APPEXECFWK_INSTALL_RELEASETYPE_TARGET_NOT_SAME, 81 ERR_APPEXECFWK_INSTALL_RELEASETYPE_COMPATIBLE_NOT_SAME, 82 ERR_APPEXECFWK_INSTALL_VERSION_NOT_COMPATIBLE, 83 ERR_APPEXECFWK_INSTALL_INVALID_NUMBER_OF_ENTRY_HAP, 84 ERR_APPEXECFWK_INSTALL_DISK_MEM_INSUFFICIENT, 85 ERR_APPEXECFWK_INSTALL_GRANT_REQUEST_PERMISSIONS_FAILED, 86 ERR_APPEXECFWK_INSTALL_UPDATE_HAP_TOKEN_FAILED, 87 ERR_APPEXECFWK_INSTALL_SINGLETON_NOT_SAME, 88 ERR_APPEXECFWK_INSTALL_ZERO_USER_WITH_NO_SINGLETON, 89 ERR_APPEXECFWK_INSTALL_CHECK_SYSCAP_FAILED, 90 ERR_APPEXECFWK_INSTALL_APPTYPE_NOT_SAME, 91 ERR_APPEXECFWK_INSTALL_URI_DUPLICATE, 92 ERR_APPEXECFWK_INSTALL_NOT_UNIQUE_DISTRO_MODULE_NAME, 93 ERR_APPEXECFWK_INSTALL_INCONSISTENT_MODULE_NAME, 94 95 // signature errcode 96 ERR_APPEXECFWK_INSTALL_FAILED_INVALID_SIGNATURE_FILE_PATH, 97 ERR_APPEXECFWK_INSTALL_FAILED_BAD_BUNDLE_SIGNATURE_FILE, 98 ERR_APPEXECFWK_INSTALL_FAILED_NO_BUNDLE_SIGNATURE, 99 ERR_APPEXECFWK_INSTALL_FAILED_VERIFY_APP_PKCS7_FAIL, 100 ERR_APPEXECFWK_INSTALL_FAILED_PROFILE_PARSE_FAIL, 101 ERR_APPEXECFWK_INSTALL_FAILED_APP_SOURCE_NOT_TRUESTED, 102 ERR_APPEXECFWK_INSTALL_FAILED_BAD_DIGEST, 103 ERR_APPEXECFWK_INSTALL_FAILED_BUNDLE_INTEGRITY_VERIFICATION_FAILURE, 104 ERR_APPEXECFWK_INSTALL_FAILED_FILE_SIZE_TOO_LARGE, 105 ERR_APPEXECFWK_INSTALL_FAILED_BAD_PUBLICKEY, 106 ERR_APPEXECFWK_INSTALL_FAILED_BAD_BUNDLE_SIGNATURE, 107 ERR_APPEXECFWK_INSTALL_FAILED_NO_PROFILE_BLOCK_FAIL, 108 ERR_APPEXECFWK_INSTALL_FAILED_BUNDLE_SIGNATURE_VERIFICATION_FAILURE, 109 ERR_APPEXECFWK_INSTALL_FAILED_VERIFY_SOURCE_INIT_FAIL, 110 ERR_APPEXECFWK_INSTALL_FAILED_INCOMPATIBLE_SIGNATURE, 111 ERR_APPEXECFWK_INSTALL_FAILED_INCONSISTENT_SIGNATURE, 112 113 ERR_APPEXECFWK_PARSE_UNEXPECTED = APPEXECFWK_BUNDLEMGR_ERR_OFFSET + 0x00c8, // 8519880 114 ERR_APPEXECFWK_PARSE_MISSING_BUNDLE, 115 ERR_APPEXECFWK_PARSE_MISSING_ABILITY, 116 ERR_APPEXECFWK_PARSE_NO_PROFILE, 117 ERR_APPEXECFWK_PARSE_BAD_PROFILE, 118 ERR_APPEXECFWK_PARSE_PROFILE_PROP_TYPE_ERROR, 119 ERR_APPEXECFWK_PARSE_PROFILE_MISSING_PROP, 120 ERR_APPEXECFWK_PARSE_PERMISSION_ERROR, 121 ERR_APPEXECFWK_PARSE_PROFILE_PROP_CHECK_ERROR, 122 ERR_APPEXECFWK_PARSE_PROFILE_PROP_SIZE_CHECK_ERROR, 123 ERR_APPEXECFWK_PARSE_RPCID_FAILED, 124 125 ERR_APPEXECFWK_INSTALLD_PARAM_ERROR, 126 ERR_APPEXECFWK_INSTALLD_GET_PROXY_ERROR, 127 ERR_APPEXECFWK_INSTALLD_CREATE_DIR_FAILED, 128 ERR_APPEXECFWK_INSTALLD_CREATE_DIR_EXIST, 129 ERR_APPEXECFWK_INSTALLD_CHOWN_FAILED, 130 ERR_APPEXECFWK_INSTALLD_REMOVE_DIR_FAILED, 131 ERR_APPEXECFWK_INSTALLD_EXTRACT_FILES_FAILED, 132 ERR_APPEXECFWK_INSTALLD_RNAME_DIR_FAILED, 133 ERR_APPEXECFWK_INSTALLD_CLEAN_DIR_FAILED, 134 135 ERR_APPEXECFWK_UNINSTALL_SYSTEM_APP_ERROR, 136 ERR_APPEXECFWK_UNINSTALL_KILLING_APP_ERROR, 137 ERR_APPEXECFWK_UNINSTALL_INVALID_NAME, 138 ERR_APPEXECFWK_UNINSTALL_PARAM_ERROR, 139 ERR_APPEXECFWK_UNINSTALL_PERMISSION_DENIED, 140 ERR_APPEXECFWK_UNINSTALL_BUNDLE_MGR_SERVICE_ERROR, 141 ERR_APPEXECFWK_UNINSTALL_MISSING_INSTALLED_BUNDLE, 142 ERR_APPEXECFWK_UNINSTALL_MISSING_INSTALLED_MODULE, 143 144 ERR_APPEXECFWK_FAILED_GET_INSTALLER_PROXY, 145 ERR_APPEXECFWK_FAILED_GET_BUNDLE_INFO, 146 ERR_APPEXECFWK_FAILED_GET_ABILITY_INFO, 147 ERR_APPEXECFWK_FAILED_GET_RESOURCEMANAGER, 148 ERR_APPEXECFWK_FAILED_GET_REMOTE_PROXY, 149 ERR_APPEXECFWK_PERMISSION_DENIED, 150 151 ERR_APPEXECFWK_RECOVER_GET_BUNDLEPATH_ERROR = APPEXECFWK_BUNDLEMGR_ERR_OFFSET + 0x0201, // 8520193 152 ERR_APPEXECFWK_RECOVER_INVALID_BUNDLE_NAME, 153 154 ERR_APPEXECFWK_USER_NOT_EXIST = APPEXECFWK_BUNDLEMGR_ERR_OFFSET + 0x0301, 155 ERR_APPEXECFWK_USER_CREATE_FALIED, 156 ERR_APPEXECFWK_USER_REMOVE_FALIED, 157 ERR_APPEXECFWK_USER_NOT_INSTALL_HAP, 158 }; 159 160 // Error code for FormMgr 161 constexpr ErrCode APPEXECFWK_FORMMGR_ERR_OFFSET = ErrCodeOffset(SUBSYS_APPEXECFWK, APPEXECFWK_MODULE_FORMMGR); 162 enum { 163 ERR_APPEXECFWK_FORM_COMMON_CODE = APPEXECFWK_FORMMGR_ERR_OFFSET + 1, 164 ERR_APPEXECFWK_FORM_PERMISSION_DENY, 165 ERR_APPEXECFWK_FORM_PERMISSION_DENY_BUNDLE, 166 ERR_APPEXECFWK_FORM_PERMISSION_DENY_SYS, 167 ERR_APPEXECFWK_FORM_GET_INFO_FAILED, 168 ERR_APPEXECFWK_FORM_GET_BUNDLE_FAILED, 169 ERR_APPEXECFWK_FORM_INVALID_PARAM, 170 ERR_APPEXECFWK_FORM_INVALID_FORM_ID, 171 ERR_APPEXECFWK_FORM_FORM_ID_NUM_ERR, 172 ERR_APPEXECFWK_FORM_FORM_ARRAY_ERR, 173 ERR_APPEXECFWK_FORM_RELEASE_FLG_ERR, 174 ERR_APPEXECFWK_FORM_REFRESH_TIME_NUM_ERR, 175 ERR_APPEXECFWK_FORM_INVALID_BUNDLENAME, 176 ERR_APPEXECFWK_FORM_INVALID_MODULENAME, 177 ERR_APPEXECFWK_FORM_INVALID_PROVIDER_DATA, 178 ERR_APPEXECFWK_FORM_INVALID_REFRESH_TIME, 179 ERR_APPEXECFWK_FORM_FORM_ID_ARRAY_ERR, 180 ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR, 181 ERR_APPEXECFWK_FORM_CFG_NOT_MATCH_ID, 182 ERR_APPEXECFWK_FORM_NOT_EXIST_ID, 183 ERR_APPEXECFWK_FORM_PROVIDER_DATA_EMPTY, 184 ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED, 185 ERR_APPEXECFWK_FORM_MAX_SYSTEM_FORMS, 186 ERR_APPEXECFWK_FORM_EXCEED_INSTANCES_PER_FORM, 187 ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF, 188 ERR_APPEXECFWK_FORM_PROVIDER_DEL_FAIL, 189 ERR_APPEXECFWK_FORM_MAX_FORMS_PER_CLIENT, 190 ERR_APPEXECFWK_FORM_MAX_SYSTEM_TEMP_FORMS, 191 ERR_APPEXECFWK_FORM_NO_SUCH_MODULE, 192 ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY, 193 ERR_APPEXECFWK_FORM_NO_SUCH_DIMENSION, 194 ERR_APPEXECFWK_FORM_FA_NOT_INSTALLED, 195 ERR_APPEXECFWK_FORM_MAX_REQUEST, 196 ERR_APPEXECFWK_FORM_MAX_REFRESH, 197 ERR_APPEXECFWK_FORM_GET_BMS_FAILED, 198 ERR_APPEXECFWK_FORM_GET_HOST_FAILED, 199 // error code in sdk 200 ERR_APPEXECFWK_FORM_GET_FMS_FAILED, 201 ERR_APPEXECFWK_FORM_SEND_FMS_MSG, 202 ERR_APPEXECFWK_FORM_FORM_DUPLICATE_ADDED, 203 ERR_APPEXECFWK_FORM_IN_RECOVER, 204 ERR_APPEXECFWK_FORM_GET_SYSMGR_FAILED 205 }; 206 constexpr ErrCode APPEXECFWK_APPEXECFWK_ERR_OFFSET = ErrCodeOffset(SUBSYS_APPEXECFWK, APPEXECFWK_MODULE_APPEXECFWK); 207 enum { 208 ERR_APPEXECFWK_CHECK_FAILED = APPEXECFWK_APPEXECFWK_ERR_OFFSET + 1, 209 ERR_APPEXECFWK_INTERCEPT_TASK_EXECUTE_SUCCESS 210 }; 211 212 } // namespace OHOS 213 214 #endif // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_APPEXECFWK_ERRORS_H 215