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    /// Starts self UIAbility with start options.
341    ///
342    /// `ohos.permission.NDK_START_SELF_UI_ABILITY`
343    /// # Arguments
344    ///
345    /// * `want` - The arguments passed to start self UIAbility.
346    /// For details, see [`AbilityBase_Want`].
347    ///
348    /// * `options` - The start options passed to start self UIAbility.
349    /// For details, see [`AbilityRuntime_StartOptions`].
350    ///
351    /// # Returns
352    ///
353    /// * Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the call is successful.
354    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED`] if the caller has no correct permission.
355    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the arguments provided is invalid.
356    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED`] if the device does not support starting self uiability.
357    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY`] if the target ability does not exist.
358    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE`] if the ability type is incorrect.
359    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED`] if the crowdtesting application expires.
360    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE`] if the ability cannot be started in Wukong mode.
361    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CONTROLLED`] if the app is controlled.
362    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED`] if the app is controlled by EDM.
363    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROSS_APP`] if the caller tries to start a different application.
364    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INTERNAL`] if internal error occurs.
365    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY`] if the caller is not foreground process.
366    /// Returns [`ABILITY_RUNTIME_ERROR_VISIBILITY_SETTING_DISABLED`] if setting visibility is disabled.
367    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_MULTI_APP_NOT_SUPPORTED`]
368    /// if the app clone or multi-instance is not supported.
369    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INVALID_APP_INSTANCE_KEY`] if the app instance key is invalid.
370    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_UPPER_LIMIT_REACHED`] if the number of app instances reached the limit.
371    /// Returns [`ABILITY_RUNTIME_ERROR_MULTI_INSTANCE_NOT_SUPPORTED`] if the multi-instance is not supported.
372    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED`]
373    /// if the APP_INSTANCE_KEY cannot be specified.
374    /// For details, see [`AbilityRuntime_ErrorCode`].
375    ///
376    /// Available since API-level: 17
377    #[cfg(feature = "api-17")]
378    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
379    pub fn OH_AbilityRuntime_StartSelfUIAbilityWithStartOptions(
380        want: *mut AbilityBase_Want,
381        options: *mut AbilityRuntime_StartOptions,
382    ) -> AbilityRuntimeResult;
383    /// Obtain the version code of the application.
384    ///
385    /// # Arguments
386    ///
387    /// * `versionCode` - The version code of the application.
388    ///
389    /// # Returns
390    ///
391    /// * The error code.
392    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
393    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the versionCode is null.
394    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
395    /// [`ABILITY_RUNTIME_ERROR_CODE_GET_APPLICATION_INFO_FAILED`] if the application info does not exist.
396    ///
397    /// Available since API-level: 21
398    #[cfg(feature = "api-21")]
399    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
400    pub fn OH_AbilityRuntime_ApplicationContextGetVersionCode(
401        versionCode: *mut i64,
402    ) -> AbilityRuntimeResult;
403    /// Obtain the launch parameter of starting UIAbility.
404    ///
405    /// # Arguments
406    ///
407    /// * `buffer` - A pointer to a buffer that receives the launch parameter of starting UIAbility.
408    ///
409    /// * `bufferSize` - The length of the buffer.
410    ///
411    /// * `writeLength` - The string length actually written to the buffer,
412    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
413    ///
414    /// # Returns
415    ///
416    /// * The error code.
417    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
418    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
419    /// or the buffer size is less than the minimum buffer size.
420    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
421    ///
422    /// Available since API-level: 21
423    #[cfg(feature = "api-21")]
424    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
425    pub fn OH_AbilityRuntime_ApplicationContextGetLaunchParameter(
426        buffer: *mut ::core::ffi::c_char,
427        bufferSize: i32,
428        writeLength: *mut i32,
429    ) -> AbilityRuntimeResult;
430    /// Obtain the latest parameter of starting UIAbility.
431    ///
432    /// # Arguments
433    ///
434    /// * `buffer` - A pointer to a buffer that receives the latest parameter of starting UIAbility.
435    ///
436    /// * `bufferSize` - The length of the buffer.
437    ///
438    /// * `writeLength` - The string length actually written to the buffer,
439    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
440    ///
441    /// # Returns
442    ///
443    /// * The error code.
444    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
445    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
446    /// or the buffer size is less than the minimum buffer size.
447    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
448    ///
449    /// Available since API-level: 21
450    #[cfg(feature = "api-21")]
451    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
452    pub fn OH_AbilityRuntime_ApplicationContextGetLatestParameter(
453        buffer: *mut ::core::ffi::c_char,
454        bufferSize: i32,
455        writeLength: *mut i32,
456    ) -> AbilityRuntimeResult;
457    /// Starts self UIAbility with start options and receives the process ID.
458    ///
459    /// ohos.permission.NDK_START_SELF_UI_ABILITY
460    /// # Arguments
461    ///
462    /// * `want` - The arguments passed to start self UIAbility.
463    /// For details, see [`AbilityBase_Want`].
464    ///
465    /// * `options` - The start options passed to start self UIAbility.
466    /// For details, see [`AbilityRuntime_StartOptions`].
467    ///
468    /// * `targetPid` - The process ID of the started UIAbility.
469    ///
470    /// # Returns
471    ///
472    /// * Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the call is successful.
473    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PERMISSION_DENIED`] if the caller has no correct permission.
474    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the arguments provided is invalid.
475    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_SUPPORTED`] if the device does not support starting self uiability.
476    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_SUCH_ABILITY`] if the target ability does not exist.
477    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INCORRECT_ABILITY_TYPE`] if the ability type is incorrect.
478    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROWDTEST_EXPIRED`] if the crowdtesting application expires.
479    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_WUKONG_MODE`] if the ability cannot be started in Wukong mode.
480    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CONTROLLED`] if the app is controlled.
481    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_EDM_CONTROLLED`] if the app is controlled by EDM.
482    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_CROSS_APP`] if the caller tries to start a different application.
483    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INTERNAL`] if internal error occurs. such as connect system service failed.
484    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_NOT_TOP_ABILITY`] if the caller is not foreground process.
485    /// Returns [`ABILITY_RUNTIME_ERROR_VISIBILITY_SETTING_DISABLED`] if setting visibility is disabled.
486    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_MULTI_APP_NOT_SUPPORTED`]
487    /// if the app clone or multi-instance is not supported.
488    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INVALID_APP_INSTANCE_KEY`] if the app instance key is invalid.
489    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_UPPER_LIMIT_REACHED`] if the number of app instances reached the limit.
490    /// Returns [`ABILITY_RUNTIME_ERROR_MULTI_INSTANCE_NOT_SUPPORTED`] if the multi-instance is not supported.
491    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_APP_INSTANCE_KEY_NOT_SUPPORTED`]
492    /// if the APP_INSTANCE_KEY cannot be specified.
493    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_START_TIMEOUT`] if starting UIAbility time out.
494    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_MAIN_THREAD_NOT_SUPPORTED`]
495    /// if the API is called in the main thread of the app.
496    /// For details, see [`AbilityRuntime_ErrorCode`].
497    ///
498    /// Available since API-level: 21
499    #[cfg(feature = "api-21")]
500    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
501    pub fn OH_AbilityRuntime_StartSelfUIAbilityWithPidResult(
502        want: *mut AbilityBase_Want,
503        options: *mut AbilityRuntime_StartOptions,
504        targetPid: *mut i32,
505    ) -> AbilityRuntimeResult;
506    /// Obtain the log file directory of the application.
507    ///
508    /// # Arguments
509    ///
510    /// * `buffer` - A pointer to a buffer that receives the log file directory of the application.
511    ///
512    /// * `bufferSize` - The length of the buffer.
513    ///
514    /// * `writeLength` - The string length actually written to the buffer,
515    /// when returning [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`].
516    ///
517    /// # Returns
518    ///
519    /// * The error code.
520    /// [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
521    /// [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if the buffer or writeLength is null,
522    /// or the buffer size is less than the minimum buffer size.
523    /// [`ABILITY_RUNTIME_ERROR_CODE_CONTEXT_NOT_EXIST`] if the application context does not exist.
524    ///
525    /// Available since API-level: 22
526    #[cfg(feature = "api-22")]
527    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
528    pub fn OH_AbilityRuntime_ApplicationContextGetLogFileDir(
529        buffer: *mut ::core::ffi::c_char,
530        bufferSize: i32,
531        writeLength: *mut i32,
532    ) -> AbilityRuntimeResult;
533    /// Notify page changed.
534    ///
535    /// # Arguments
536    ///
537    /// * `targetPageName` - The target page name.
538    ///
539    /// * `targetPageNameLength` - The target page name length.
540    ///
541    /// * `windowId` - The window identifier associated with the target page.
542    ///
543    ///
544    /// # Returns
545    ///
546    /// * Returns [`ABILITY_RUNTIME_ERROR_CODE_NO_ERROR`] if the operation is successful.
547    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID`] if targetPageName is null or windowId is invalid.
548    /// Returns [`ABILITY_RUNTIME_ERROR_CODE_INTERNAL`]
549    /// if internal error occurs, such as failed to access dependency module.
550    ///
551    /// Available since API-level: 23
552    #[cfg(feature = "api-23")]
553    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
554    pub fn OH_AbilityRuntime_ApplicationContextNotifyPageChanged(
555        targetPageName: *const ::core::ffi::c_char,
556        targetPageNameLength: i32,
557        windowId: i32,
558    ) -> AbilityRuntimeResult;
559}