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 OHOS_AAFWK_ABILITY_MANAGER_ERRORS_H 17 #define OHOS_AAFWK_ABILITY_MANAGER_ERRORS_H 18 19 #include "errors.h" 20 21 namespace OHOS { 22 namespace AAFwk { 23 enum { 24 /** 25 * Module type: Ability Manager Service side 26 */ 27 ABILITY_MODULE_TYPE_SERVICE = 0, 28 /** 29 * Module type: ABility Kit side 30 */ 31 ABILITY_MODULE_TYPE_KIT = 1 32 }; 33 34 // offset of aafwk error, only be used in this file. 35 constexpr ErrCode AAFWK_SERVICE_ERR_OFFSET = ErrCodeOffset(SUBSYS_AAFWK, ABILITY_MODULE_TYPE_SERVICE); 36 37 enum { 38 /** 39 * Result(2097152) for StartAbility: An error of the Want could not be resolved 40 * to ability info from BMS or DistributedMS. 41 */ 42 RESOLVE_ABILITY_ERR = AAFWK_SERVICE_ERR_OFFSET, 43 /** 44 * Result(2097153) for Connect: An error of the get ability service. 45 */ 46 GET_ABILITY_SERVICE_FAILED, 47 /** 48 * Result(2097154) for Connect State: An error of the the ability service not connect. 49 */ 50 ABILITY_SERVICE_NOT_CONNECTED, 51 /** 52 * Result(2097155) for StartAbility: An error of the Want could not be resolved 53 * to app info from BMS or DistributedMS. 54 */ 55 RESOLVE_APP_ERR, 56 /** 57 * Result(2097156) for StartAbility: An error of getting ability stack manager object. 58 */ 59 STACK_MANAGER_NOT_EXIST, 60 /** 61 * Result(2097157) for StartAbility: The ability to start is already at the top. 62 */ 63 ABILITY_EXISTED, 64 /** 65 * Result(2097158) for StartAbility: An error to create mission stack. 66 */ 67 CREATE_MISSION_STACK_FAILED, 68 /** 69 * Result(2097159) for StartAbility: An error to create mission record. 70 */ 71 CREATE_MISSION_RECORD_FAILED, 72 /** 73 * Result(2097160) for StartAbility: An error to create ability record. 74 */ 75 CREATE_ABILITY_RECORD_FAILED, 76 /** 77 * Result(2097161) for StartAbility: The ability to start is waiting. 78 */ 79 START_ABILITY_WAITING, 80 /** 81 * Result(2097162) for TerminateAbility: Don't allow to terminate launcher. 82 */ 83 TERMINATE_LAUNCHER_DENIED, 84 /** 85 * Result(2097163) for DisconnectAbility: Connection not exist. 86 */ 87 CONNECTION_NOT_EXIST, 88 /** 89 * Result(2097164) for DisconnectAbility:Connection is invalid state. 90 */ 91 INVALID_CONNECTION_STATE, 92 /** 93 * Result(2097165) for LoadctAbility:LoadAbility timeout. 94 */ 95 LOAD_ABILITY_TIMEOUT, 96 /** 97 * Result(2097166) for DisconnectAbility:Connection timeout. 98 */ 99 CONNECTION_TIMEOUT, 100 /** 101 * Result(2097167) for start service: An error of the get BundleManagerService. 102 */ 103 GET_BUNDLE_MANAGER_SERVICE_FAILED, 104 /** 105 * Result(2097168) for Remove mission: target mission is not in default stack. 106 */ 107 REMOVE_MISSION_ID_NOT_EXIST, 108 /** 109 * Result(2097169) for Remove mission: Don't allow to remove mission which has launcher ability. 110 */ 111 REMOVE_MISSION_LAUNCHER_DENIED, 112 /** 113 * Result(2097170) for Remove mission: Don't allow to remove mission which has active ability. 114 */ 115 REMOVE_MISSION_ACTIVE_DENIED, 116 /** 117 * Result(2097171) for Remove mission: An error of removing mission. 118 */ 119 REMOVE_MISSION_FAILED, 120 /** 121 * Result(2097172) for All: An error occurs in server. 122 */ 123 INNER_ERR, 124 /** 125 * Result(2097173) for Get recent mission: get recent missions failed 126 */ 127 GET_RECENT_MISSIONS_FAILED, 128 /** 129 * Result(2097174) for Remove stack: Don't allow to remove stack which has launcher ability. 130 */ 131 REMOVE_STACK_LAUNCHER_DENIED, 132 /** 133 * Result(2097175) for Remove stack: An error of removing stack. 134 */ 135 REMOVE_STACK_FAILED, 136 /** 137 * Result(2097176) for Remove stack: mission stack is empty 138 */ 139 MISSION_STACK_LIST_IS_EMPTY, 140 /** 141 * Result(2097177) for Remove stack: target stack is not exist. 142 */ 143 REMOVE_STACK_ID_NOT_EXIST, 144 /** 145 * Result(2097178) for ConnectAbility:target ability is not service ability. 146 */ 147 TARGET_ABILITY_NOT_SERVICE, 148 /** 149 * Result(2097179) for TerminateAbility:target service has a record of connect. It cannot be stopped. 150 */ 151 TERMINATE_SERVICE_IS_CONNECTED, 152 /** 153 * Result(2097180) for StartAbility:The ability to start is already activing.. 154 */ 155 START_SERVICE_ABILITY_ACTIVING, 156 /** 157 * Result(2097181) for move mission to top: An error of moving stack. 158 */ 159 MOVE_MISSION_FAILED, 160 /** 161 * Result(2097182) for kill process: An error of kill process. 162 */ 163 KILL_PROCESS_FAILED, 164 /** 165 * Result(2097183) for uninstall app: An error of uninstall app. 166 */ 167 UNINSTALL_APP_FAILED, 168 /** 169 * Result(2097184) for terminate ability result: An error of terminate service. 170 */ 171 TERMINATE_ABILITY_RESULT_FAILED, 172 /** 173 * Result(2097185) for check permission failed. 174 */ 175 CHECK_PERMISSION_FAILED, 176 /** 177 * Result(2097186) for waiting ability lifecycle complete. 178 */ 179 POWER_OFF_WAITING, 180 /** 181 * Result(2097187) for power off failed. 182 */ 183 POWER_OFF_FAILED, 184 /** 185 * Result(2097188) for power on failed. 186 */ 187 POWER_ON_FAILED, 188 /** 189 * Result(2097189) for ability no first in mission. 190 */ 191 NO_FIRST_IN_MISSION, 192 193 /** 194 * Result(2097190) for lock mission errors. 195 */ 196 LOCK_MISSION_DENY_FAILED, 197 198 /** 199 * Result(2097191) for unlock mission errors. 200 */ 201 UNLOCK_MISSION_DENY_FAILED, 202 203 /** 204 * Result(2097192) for set mission info errors. 205 */ 206 SET_MISSION_INFO_FAILED, 207 208 /** 209 * Result(2097193) for system is lock mission state. 210 */ 211 LOCK_MISSION_STATE_DENY_REQUEST, 212 213 /** 214 * Result(2097194) for move mission to stack: out of size of moving mission. 215 */ 216 MOVE_MISSION_TO_STACK_OUT_OF_SIZE, 217 218 /** 219 * Result(2097195) for move mission to stack: moving missions are not same window mode. 220 */ 221 MOVE_MISSION_TO_STACK_NOT_SAME_WIN_MODE, 222 223 /** 224 * Result(2097196) for move mission to stack: moving mission is not exist. 225 */ 226 MOVE_MISSION_TO_STACK_NOT_EXIST_MISSION, 227 228 /** 229 * Result(2097197) for move mission to stack: target mission or ability can't support multi window display. 230 */ 231 MOVE_MISSION_TO_STACK_NOT_SUPPORT_MULTI_WIN, 232 233 /** 234 * Result(2097198) for move mission to stack: target mission stack size is overflow. 235 */ 236 MOVE_MISSION_TO_STACK_TARGET_STACK_OVERFLOW, 237 238 /** 239 * Result(2097199) for move mission to stack: already in moving state, request is denied. 240 */ 241 MOVE_MISSION_TO_STACK_MOVING_DENIED, 242 243 /** 244 * Result(2097200) for minimize multi window failed. 245 */ 246 MINIMIZE_MULTI_WINDOW_FAILED, 247 248 /** 249 * Result(2097201) for maximize multiwindow: target mission is not exist in multiwindow stack. 250 */ 251 MAXIMIZE_MULTIWINDOW_NOT_EXIST, 252 253 /** 254 * Result(2097202) for maximize multi window failed. 255 */ 256 MAXIMIZE_MULTIWINDOW_FAILED, 257 258 /** 259 * Result(2097203) for change focus ability failed. 260 */ 261 CHANGE_FOCUS_ABILITY_FAILED, 262 263 /** 264 * Result(2097204) for get floating stack failed 265 */ 266 GET_FLOATING_STACK_FAILED, 267 268 /** 269 * Result(2097205) for close multi window failed 270 */ 271 CLOSE_MULTI_WINDOW_FAILED, 272 273 /** 274 * Result(2097206) for start ability by setting failed 275 */ 276 START_ABILITY_SETTING_FAILED, 277 278 /** 279 * Result(2097207) for start ability by setting ,the ability not support multiwindow. 280 */ 281 START_ABILITY_SETTING_NOT_SUPPORT_MULTI_WIN, 282 283 /** 284 * Result(2097208) for no found abilityrecord by caller 285 */ 286 NO_FOUND_ABILITY_BY_CALLER, 287 288 /** 289 * Result(2097209) for ability visible attribute is false. 290 */ 291 ABILITY_VISIBLE_FALSE_DENY_REQUEST, 292 293 /** 294 * Result(2097210) for caller is not systemapp. 295 */ 296 CALLER_ISNOT_SYSTEMAPP, 297 298 /** 299 * Result(2097211) for get bundleName by uid fail. 300 */ 301 GET_BUNDLENAME_BY_UID_FAIL, 302 303 /** 304 * Result(2097212) for set Permit list fail. 305 */ 306 SET_WHITE_LIST_FAIL, 307 308 /** 309 * Result(2097213) for start ability failed,this ability is not on the Permit list 310 */ 311 START_ABILITY_NOT_ONTHE_WHITELIST, 312 313 /** 314 * Result(2097214) for misson not found. 315 */ 316 MISSION_NOT_FOUND, 317 318 /** 319 * Result(2097215) for get bundle info fail. 320 */ 321 GET_BUNDLE_INFO_FAILED, 322 323 /** 324 * Result(2097216) for KillProcess: keep alive process can not be killed 325 */ 326 KILL_PROCESS_KEEP_ALIVE, 327 328 /** 329 * Result(2097217) for clear the application data fail. 330 */ 331 CLEAR_APPLICATION_DATA_FAIL, 332 333 // for call ability 334 /** 335 * Result(2097218) for resolve ability failed, there is no permissions 336 */ 337 RESOLVE_CALL_NO_PERMISSIONS, 338 339 /** 340 * Result(2097219) for resolve ability failed, target ability not page or singleton 341 */ 342 RESOLVE_CALL_ABILITY_TYPE_ERR, 343 344 /** 345 * Result(2097220) for resolve ability failed, resolve failed. 346 */ 347 RESOLVE_CALL_ABILITY_INNER_ERR, 348 349 /** 350 * Result(2097221) for resolve ability failed, resolve failed. 351 */ 352 RESOLVE_CALL_ABILITY_VERSION_ERR, 353 354 /** 355 * Result(2097222) for release ability failed, release failed. 356 */ 357 RELEASE_CALL_ABILITY_INNER_ERR, 358 359 /** 360 * Result(2097216) for register remote mission listener fail. 361 */ 362 REGISTER_REMOTE_MISSION_LISTENER_FAIL, 363 364 /** 365 * Result(2097217) for unregister remote mission listener fail. 366 */ 367 UNREGISTER_REMOTE_MISSION_LISTENER_FAIL, 368 369 /** 370 * Result() for invalid userid. 371 */ 372 INVALID_USERID_VALUE, 373 374 /** 375 * Result() for start user test fail. 376 */ 377 START_USER_TEST_FAIL, 378 379 /** 380 * Result(2097220) for send usr1 sig to the process of not response fail. 381 */ 382 SEND_USR1_SIG_FAIL, 383 }; 384 385 enum { 386 /** 387 * Flag for use with {@link #GetRecentMissions}: return all missions 388 */ 389 RECENT_WITH_EXCLUDED = 0x0001, 390 /** 391 * Provides a list that does not contain any 392 * recent missions that currently are not available to the user. 393 */ 394 RECENT_IGNORE_UNAVAILABLE = 0x0002, 395 }; 396 } // namespace AAFwk 397 } // namespace OHOS 398 #endif // OHOS_AAFWK_ABILITY_MANAGER_ERRORS_H 399