1 /* 2 * Copyright (C) 2024 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 /** 17 * @addtogroup AbilityRuntime 18 * @{ 19 * 20 * @brief Provide the definition of the C interface for the native AbilityRuntime 21 * 22 * @syscap SystemCapability.Ability.AbilityRuntime.Core 23 * @since 13 24 */ 25 26 /** 27 * @file ability_runtime_common.h 28 * 29 * @brief Declare the common types for the native AbilityRuntime. 30 * 31 * @library libability_runtime.so 32 * @kit AbilityKit 33 * @syscap SystemCapability.Ability.AbilityRuntime.Core 34 * @since 13 35 */ 36 37 #ifndef ABILITY_RUNTIME_COMMON_H 38 #define ABILITY_RUNTIME_COMMON_H 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 44 /** 45 * @brief Enumerates the error codes. 46 * 47 * @since 13 48 */ 49 typedef enum { 50 /** @error No error. */ 51 ABILITY_RUNTIME_ERROR_CODE_NO_ERROR = 0, 52 /** 53 * @error permission denied. 54 * @since 15 55 */ 56 ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED = 201, 57 /** @error Invalid parameters. */ 58 ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID = 401, 59 /** 60 * @error StartSelfUIAbility is not supported. 61 * @since 15 62 */ 63 ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED = 801, 64 /** 65 * @error No such ability. 66 * @since 15 67 */ 68 ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY = 16000001, 69 /** 70 * @error Incorrect ability type. 71 * @since 15 72 */ 73 ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE = 16000002, 74 /** 75 * @error The crowdtesting application expires. 76 * @since 15 77 */ 78 ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED = 16000008, 79 /** 80 * @error The ability cannot be started in Wukong Mode. 81 * @since 15 82 */ 83 ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE = 16000009, 84 /** @error The context does not exist. */ 85 ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST = 16000011, 86 /** 87 * @error The app is controlled. 88 * @since 15 89 */ 90 ABILITY_RUNTIME_ERROR_CODE_CONTROLLED = 16000012, 91 /** 92 * @error The app is controlled by EDM. 93 * @since 15 94 */ 95 ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED = 16000013, 96 /** 97 * @error Cross-app start is not allowed. 98 * @since 15 99 */ 100 ABILITY_RUNTIME_ERROR_CODE_CROSS_APP = 16000018, 101 /** 102 * @error Internal error. 103 * @since 15 104 */ 105 ABILITY_RUNTIME_ERROR_CODE_INTERNAL = 16000050, 106 /** 107 * @error Not top ability. 108 * @since 15 109 */ 110 ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY = 16000053, 111 } AbilityRuntime_ErrorCode; 112 113 #ifdef __cplusplus 114 } 115 #endif 116 117 /** @} */ 118 #endif // ABILITY_RUNTIME_COMMON_H 119