Skip to main content

ohos_abilitykit_sys/runtime/application_context/
application_context_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#[cfg(feature = "api-15")]
7use crate::base::want::AbilityBase_Want;
8#[cfg(feature = "api-17")]
9use crate::runtime::start_options::AbilityRuntime_StartOptions;
10use crate::runtime::{AbilityRuntimeResult, AbilityRuntime_AreaMode};
11
12extern "C" {
13    /// Obtain the cache directory of the application.
14    ///
15    /// # Arguments
16    ///
17    /// * `buffer` - A pointer to a buffer that receives the cache directory of the application.
18    ///
19    /// * `bufferSize` - The length of the buffer.
20    ///
21    /// * `writeLength` - The string length actually written to the buffer,
22    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
23    ///
24    /// # Returns
25    ///
26    /// * The error code.
27    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
28    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
29    /// or the buffer size is less than the minimum buffer size.
30    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
31    ///
32    /// Available since API-level: 13
33    #[cfg(feature = "api-13")]
34    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
35    pub fn OH_AbilityRuntime_ApplicationContextGetCacheDir(
36        buffer: *mut ::core::ffi::c_char,
37        bufferSize: i32,
38        writeLength: *mut i32,
39    ) -> AbilityRuntimeResult;
40    /// Obtain the area mode of the application.
41    ///
42    /// # Arguments
43    ///
44    /// * `areaMode` - A pointer to the area mode.
45    ///
46    /// # Returns
47    ///
48    /// * The error code.
49    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
50    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the areaMode is null.
51    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
52    ///
53    /// Available since API-level: 13
54    #[cfg(feature = "api-13")]
55    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
56    pub fn OH_AbilityRuntime_ApplicationContextGetAreaMode(
57        areaMode: *mut AbilityRuntime_AreaMode,
58    ) -> AbilityRuntimeResult;
59    /// Obtain the bundle name.
60    ///
61    /// # Arguments
62    ///
63    /// * `buffer` - A pointer to a buffer that receives the bundle name.
64    ///
65    /// * `bufferSize` - The length of the buffer.
66    ///
67    /// * `writeLength` - The string length actually written to the buffer,
68    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
69    ///
70    /// # Returns
71    ///
72    /// * The error code.
73    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
74    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
75    /// or the buffer size is less than the minimum buffer size.
76    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
77    ///
78    /// Available since API-level: 13
79    #[cfg(feature = "api-13")]
80    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
81    pub fn OH_AbilityRuntime_ApplicationContextGetBundleName(
82        buffer: *mut ::core::ffi::c_char,
83        bufferSize: i32,
84        writeLength: *mut i32,
85    ) -> AbilityRuntimeResult;
86    /// Obtain the temp directory of the application.
87    ///
88    /// # Arguments
89    ///
90    /// * `buffer` - A pointer to a buffer that receives the temp directory of the application.
91    ///
92    /// * `bufferSize` - The length of the buffer.
93    ///
94    /// * `writeLength` - The string length actually written to the buffer,
95    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
96    ///
97    /// # Returns
98    ///
99    /// * The error code.
100    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
101    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
102    /// or the buffer size is less than the minimum buffer size.
103    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
104    ///
105    /// Available since API-level: 16
106    #[cfg(feature = "api-16")]
107    #[cfg_attr(docsrs, doc(cfg(feature = "api-16")))]
108    pub fn OH_AbilityRuntime_ApplicationContextGetTempDir(
109        buffer: *mut ::core::ffi::c_char,
110        bufferSize: i32,
111        writeLength: *mut i32,
112    ) -> AbilityRuntimeResult;
113    /// Obtain the files directory of the application.
114    ///
115    /// # Arguments
116    ///
117    /// * `buffer` - A pointer to a buffer that receives the files directory of the application.
118    ///
119    /// * `bufferSize` - The length of the buffer.
120    ///
121    /// * `writeLength` - The string length actually written to the buffer,
122    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
123    ///
124    /// # Returns
125    ///
126    /// * The error code.
127    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
128    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
129    /// or the buffer size is less than the minimum buffer size.
130    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
131    ///
132    /// Available since API-level: 16
133    #[cfg(feature = "api-16")]
134    #[cfg_attr(docsrs, doc(cfg(feature = "api-16")))]
135    pub fn OH_AbilityRuntime_ApplicationContextGetFilesDir(
136        buffer: *mut ::core::ffi::c_char,
137        bufferSize: i32,
138        writeLength: *mut i32,
139    ) -> AbilityRuntimeResult;
140    /// Obtain the database directory of the application.
141    ///
142    /// # Arguments
143    ///
144    /// * `buffer` - A pointer to a buffer that receives the database directory of the application.
145    ///
146    /// * `bufferSize` - The length of the buffer.
147    ///
148    /// * `writeLength` - The string length actually written to the buffer,
149    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
150    ///
151    /// # Returns
152    ///
153    /// * The error code.
154    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
155    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
156    /// or the buffer size is less than the minimum buffer size.
157    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
158    ///
159    /// Available since API-level: 16
160    #[cfg(feature = "api-16")]
161    #[cfg_attr(docsrs, doc(cfg(feature = "api-16")))]
162    pub fn OH_AbilityRuntime_ApplicationContextGetDatabaseDir(
163        buffer: *mut ::core::ffi::c_char,
164        bufferSize: i32,
165        writeLength: *mut i32,
166    ) -> AbilityRuntimeResult;
167    /// Obtain the preferences directory of the application.
168    ///
169    /// # Arguments
170    ///
171    /// * `buffer` - A pointer to a buffer that receives the preferences directory of the application.
172    ///
173    /// * `bufferSize` - The length of the buffer.
174    ///
175    /// * `writeLength` - The string length actually written to the buffer,
176    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
177    ///
178    /// # Returns
179    ///
180    /// * The error code.
181    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
182    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
183    /// or the buffer size is less than the minimum buffer size.
184    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
185    ///
186    /// Available since API-level: 16
187    #[cfg(feature = "api-16")]
188    #[cfg_attr(docsrs, doc(cfg(feature = "api-16")))]
189    pub fn OH_AbilityRuntime_ApplicationContextGetPreferencesDir(
190        buffer: *mut ::core::ffi::c_char,
191        bufferSize: i32,
192        writeLength: *mut i32,
193    ) -> AbilityRuntimeResult;
194    /// Obtain the bundle code directory of the application.
195    ///
196    /// # Arguments
197    ///
198    /// * `buffer` - A pointer to a buffer that receives the bundle code directory of the application.
199    ///
200    /// * `bufferSize` - The length of the buffer.
201    ///
202    /// * `writeLength` - The string length actually written to the buffer,
203    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
204    ///
205    /// # Returns
206    ///
207    /// * The error code.
208    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
209    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
210    /// or the buffer size is less than the minimum buffer size.
211    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
212    ///
213    /// Available since API-level: 16
214    #[cfg(feature = "api-16")]
215    #[cfg_attr(docsrs, doc(cfg(feature = "api-16")))]
216    pub fn OH_AbilityRuntime_ApplicationContextGetBundleCodeDir(
217        buffer: *mut ::core::ffi::c_char,
218        bufferSize: i32,
219        writeLength: *mut i32,
220    ) -> AbilityRuntimeResult;
221    /// Obtain the distributed files directory of the application.
222    ///
223    /// # Arguments
224    ///
225    /// * `buffer` - A pointer to a buffer that receives the distributed files directory of the application.
226    ///
227    /// * `bufferSize` - The length of the buffer.
228    ///
229    /// * `writeLength` - The string length actually written to the buffer,
230    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
231    ///
232    /// # Returns
233    ///
234    /// * The error code.
235    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
236    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
237    /// or the buffer size is less than the minimum buffer size.
238    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
239    ///
240    /// Available since API-level: 16
241    #[cfg(feature = "api-16")]
242    #[cfg_attr(docsrs, doc(cfg(feature = "api-16")))]
243    pub fn OH_AbilityRuntime_ApplicationContextGetDistributedFilesDir(
244        buffer: *mut ::core::ffi::c_char,
245        bufferSize: i32,
246        writeLength: *mut i32,
247    ) -> AbilityRuntimeResult;
248    /// Obtain the cloud file directory of the application.
249    ///
250    /// # Arguments
251    ///
252    /// * `buffer` - A pointer to a buffer that receives the cloud file directory of the application.
253    ///
254    /// * `bufferSize` - The length of the buffer.
255    ///
256    /// * `writeLength` - The string length actually written to the buffer,
257    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
258    ///
259    /// # Returns
260    ///
261    /// * The error code.
262    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
263    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
264    /// or the buffer size is less than the minimum buffer size.
265    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
266    ///
267    /// Available since API-level: 16
268    #[cfg(feature = "api-16")]
269    #[cfg_attr(docsrs, doc(cfg(feature = "api-16")))]
270    pub fn OH_AbilityRuntime_ApplicationContextGetCloudFileDir(
271        buffer: *mut ::core::ffi::c_char,
272        bufferSize: i32,
273        writeLength: *mut i32,
274    ) -> AbilityRuntimeResult;
275    /// Obtain the resource directory of the target module.
276    ///
277    /// # Arguments
278    ///
279    /// * `moduleName` - The module name.
280    ///
281    /// * `buffer` - A pointer to a buffer that receives the resource directory of the target module.
282    ///
283    /// * `bufferSize` - The length of the buffer.
284    ///
285    /// * `writeLength` - The string length actually written to the buffer,
286    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
287    ///
288    /// # Returns
289    ///
290    /// * The error code.
291    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
292    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
293    /// or the buffer size is less than the minimum buffer size.
294    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
295    ///
296    /// Available since API-level: 20
297    #[cfg(feature = "api-20")]
298    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
299    pub fn OH_AbilityRuntime_ApplicationContextGetResourceDir(
300        moduleName: *const ::core::ffi::c_char,
301        buffer: *mut ::core::ffi::c_char,
302        bufferSize: i32,
303        writeLength: *mut i32,
304    ) -> AbilityRuntimeResult;
305    /// Starts self UIAbility.
306    ///
307    /// `ohos.permission.NDK_START_SELF_UI_ABILITY`
308    /// # Arguments
309    ///
310    /// * `want` - The arguments passed to start self UIAbility.
311    /// For details, see [`AbilityBase_Want`].
312    ///
313    /// # Returns
314    ///
315    /// * Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the call is successful.
316    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED`] if the caller has no correct permission.
317    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the arguments provided is invalid.
318    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED`] if the device does not support starting self uiability.
319    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY`] if the target ability does not exist.
320    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE`] if the ability type is incorrect.
321    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED`] if the crowdtesting application expires.
322    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE`] if the ability cannot be started in Wukong mode.
323    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CONTROLLED`] if the app is controlled.
324    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED`] if the app is controlled by EDM.
325    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROSS_APP`] if the caller tries to start a different application.
326    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INTERNAL`] if internal error occurs.
327    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY`] if the caller is not top ability.
328    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_UPPER_LIMIT_REACHED`]
329    /// if the number of app instances reached the limit (since 17).
330    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED`]
331    /// if the APP_INSTANCE_KEY cannot be specified (since 17).
332    /// For details, see [`AbilityRuntime_ErrorCode`].
333    ///
334    /// Available since API-level: 15
335    #[cfg(feature = "api-15")]
336    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
337    pub fn OH_AbilityRuntime_StartSelfUIAbility(
338        want: *mut AbilityBase_Want,
339    ) -> AbilityRuntimeResult;
340    /// Obtain the launch parameter of starting UIAbility.
341    ///
342    /// # Arguments
343    ///
344    /// * `buffer` - A pointer to a buffer that receives the launch parameter of starting UIAbility.
345    ///
346    /// * `bufferSize` - The length of the buffer.
347    ///
348    /// * `writeLength` - The string length actually written to the buffer,
349    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
350    ///
351    /// # Returns
352    ///
353    /// * The error code.
354    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
355    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
356    /// or the buffer size is less than the minimum buffer size.
357    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
358    ///
359    /// Available since API-level: 21
360    #[cfg(feature = "api-21")]
361    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
362    pub fn OH_AbilityRuntime_ApplicationContextGetLaunchParameter(
363        buffer: *mut ::core::ffi::c_char,
364        bufferSize: i32,
365        writeLength: *mut i32,
366    ) -> AbilityRuntimeResult;
367    /// Obtain the latest parameter of starting UIAbility.
368    ///
369    /// # Arguments
370    ///
371    /// * `buffer` - A pointer to a buffer that receives the latest parameter of starting UIAbility.
372    ///
373    /// * `bufferSize` - The length of the buffer.
374    ///
375    /// * `writeLength` - The string length actually written to the buffer,
376    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
377    ///
378    /// # Returns
379    ///
380    /// * The error code.
381    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
382    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
383    /// or the buffer size is less than the minimum buffer size.
384    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
385    ///
386    /// Available since API-level: 21
387    #[cfg(feature = "api-21")]
388    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
389    pub fn OH_AbilityRuntime_ApplicationContextGetLatestParameter(
390        buffer: *mut ::core::ffi::c_char,
391        bufferSize: i32,
392        writeLength: *mut i32,
393    ) -> AbilityRuntimeResult;
394    /// Starts self UIAbility with start options.
395    ///
396    /// `ohos.permission.NDK_START_SELF_UI_ABILITY`
397    /// # Arguments
398    ///
399    /// * `want` - The arguments passed to start self UIAbility.
400    /// For details, see [`AbilityBase_Want`].
401    ///
402    /// * `options` - The start options passed to start self UIAbility.
403    /// For details, see [`AbilityRuntime_StartOptions`].
404    ///
405    /// # Returns
406    ///
407    /// * Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the call is successful.
408    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED`] if the caller has no correct permission.
409    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the arguments provided is invalid.
410    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED`] if the device does not support starting self uiability.
411    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY`] if the target ability does not exist.
412    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE`] if the ability type is incorrect.
413    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED`] if the crowdtesting application expires.
414    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE`] if the ability cannot be started in Wukong mode.
415    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CONTROLLED`] if the app is controlled.
416    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED`] if the app is controlled by EDM.
417    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROSS_APP`] if the caller tries to start a different application.
418    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INTERNAL`] if internal error occurs.
419    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY`] if the caller is not foreground process.
420    /// Returns [`ABILITY_RUNTIME_ERROR_VISIBILITY_SETTING_DISABLED`] if setting visibility is disabled.
421    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_MULTI_APP_NOT_SUPPORTED`]
422    /// if the app clone or multi-instance is not supported.
423    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INVALID_APP_INSTANCE_KEY`] if the app instance key is invalid.
424    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_UPPER_LIMIT_REACHED`] if the number of app instances reached the limit.
425    /// Returns [`ABILITY_RUNTIME_ERROR_MULTI_INSTANCE_NOT_SUPPORTED`] if the multi-instance is not supported.
426    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED`]
427    /// if the APP_INSTANCE_KEY cannot be specified.
428    /// For details, see [`AbilityRuntime_ErrorCode`].
429    ///
430    /// Available since API-level: 17
431    #[cfg(feature = "api-17")]
432    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
433    pub fn OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(
434        want: *mut AbilityBase_Want,
435        options: *mut AbilityRuntime_StartOptions,
436    ) -> AbilityRuntimeResult;
437    /// Starts self UIAbility with start options and receives the process ID.
438    ///
439    /// ohos.permission.NDK_START_SELF_UI_ABILITY
440    /// # Arguments
441    ///
442    /// * `want` - The arguments passed to start self UIAbility.
443    /// For details, see [`AbilityBase_Want`].
444    ///
445    /// * `options` - The start options passed to start self UIAbility.
446    /// For details, see [`AbilityRuntime_StartOptions`].
447    ///
448    /// * `targetPid` - The process ID of the started UIAbility.
449    ///
450    /// # Returns
451    ///
452    /// * Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the call is successful.
453    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED`] if the caller has no correct permission.
454    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the arguments provided is invalid.
455    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED`] if the device does not support starting self uiability.
456    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY`] if the target ability does not exist.
457    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE`] if the ability type is incorrect.
458    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED`] if the crowdtesting application expires.
459    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE`] if the ability cannot be started in Wukong mode.
460    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CONTROLLED`] if the app is controlled.
461    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED`] if the app is controlled by EDM.
462    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROSS_APP`] if the caller tries to start a different application.
463    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INTERNAL`] if internal error occurs. such as connect system service failed.
464    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY`] if the caller is not foreground process.
465    /// Returns [`ABILITY_RUNTIME_ERROR_VISIBILITY_SETTING_DISABLED`] if setting visibility is disabled.
466    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_MULTI_APP_NOT_SUPPORTED`]
467    /// if the app clone or multi-instance is not supported.
468    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INVALID_APP_INSTANCE_KEY`] if the app instance key is invalid.
469    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_UPPER_LIMIT_REACHED`] if the number of app instances reached the limit.
470    /// Returns [`ABILITY_RUNTIME_ERROR_MULTI_INSTANCE_NOT_SUPPORTED`] if the multi-instance is not supported.
471    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED`]
472    /// if the APP_INSTANCE_KEY cannot be specified.
473    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_START_TIMEOUT`] if starting UIAbility time out.
474    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_MAIN_THREAD_NOT_SUPPORTED`]
475    /// if the API is called in the main thread of the app.
476    /// For details, see [`AbilityRuntime_ErrorCode`].
477    ///
478    /// Available since API-level: 21
479    #[cfg(feature = "api-21")]
480    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
481    pub fn OH_AbilityRuntime_StartSelfUIAbilityWithPidResult(
482        want: *mut AbilityBase_Want,
483        options: *mut AbilityRuntime_StartOptions,
484        targetPid: *mut i32,
485    ) -> AbilityRuntimeResult;
486    /// Obtain the version code of the application.
487    ///
488    /// # Arguments
489    ///
490    /// * `versionCode` - The version code of the application.
491    ///
492    /// # Returns
493    ///
494    /// * The error code.
495    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
496    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the versionCode is null.
497    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
498    /// [`ABILITY_RUNTIME_ERROR_CODE_GET_APPLICATION_INFO_FAILED`] if the application info does not exist.
499    ///
500    /// Available since API-level: 21
501    #[cfg(feature = "api-21")]
502    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
503    pub fn OH_AbilityRuntime_ApplicationContextGetVersionCode(
504        versionCode: *mut i64,
505    ) -> AbilityRuntimeResult;
506}