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