ohos_abilitykit_sys/runtime/ability_runtime_common/
ability_runtime_common_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6
7pub type AbilityRuntimeResult = Result<(), AbilityRuntimeErrorCode>;
8#[cfg(feature = "api-13")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
10impl AbilityRuntimeErrorCode {
11    /// permission denied.
12    ///
13    /// Available since API-level: 15
14    #[cfg(feature = "api-15")]
15    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
16    pub const PERMISSION_DENIED: AbilityRuntimeErrorCode =
17        AbilityRuntimeErrorCode(const { core::num::NonZero::new(201).unwrap() });
18    /// Invalid parameters.
19    pub const PARAM_INVALID: AbilityRuntimeErrorCode =
20        AbilityRuntimeErrorCode(const { core::num::NonZero::new(401).unwrap() });
21    /// StartSelfUIAbility is not supported.
22    ///
23    /// Available since API-level: 15
24    #[cfg(feature = "api-15")]
25    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
26    pub const NOT_SUPPORTED: AbilityRuntimeErrorCode =
27        AbilityRuntimeErrorCode(const { core::num::NonZero::new(801).unwrap() });
28    /// No such ability.
29    ///
30    /// Available since API-level: 15
31    #[cfg(feature = "api-15")]
32    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
33    pub const NO_SUCH_ABILITY: AbilityRuntimeErrorCode =
34        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000001).unwrap() });
35    /// Incorrect ability type.
36    ///
37    /// Available since API-level: 15
38    #[cfg(feature = "api-15")]
39    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
40    pub const INCORRECT_ABILITY_TYPE: AbilityRuntimeErrorCode =
41        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000002).unwrap() });
42    /// The crowdtesting application expires.
43    ///
44    /// Available since API-level: 15
45    #[cfg(feature = "api-15")]
46    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
47    pub const CROWDTEST_EXPIRED: AbilityRuntimeErrorCode =
48        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000008).unwrap() });
49    /// The ability cannot be started in Wukong Mode.
50    ///
51    /// Available since API-level: 15
52    #[cfg(feature = "api-15")]
53    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
54    pub const WUKONG_MODE: AbilityRuntimeErrorCode =
55        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000009).unwrap() });
56    /// The context does not exist.
57    pub const CONTEXT_NOT_EXIST: AbilityRuntimeErrorCode =
58        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000011).unwrap() });
59    /// The app is controlled.
60    ///
61    /// Available since API-level: 15
62    #[cfg(feature = "api-15")]
63    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
64    pub const CONTROLLED: AbilityRuntimeErrorCode =
65        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000012).unwrap() });
66    /// The app is controlled by EDM.
67    ///
68    /// Available since API-level: 15
69    #[cfg(feature = "api-15")]
70    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
71    pub const EDM_CONTROLLED: AbilityRuntimeErrorCode =
72        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000013).unwrap() });
73    /// Cross-app start is not allowed.
74    ///
75    /// Available since API-level: 15
76    #[cfg(feature = "api-15")]
77    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
78    pub const CROSS_APP: AbilityRuntimeErrorCode =
79        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000018).unwrap() });
80    /// Internal error.
81    ///
82    /// Available since API-level: 15
83    #[cfg(feature = "api-15")]
84    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
85    pub const INTERNAL: AbilityRuntimeErrorCode =
86        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000050).unwrap() });
87    /// Not top ability.
88    ///
89    /// Available since API-level: 15
90    #[cfg(feature = "api-15")]
91    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
92    pub const NOT_TOP_ABILITY: AbilityRuntimeErrorCode =
93        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000053).unwrap() });
94    /// Setting visibility is disabled.
95    ///
96    /// Available since API-level: 17
97    #[cfg(feature = "api-17")]
98    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
99    pub const ABILITY_RUNTIME_ERROR_VISIBILITY_SETTING_DISABLED: AbilityRuntimeErrorCode =
100        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000067).unwrap() });
101    /// App clone or multi-instance is not supported.
102    ///
103    /// Available since API-level: 17
104    #[cfg(feature = "api-17")]
105    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
106    pub const MULTI_APP_NOT_SUPPORTED: AbilityRuntimeErrorCode =
107        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000072).unwrap() });
108    /// The app instance key is invalid.
109    ///
110    /// Available since API-level: 17
111    #[cfg(feature = "api-17")]
112    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
113    pub const INVALID_APP_INSTANCE_KEY: AbilityRuntimeErrorCode =
114        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000076).unwrap() });
115    /// The number of app instances reaches the limit.
116    ///
117    /// Available since API-level: 17
118    #[cfg(feature = "api-17")]
119    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
120    pub const UPPER_LIMIT_REACHED: AbilityRuntimeErrorCode =
121        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000077).unwrap() });
122    /// The multi-instance is not supported.
123    ///
124    /// Available since API-level: 17
125    #[cfg(feature = "api-17")]
126    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
127    pub const ABILITY_RUNTIME_ERROR_MULTI_INSTANCE_NOT_SUPPORTED: AbilityRuntimeErrorCode =
128        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000078).unwrap() });
129    /// The APP_INSTANCE_KEY cannot be specified.
130    ///
131    /// Available since API-level: 17
132    #[cfg(feature = "api-17")]
133    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
134    pub const APP_INSTANCE_KEY_NOT_SUPPORTED: AbilityRuntimeErrorCode =
135        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000079).unwrap() });
136    /// Failed to obtain the target application information.
137    ///
138    /// Available since API-level: 21
139    #[cfg(feature = "api-21")]
140    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
141    pub const GET_APPLICATION_INFO_FAILED: AbilityRuntimeErrorCode =
142        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000081).unwrap() });
143    /// Start UIAbility timeout.
144    ///
145    /// Available since API-level: 21
146    #[cfg(feature = "api-21")]
147    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
148    pub const START_TIMEOUT: AbilityRuntimeErrorCode =
149        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000133).unwrap() });
150    /// The API does not support being called in the main thread.
151    ///
152    /// Available since API-level: 21
153    #[cfg(feature = "api-21")]
154    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
155    pub const MAIN_THREAD_NOT_SUPPORTED: AbilityRuntimeErrorCode =
156        AbilityRuntimeErrorCode(const { core::num::NonZero::new(16000134).unwrap() });
157}
158#[repr(transparent)]
159/// Enumerates the error codes.
160///
161///
162/// Available since API-level: 13
163#[cfg(feature = "api-13")]
164#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
165#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
166pub struct AbilityRuntimeErrorCode(pub core::num::NonZero<::core::ffi::c_uint>);