1/* 2 * Copyright (c) 2021-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 * @file 18 * @kit AbilityKit 19 */ 20 21/*** if arkts 1.1 */ 22import { ConnectOptions } from '../ability/connectOptions'; 23import { Caller } from '../@ohos.app.ability.UIAbility'; 24import image from '../@ohos.multimedia.image'; 25import dialogRequest from '../@ohos.app.ability.dialogRequest'; 26import AbilityConstant from '../@ohos.app.ability.AbilityConstant'; 27import contextConstant from '../@ohos.app.ability.contextConstant'; 28import type AtomicServiceOptions from '../@ohos.app.ability.AtomicServiceOptions'; 29import type ConfigurationConstant from '../@ohos.app.ability.ConfigurationConstant'; 30import type UIServiceProxy from './UIServiceProxy'; 31import type UIServiceExtensionConnectCallback from './UIServiceExtensionConnectCallback'; 32import type AbilityStartCallback from './AbilityStartCallback'; 33/*** endif */ 34import { AbilityInfo } from '../bundleManager/AbilityInfo'; 35import { AbilityResult } from '../ability/abilityResult'; 36import { AsyncCallback } from '../@ohos.base'; 37import Context from './Context'; 38import { HapModuleInfo } from '../bundleManager/HapModuleInfo'; 39import OpenLinkOptions from '../@ohos.app.ability.OpenLinkOptions'; 40import Want from '../@ohos.app.ability.Want'; 41import StartOptions from '../@ohos.app.ability.StartOptions'; 42import { Configuration } from '../@ohos.app.ability.Configuration'; 43import window from '../@ohos.window'; 44 45/** 46 * The context of an ability. It allows access to ability-specific resources. 47 * 48 * @extends Context 49 * @syscap SystemCapability.Ability.AbilityRuntime.Core 50 * @stagemodelonly 51 * @since 9 52 */ 53/** 54 * The context of an ability. It allows access to ability-specific resources. 55 * 56 * @extends Context 57 * @syscap SystemCapability.Ability.AbilityRuntime.Core 58 * @stagemodelonly 59 * @crossplatform 60 * @since 10 61 */ 62/** 63 * The context of an ability. It allows access to ability-specific resources. 64 * 65 * @extends Context 66 * @syscap SystemCapability.Ability.AbilityRuntime.Core 67 * @stagemodelonly 68 * @crossplatform 69 * @atomicservice 70 * @since arkts {'1.1':'11', '1.2':'20'} 71 * @arkts 1.1&1.2 72 */ 73declare class UIAbilityContext extends Context { 74 /** 75 * Indicates configuration information about an ability. 76 * 77 * @type { AbilityInfo } 78 * @syscap SystemCapability.Ability.AbilityRuntime.Core 79 * @stagemodelonly 80 * @since 9 81 */ 82 /** 83 * Indicates configuration information about an ability. 84 * 85 * @type { AbilityInfo } 86 * @syscap SystemCapability.Ability.AbilityRuntime.Core 87 * @stagemodelonly 88 * @crossplatform 89 * @since 10 90 */ 91 /** 92 * Indicates configuration information about an ability. 93 * 94 * @type { AbilityInfo } 95 * @syscap SystemCapability.Ability.AbilityRuntime.Core 96 * @stagemodelonly 97 * @crossplatform 98 * @atomicservice 99 * @since arkts {'1.1':'11', '1.2':'20'} 100 * @arkts 1.1&1.2 101 */ 102 abilityInfo: AbilityInfo; 103 104 /** 105 * Indicates configuration information about the module. 106 * 107 * @type { HapModuleInfo } 108 * @syscap SystemCapability.Ability.AbilityRuntime.Core 109 * @stagemodelonly 110 * @since 9 111 */ 112 /** 113 * Indicates configuration information about the module. 114 * 115 * @type { HapModuleInfo } 116 * @syscap SystemCapability.Ability.AbilityRuntime.Core 117 * @stagemodelonly 118 * @crossplatform 119 * @since 10 120 */ 121 /** 122 * Indicates configuration information about the module. 123 * 124 * @type { HapModuleInfo } 125 * @syscap SystemCapability.Ability.AbilityRuntime.Core 126 * @stagemodelonly 127 * @crossplatform 128 * @atomicservice 129 * @since arkts {'1.1':'11', '1.2':'20'} 130 * @arkts 1.1&1.2 131 */ 132 currentHapModuleInfo: HapModuleInfo; 133 134 /** 135 * Indicates configuration information. 136 * 137 * @type { Configuration } 138 * @syscap SystemCapability.Ability.AbilityRuntime.Core 139 * @stagemodelonly 140 * @since 9 141 */ 142 /** 143 * Indicates configuration information. 144 * 145 * @type { Configuration } 146 * @syscap SystemCapability.Ability.AbilityRuntime.Core 147 * @stagemodelonly 148 * @crossplatform 149 * @since 10 150 */ 151 /** 152 * Indicates configuration information. 153 * 154 * @type { Configuration } 155 * @syscap SystemCapability.Ability.AbilityRuntime.Core 156 * @stagemodelonly 157 * @crossplatform 158 * @atomicservice 159 * @since arkts {'1.1':'11', '1.2':'20'} 160 * @arkts 1.1&1.2 161 */ 162 config: Configuration; 163 164 /** 165 * Indicates windowStage information. 166 * Exists from onWindowStageCreate lifecycle, does not exist from onWindowStageDestroy lifecycle. 167 * 168 * @type { window.WindowStage } 169 * @syscap SystemCapability.Ability.AbilityRuntime.Core 170 * @stagemodelonly 171 * @atomicservice 172 * @since arkts {'1.1':'12', '1.2':'20'} 173 * @arkts 1.1&1.2 174 */ 175 windowStage: window.WindowStage; 176 177 /** 178 * Starts a new ability. 179 * 180 * @param { Want } want - Indicates the ability to start. 181 * @param { AsyncCallback<void> } callback - The callback of startAbility. 182 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 183 * @throws { BusinessError } 16000001 - The specified ability does not exist. 184 * @throws { BusinessError } 16000002 - Incorrect ability type. 185 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 186 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 187 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 188 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 189 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 190 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 191 * @throws { BusinessError } 16000011 - The context does not exist. 192 * @throws { BusinessError } 16000050 - Internal error. 193 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 194 * @throws { BusinessError } 16000055 - Installation-free timed out. 195 * @throws { BusinessError } 16200001 - The caller has been released. 196 * @syscap SystemCapability.Ability.AbilityRuntime.Core 197 * @stagemodelonly 198 * @since 9 199 */ 200 /** 201 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 202 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 203 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 204 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 205 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 206 * 207 * @param { Want } want - Indicates the ability to start. 208 * @param { AsyncCallback<void> } callback - The callback of startAbility. 209 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 210 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 211 * @throws { BusinessError } 16000001 - The specified ability does not exist. 212 * @throws { BusinessError } 16000002 - Incorrect ability type. 213 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 214 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 215 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 216 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 217 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 218 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 219 * @throws { BusinessError } 16000011 - The context does not exist. 220 * @throws { BusinessError } 16000012 - The application is controlled. 221 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 222 * @throws { BusinessError } 16000050 - Internal error. 223 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 224 * @throws { BusinessError } 16000055 - Installation-free timed out. 225 * @throws { BusinessError } 16200001 - The caller has been released. 226 * @syscap SystemCapability.Ability.AbilityRuntime.Core 227 * @stagemodelonly 228 * @crossplatform 229 * @since 10 230 */ 231 /** 232 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 233 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 234 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 235 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 236 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 237 * 238 * @param { Want } want - Indicates the ability to start. 239 * @param { AsyncCallback<void> } callback - The callback of startAbility. 240 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 241 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 242 * @throws { BusinessError } 16000001 - The specified ability does not exist. 243 * @throws { BusinessError } 16000002 - Incorrect ability type. 244 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 245 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 246 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 247 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 248 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 249 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 250 * @throws { BusinessError } 16000011 - The context does not exist. 251 * @throws { BusinessError } 16000012 - The application is controlled. 252 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 253 * @throws { BusinessError } 16000050 - Internal error. 254 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 255 * @throws { BusinessError } 16000055 - Installation-free timed out. 256 * @throws { BusinessError } 16200001 - The caller has been released. 257 * @syscap SystemCapability.Ability.AbilityRuntime.Core 258 * @stagemodelonly 259 * @crossplatform 260 * @atomicservice 261 * @since 11 262 */ 263 /** 264 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 265 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 266 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 267 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 268 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 269 * 270 * @param { Want } want - Indicates the ability to start. 271 * @param { AsyncCallback<void> } callback - The callback of startAbility. 272 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 273 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 274 * @throws { BusinessError } 16000001 - The specified ability does not exist. 275 * @throws { BusinessError } 16000002 - Incorrect ability type. 276 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 277 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 278 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 279 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 280 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 281 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 282 * @throws { BusinessError } 16000011 - The context does not exist. 283 * @throws { BusinessError } 16000012 - The application is controlled. 284 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 285 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 286 * @throws { BusinessError } 16000019 - No matching ability is found. 287 * @throws { BusinessError } 16000050 - Internal error. 288 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 289 * @throws { BusinessError } 16000055 - Installation-free timed out. 290 * @throws { BusinessError } 16200001 - The caller has been released. 291 * @throws { BusinessError } 16000073 - The app clone index is invalid. 292 * @syscap SystemCapability.Ability.AbilityRuntime.Core 293 * @stagemodelonly 294 * @crossplatform 295 * @atomicservice 296 * @since 12 297 */ 298 /** 299 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 300 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 301 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 302 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 303 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 304 * 305 * @param { Want } want - Indicates the ability to start. 306 * @param { AsyncCallback<void> } callback - The callback of startAbility. 307 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 308 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 309 * @throws { BusinessError } 16000001 - The specified ability does not exist. 310 * @throws { BusinessError } 16000002 - Incorrect ability type. 311 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 312 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 313 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 314 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 315 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 316 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 317 * @throws { BusinessError } 16000011 - The context does not exist. 318 * @throws { BusinessError } 16000012 - The application is controlled. 319 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 320 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 321 * @throws { BusinessError } 16000019 - No matching ability is found. 322 * @throws { BusinessError } 16000050 - Internal error. 323 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 324 * @throws { BusinessError } 16000055 - Installation-free timed out. 325 * @throws { BusinessError } 16000071 - App clone is not supported. 326 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 327 * @throws { BusinessError } 16000073 - The app clone index is invalid. 328 * @throws { BusinessError } 16000076 - The app instance key is invalid. 329 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 330 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 331 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 332 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 333 * @throws { BusinessError } 16200001 - The caller has been released. 334 * @syscap SystemCapability.Ability.AbilityRuntime.Core 335 * @stagemodelonly 336 * @crossplatform 337 * @atomicservice 338 * @since arkts {'1.1':'14', '1.2':'20'} 339 * @arkts 1.1&1.2 340 */ 341 startAbility(want: Want, callback: AsyncCallback<void>): void; 342 343 /** 344 * Starts a new ability. 345 * 346 * @param { Want } want - Indicates the ability to start. 347 * @param { StartOptions } options - Indicates the start options. 348 * @param { AsyncCallback<void> } callback - The callback of startAbility. 349 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 350 * @throws { BusinessError } 16000001 - The specified ability does not exist. 351 * @throws { BusinessError } 16000002 - Incorrect ability type. 352 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 353 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 354 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 355 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 356 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 357 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 358 * @throws { BusinessError } 16000011 - The context does not exist. 359 * @throws { BusinessError } 16000050 - Internal error. 360 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 361 * @throws { BusinessError } 16000055 - Installation-free timed out. 362 * @throws { BusinessError } 16200001 - The caller has been released. 363 * @syscap SystemCapability.Ability.AbilityRuntime.Core 364 * @stagemodelonly 365 * @since 9 366 */ 367 /** 368 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 369 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 370 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 371 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 372 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 373 * 374 * @param { Want } want - Indicates the ability to start. 375 * @param { StartOptions } options - Indicates the start options. 376 * @param { AsyncCallback<void> } callback - The callback of startAbility. 377 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 378 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 379 * @throws { BusinessError } 16000001 - The specified ability does not exist. 380 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 381 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 382 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 383 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 384 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 385 * @throws { BusinessError } 16000011 - The context does not exist. 386 * @throws { BusinessError } 16000012 - The application is controlled. 387 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 388 * @throws { BusinessError } 16000050 - Internal error. 389 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 390 * @throws { BusinessError } 16000055 - Installation-free timed out. 391 * @throws { BusinessError } 16200001 - The caller has been released. 392 * @syscap SystemCapability.Ability.AbilityRuntime.Core 393 * @stagemodelonly 394 * @since 10 395 */ 396 /** 397 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 398 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 399 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 400 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 401 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 402 * 403 * @param { Want } want - Indicates the ability to start. 404 * @param { StartOptions } options - Indicates the start options. 405 * @param { AsyncCallback<void> } callback - The callback of startAbility. 406 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 407 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 408 * @throws { BusinessError } 16000001 - The specified ability does not exist. 409 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 410 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 411 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 412 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 413 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 414 * @throws { BusinessError } 16000011 - The context does not exist. 415 * @throws { BusinessError } 16000012 - The application is controlled. 416 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 417 * @throws { BusinessError } 16000050 - Internal error. 418 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 419 * @throws { BusinessError } 16000055 - Installation-free timed out. 420 * @throws { BusinessError } 16200001 - The caller has been released. 421 * @syscap SystemCapability.Ability.AbilityRuntime.Core 422 * @stagemodelonly 423 * @atomicservice 424 * @since 11 425 */ 426 /** 427 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 428 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 429 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 430 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 431 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 432 * 433 * @param { Want } want - Indicates the ability to start. 434 * @param { StartOptions } options - Indicates the start options. 435 * @param { AsyncCallback<void> } callback - The callback of startAbility. 436 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 437 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 438 * @throws { BusinessError } 801 - Capability not support. 439 * @throws { BusinessError } 16000001 - The specified ability does not exist. 440 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 441 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 442 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 443 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 444 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 445 * @throws { BusinessError } 16000011 - The context does not exist. 446 * @throws { BusinessError } 16000012 - The application is controlled. 447 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 448 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 449 * @throws { BusinessError } 16000019 - No matching ability is found. 450 * @throws { BusinessError } 16000050 - Internal error. 451 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 452 * @throws { BusinessError } 16000055 - Installation-free timed out. 453 * @throws { BusinessError } 16000067 - The StartOptions check failed. 454 * @throws { BusinessError } 16000068 - The ability is already running. 455 * @throws { BusinessError } 16200001 - The caller has been released. 456 * @throws { BusinessError } 16300003 - The target application is not the current application. 457 * @throws { BusinessError } 16000073 - The app clone index is invalid. 458 * @syscap SystemCapability.Ability.AbilityRuntime.Core 459 * @stagemodelonly 460 * @atomicservice 461 * @since 12 462 */ 463 /** 464 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 465 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 466 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 467 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 468 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 469 * 470 * @param { Want } want - Indicates the ability to start. 471 * @param { StartOptions } options - Indicates the start options. 472 * @param { AsyncCallback<void> } callback - The callback of startAbility. 473 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 474 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 475 * @throws { BusinessError } 801 - Capability not support. 476 * @throws { BusinessError } 16000001 - The specified ability does not exist. 477 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 478 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 479 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 480 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 481 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 482 * @throws { BusinessError } 16000011 - The context does not exist. 483 * @throws { BusinessError } 16000012 - The application is controlled. 484 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 485 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 486 * @throws { BusinessError } 16000019 - No matching ability is found. 487 * @throws { BusinessError } 16000050 - Internal error. 488 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 489 * @throws { BusinessError } 16000055 - Installation-free timed out. 490 * @throws { BusinessError } 16000067 - The StartOptions check failed. 491 * @throws { BusinessError } 16000068 - The ability is already running. 492 * @throws { BusinessError } 16000071 - App clone is not supported. 493 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 494 * @throws { BusinessError } 16000073 - The app clone index is invalid. 495 * @throws { BusinessError } 16000076 - The app instance key is invalid. 496 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 497 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 498 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 499 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 500 * @throws { BusinessError } 16200001 - The caller has been released. 501 * @throws { BusinessError } 16300003 - The target application is not the current application. 502 * @syscap SystemCapability.Ability.AbilityRuntime.Core 503 * @stagemodelonly 504 * @atomicservice 505 * @since 14 506 */ 507 /** 508 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 509 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 510 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 511 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 512 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 513 * 514 * @param { Want } want - Indicates the ability to start. 515 * @param { StartOptions } options - Indicates the start options. 516 * @param { AsyncCallback<void> } callback - The callback of startAbility. 517 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 518 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 519 * @throws { BusinessError } 801 - Capability not support. 520 * @throws { BusinessError } 16000001 - The specified ability does not exist. 521 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 522 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 523 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 524 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 525 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 526 * @throws { BusinessError } 16000011 - The context does not exist. 527 * @throws { BusinessError } 16000012 - The application is controlled. 528 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 529 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 530 * @throws { BusinessError } 16000019 - No matching ability is found. 531 * @throws { BusinessError } 16000050 - Internal error. 532 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 533 * @throws { BusinessError } 16000055 - Installation-free timed out. 534 * @throws { BusinessError } 16000067 - The StartOptions check failed. 535 * @throws { BusinessError } 16000068 - The ability is already running. 536 * @throws { BusinessError } 16000071 - App clone is not supported. 537 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 538 * @throws { BusinessError } 16000073 - The app clone index is invalid. 539 * @throws { BusinessError } 16000076 - The app instance key is invalid. 540 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 541 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 542 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 543 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 544 * @throws { BusinessError } 16200001 - The caller has been released. 545 * @throws { BusinessError } 16300003 - The target application is not the current application. 546 * @syscap SystemCapability.Ability.AbilityRuntime.Core 547 * @stagemodelonly 548 * @crossplatform 549 * @atomicservice 550 * @since arkts {'1.1':'18', '1.2':'20'} 551 * @arkts 1.1&1.2 552 */ 553 startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; 554 555 /** 556 * Starts a new ability. 557 * 558 * @param { Want } want - Indicates the ability to start. 559 * @param { StartOptions } [options] - Indicates the start options. 560 * @returns { Promise<void> } The promise returned by the function. 561 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 562 * @throws { BusinessError } 16000001 - The specified ability does not exist. 563 * @throws { BusinessError } 16000002 - Incorrect ability type. 564 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 565 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 566 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 567 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 568 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 569 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 570 * @throws { BusinessError } 16000011 - The context does not exist. 571 * @throws { BusinessError } 16000050 - Internal error. 572 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 573 * @throws { BusinessError } 16000055 - Installation-free timed out. 574 * @throws { BusinessError } 16200001 - The caller has been released. 575 * @syscap SystemCapability.Ability.AbilityRuntime.Core 576 * @stagemodelonly 577 * @crossplatform 578 * @since 9 579 */ 580 /** 581 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 582 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 583 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 584 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 585 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 586 * 587 * @param { Want } want - Indicates the ability to start. 588 * @param { StartOptions } [options] - Indicates the start options. 589 * @returns { Promise<void> } The promise returned by the function. 590 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 591 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 592 * @throws { BusinessError } 16000001 - The specified ability does not exist. 593 * @throws { BusinessError } 16000002 - Incorrect ability type. 594 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 595 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 596 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 597 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 598 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 599 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 600 * @throws { BusinessError } 16000011 - The context does not exist. 601 * @throws { BusinessError } 16000012 - The application is controlled. 602 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 603 * @throws { BusinessError } 16000050 - Internal error. 604 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 605 * @throws { BusinessError } 16000055 - Installation-free timed out. 606 * @throws { BusinessError } 16200001 - The caller has been released. 607 * @syscap SystemCapability.Ability.AbilityRuntime.Core 608 * @stagemodelonly 609 * @since 10 610 */ 611 /** 612 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 613 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 614 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 615 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 616 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 617 * 618 * @param { Want } want - Indicates the ability to start. 619 * @param { StartOptions } [options] - Indicates the start options. 620 * @returns { Promise<void> } The promise returned by the function. 621 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 622 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 623 * @throws { BusinessError } 16000001 - The specified ability does not exist. 624 * @throws { BusinessError } 16000002 - Incorrect ability type. 625 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 626 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 627 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 628 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 629 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 630 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 631 * @throws { BusinessError } 16000011 - The context does not exist. 632 * @throws { BusinessError } 16000012 - The application is controlled. 633 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 634 * @throws { BusinessError } 16000050 - Internal error. 635 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 636 * @throws { BusinessError } 16000055 - Installation-free timed out. 637 * @throws { BusinessError } 16200001 - The caller has been released. 638 * @syscap SystemCapability.Ability.AbilityRuntime.Core 639 * @stagemodelonly 640 * @atomicservice 641 * @since 11 642 */ 643 /** 644 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 645 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 646 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 647 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 648 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 649 * 650 * @param { Want } want - Indicates the ability to start. 651 * @param { StartOptions } [options] - Indicates the start options. 652 * @returns { Promise<void> } The promise returned by the function. 653 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 654 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 655 * @throws { BusinessError } 801 - Capability not support. 656 * @throws { BusinessError } 16000001 - The specified ability does not exist. 657 * @throws { BusinessError } 16000002 - Incorrect ability type. 658 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 659 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 660 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 661 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 662 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 663 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 664 * @throws { BusinessError } 16000011 - The context does not exist. 665 * @throws { BusinessError } 16000012 - The application is controlled. 666 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 667 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 668 * @throws { BusinessError } 16000019 - No matching ability is found. 669 * @throws { BusinessError } 16000050 - Internal error. 670 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 671 * @throws { BusinessError } 16000055 - Installation-free timed out. 672 * @throws { BusinessError } 16000067 - The StartOptions check failed. 673 * @throws { BusinessError } 16000068 - The ability is already running. 674 * @throws { BusinessError } 16200001 - The caller has been released. 675 * @throws { BusinessError } 16300003 - The target application is not the current application. 676 * @throws { BusinessError } 16000073 - The app clone index is invalid. 677 * @syscap SystemCapability.Ability.AbilityRuntime.Core 678 * @stagemodelonly 679 * @atomicservice 680 * @since 12 681 */ 682 /** 683 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 684 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 685 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 686 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 687 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 688 * 689 * @param { Want } want - Indicates the ability to start. 690 * @param { StartOptions } [options] - Indicates the start options. 691 * @returns { Promise<void> } The promise returned by the function. 692 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 693 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 694 * @throws { BusinessError } 801 - Capability not support. 695 * @throws { BusinessError } 16000001 - The specified ability does not exist. 696 * @throws { BusinessError } 16000002 - Incorrect ability type. 697 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 698 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 699 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 700 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 701 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 702 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 703 * @throws { BusinessError } 16000011 - The context does not exist. 704 * @throws { BusinessError } 16000012 - The application is controlled. 705 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 706 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 707 * @throws { BusinessError } 16000019 - No matching ability is found. 708 * @throws { BusinessError } 16000050 - Internal error. 709 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 710 * @throws { BusinessError } 16000055 - Installation-free timed out. 711 * @throws { BusinessError } 16000067 - The StartOptions check failed. 712 * @throws { BusinessError } 16000068 - The ability is already running. 713 * @throws { BusinessError } 16000071 - App clone is not supported. 714 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 715 * @throws { BusinessError } 16000073 - The app clone index is invalid. 716 * @throws { BusinessError } 16000076 - The app instance key is invalid. 717 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 718 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 719 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 720 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 721 * @throws { BusinessError } 16200001 - The caller has been released. 722 * @throws { BusinessError } 16300003 - The target application is not the current application. 723 * @syscap SystemCapability.Ability.AbilityRuntime.Core 724 * @stagemodelonly 725 * @atomicservice 726 * @since 14 727 */ 728 /** 729 * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; 730 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 731 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 732 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 733 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 734 * 735 * @param { Want } want - Indicates the ability to start. 736 * @param { StartOptions } [options] - Indicates the start options. 737 * @returns { Promise<void> } The promise returned by the function. 738 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 739 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 740 * @throws { BusinessError } 801 - Capability not support. 741 * @throws { BusinessError } 16000001 - The specified ability does not exist. 742 * @throws { BusinessError } 16000002 - Incorrect ability type. 743 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 744 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 745 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 746 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 747 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 748 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 749 * @throws { BusinessError } 16000011 - The context does not exist. 750 * @throws { BusinessError } 16000012 - The application is controlled. 751 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 752 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 753 * @throws { BusinessError } 16000019 - No matching ability is found. 754 * @throws { BusinessError } 16000050 - Internal error. 755 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 756 * @throws { BusinessError } 16000055 - Installation-free timed out. 757 * @throws { BusinessError } 16000067 - The StartOptions check failed. 758 * @throws { BusinessError } 16000068 - The ability is already running. 759 * @throws { BusinessError } 16000071 - App clone is not supported. 760 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 761 * @throws { BusinessError } 16000073 - The app clone index is invalid. 762 * @throws { BusinessError } 16000076 - The app instance key is invalid. 763 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 764 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 765 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 766 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 767 * @throws { BusinessError } 16200001 - The caller has been released. 768 * @throws { BusinessError } 16300003 - The target application is not the current application. 769 * @syscap SystemCapability.Ability.AbilityRuntime.Core 770 * @stagemodelonly 771 * @crossplatform 772 * @atomicservice 773 * @since arkts {'1.1':'18', '1.2':'20'} 774 * @arkts 1.1&1.2 775 */ 776 startAbility(want: Want, options?: StartOptions): Promise<void>; 777 778 /** 779 * Starts a new ability by implicit want. If the caller application is in foreground, you can use this method to start ability; 780 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 781 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 782 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 783 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 784 * 785 * @param { string } link - Indicates the ability to start. 786 * @param { OpenLinkOptions } [options] - Indicates the open link options. 787 * @param { AsyncCallback<AbilityResult> } [callback] - The callback is used to return the ability result. 788 * @returns { Promise<void> } The promise returned by the function. 789 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 790 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 791 * @throws { BusinessError } 16000001 - The specified ability does not exist. 792 * @throws { BusinessError } 16000002 - Incorrect ability type. 793 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 794 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 795 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 796 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 797 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 798 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 799 * @throws { BusinessError } 16000011 - The context does not exist. 800 * @throws { BusinessError } 16000012 - The application is controlled. 801 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 802 * @throws { BusinessError } 16000019 - No matching ability is found. 803 * @throws { BusinessError } 16200001 - The caller has been released. 804 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 805 * @syscap SystemCapability.Ability.AbilityRuntime.Core 806 * @stagemodelonly 807 * @atomicservice 808 * @since arkts {'1.1':'12', '1.2':'20'} 809 * @arkts 1.1&1.2 810 */ 811 openLink(link: string, options?: OpenLinkOptions, callback?: AsyncCallback<AbilityResult>): Promise<void>; 812 813 /** 814 * Starts a new ability using the original caller information. If the caller application is in foreground, 815 * you can use this method to start ability; If the caller application is in the background, 816 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 817 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 818 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 819 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 820 * 821 * @param { Want } want - Indicates the ability to start. 822 * @param { AsyncCallback<void> } callback - The callback of startAbility. 823 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 824 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 825 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 826 * 2. Incorrect parameter types; 3. Parameter verification failed. 827 * @throws { BusinessError } 16000001 - The specified ability does not exist. 828 * @throws { BusinessError } 16000002 - Incorrect ability type. 829 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 830 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 831 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 832 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 833 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 834 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 835 * @throws { BusinessError } 16000011 - The context does not exist. 836 * @throws { BusinessError } 16000012 - The application is controlled. 837 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 838 * @throws { BusinessError } 16000050 - Internal error. 839 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 840 * @throws { BusinessError } 16000055 - Installation-free timed out. 841 * @throws { BusinessError } 16200001 - The caller has been released. 842 * @syscap SystemCapability.Ability.AbilityRuntime.Core 843 * @systemapi 844 * @stagemodelonly 845 * @since 10 846 */ 847 /** 848 * Starts a new ability using the original caller information. If the caller application is in foreground, 849 * you can use this method to start ability; If the caller application is in the background, 850 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 851 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 852 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 853 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 854 * 855 * @param { Want } want - Indicates the ability to start. 856 * @param { AsyncCallback<void> } callback - The callback of startAbility. 857 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 858 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 859 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 860 * 2. Incorrect parameter types; 3. Parameter verification failed. 861 * @throws { BusinessError } 16000001 - The specified ability does not exist. 862 * @throws { BusinessError } 16000002 - Incorrect ability type. 863 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 864 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 865 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 866 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 867 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 868 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 869 * @throws { BusinessError } 16000011 - The context does not exist. 870 * @throws { BusinessError } 16000012 - The application is controlled. 871 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 872 * @throws { BusinessError } 16000050 - Internal error. 873 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 874 * @throws { BusinessError } 16000055 - Installation-free timed out. 875 * @throws { BusinessError } 16200001 - The caller has been released. 876 * @throws { BusinessError } 16000073 - The app clone index is invalid. 877 * @syscap SystemCapability.Ability.AbilityRuntime.Core 878 * @systemapi 879 * @stagemodelonly 880 * @since 12 881 */ 882 /** 883 * Starts a new ability using the original caller information. If the caller application is in foreground, 884 * you can use this method to start ability; If the caller application is in the background, 885 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 886 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 887 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 888 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 889 * 890 * @param { Want } want - Indicates the ability to start. 891 * @param { AsyncCallback<void> } callback - The callback of startAbility. 892 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 893 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 894 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 895 * 2. Incorrect parameter types; 3. Parameter verification failed. 896 * @throws { BusinessError } 16000001 - The specified ability does not exist. 897 * @throws { BusinessError } 16000002 - Incorrect ability type. 898 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 899 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 900 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 901 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 902 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 903 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 904 * @throws { BusinessError } 16000011 - The context does not exist. 905 * @throws { BusinessError } 16000012 - The application is controlled. 906 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 907 * @throws { BusinessError } 16000050 - Internal error. 908 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 909 * @throws { BusinessError } 16000055 - Installation-free timed out. 910 * @throws { BusinessError } 16000071 - App clone is not supported. 911 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 912 * @throws { BusinessError } 16000073 - The app clone index is invalid. 913 * @throws { BusinessError } 16000076 - The app instance key is invalid. 914 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 915 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 916 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 917 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 918 * @throws { BusinessError } 16200001 - The caller has been released. 919 * @syscap SystemCapability.Ability.AbilityRuntime.Core 920 * @systemapi 921 * @stagemodelonly 922 * @since 14 923 */ 924 startAbilityAsCaller(want: Want, callback: AsyncCallback<void>): void; 925 926 /** 927 * Starts a new ability using the original caller information. If the caller application is in foreground, 928 * you can use this method to start ability; If the caller application is in the background, 929 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 930 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 931 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 932 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 933 * 934 * @param { Want } want - Indicates the ability to start. 935 * @param { StartOptions } options - Indicates the start options. 936 * @param { AsyncCallback<void> } callback - The callback of startAbility. 937 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 938 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 939 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 940 * 2. Incorrect parameter types; 3. Parameter verification failed. 941 * @throws { BusinessError } 16000001 - The specified ability does not exist. 942 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 943 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 944 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 945 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 946 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 947 * @throws { BusinessError } 16000011 - The context does not exist. 948 * @throws { BusinessError } 16000012 - The application is controlled. 949 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 950 * @throws { BusinessError } 16000050 - Internal error. 951 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 952 * @throws { BusinessError } 16000055 - Installation-free timed out. 953 * @throws { BusinessError } 16200001 - The caller has been released. 954 * @syscap SystemCapability.Ability.AbilityRuntime.Core 955 * @systemapi 956 * @stagemodelonly 957 * @since 10 958 */ 959 /** 960 * Starts a new ability using the original caller information. If the caller application is in foreground, 961 * you can use this method to start ability; If the caller application is in the background, 962 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 963 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 964 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 965 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 966 * 967 * @param { Want } want - Indicates the ability to start. 968 * @param { StartOptions } options - Indicates the start options. 969 * @param { AsyncCallback<void> } callback - The callback of startAbility. 970 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 971 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 972 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 973 * 2. Incorrect parameter types; 3. Parameter verification failed. 974 * @throws { BusinessError } 16000001 - The specified ability does not exist. 975 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 976 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 977 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 978 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 979 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 980 * @throws { BusinessError } 16000011 - The context does not exist. 981 * @throws { BusinessError } 16000012 - The application is controlled. 982 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 983 * @throws { BusinessError } 16000050 - Internal error. 984 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 985 * @throws { BusinessError } 16000055 - Installation-free timed out. 986 * @throws { BusinessError } 16200001 - The caller has been released. 987 * @throws { BusinessError } 16000073 - The app clone index is invalid. 988 * @syscap SystemCapability.Ability.AbilityRuntime.Core 989 * @systemapi 990 * @stagemodelonly 991 * @since 12 992 */ 993 /** 994 * Starts a new ability using the original caller information. If the caller application is in foreground, 995 * you can use this method to start ability; If the caller application is in the background, 996 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 997 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 998 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 999 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1000 * 1001 * @param { Want } want - Indicates the ability to start. 1002 * @param { StartOptions } options - Indicates the start options. 1003 * @param { AsyncCallback<void> } callback - The callback of startAbility. 1004 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1005 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1006 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1007 * 2. Incorrect parameter types; 3. Parameter verification failed. 1008 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1009 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1010 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1011 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1012 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1013 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1014 * @throws { BusinessError } 16000011 - The context does not exist. 1015 * @throws { BusinessError } 16000012 - The application is controlled. 1016 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1017 * @throws { BusinessError } 16000050 - Internal error. 1018 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1019 * @throws { BusinessError } 16000055 - Installation-free timed out. 1020 * @throws { BusinessError } 16000071 - App clone is not supported. 1021 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1022 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1023 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1024 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1025 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1026 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1027 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1028 * @throws { BusinessError } 16200001 - The caller has been released. 1029 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1030 * @systemapi 1031 * @stagemodelonly 1032 * @since 14 1033 */ 1034 startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; 1035 1036 /** 1037 * Starts a new ability using the original caller information. If the caller application is in foreground, 1038 * you can use this method to start ability; If the caller application is in the background, 1039 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1040 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1041 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1042 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1043 * 1044 * @param { Want } want - Indicates the ability to start. 1045 * @param { StartOptions } options - Indicates the start options. 1046 * @returns { Promise<void> } The promise returned by the function. 1047 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1048 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1049 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1050 * 2. Incorrect parameter types; 3. Parameter verification failed. 1051 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1052 * @throws { BusinessError } 16000002 - Incorrect ability type. 1053 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1054 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1055 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1056 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1057 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1058 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1059 * @throws { BusinessError } 16000011 - The context does not exist. 1060 * @throws { BusinessError } 16000012 - The application is controlled. 1061 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1062 * @throws { BusinessError } 16000050 - Internal error. 1063 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1064 * @throws { BusinessError } 16000055 - Installation-free timed out. 1065 * @throws { BusinessError } 16200001 - The caller has been released. 1066 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1067 * @systemapi 1068 * @stagemodelonly 1069 * @since 10 1070 */ 1071 /** 1072 * Starts a new ability using the original caller information. If the caller application is in foreground, 1073 * you can use this method to start ability; If the caller application is in the background, 1074 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1075 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1076 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1077 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1078 * 1079 * @param { Want } want - Indicates the ability to start. 1080 * @param { StartOptions } options - Indicates the start options. 1081 * @returns { Promise<void> } The promise returned by the function. 1082 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1083 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1084 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1085 * 2. Incorrect parameter types; 3. Parameter verification failed. 1086 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1087 * @throws { BusinessError } 16000002 - Incorrect ability type. 1088 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1089 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1090 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1091 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1092 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1093 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1094 * @throws { BusinessError } 16000011 - The context does not exist. 1095 * @throws { BusinessError } 16000012 - The application is controlled. 1096 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1097 * @throws { BusinessError } 16000050 - Internal error. 1098 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1099 * @throws { BusinessError } 16000055 - Installation-free timed out. 1100 * @throws { BusinessError } 16200001 - The caller has been released. 1101 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1102 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1103 * @systemapi 1104 * @stagemodelonly 1105 * @since 12 1106 */ 1107 /** 1108 * Starts a new ability using the original caller information. If the caller application is in foreground, 1109 * you can use this method to start ability; If the caller application is in the background, 1110 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1111 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1112 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1113 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1114 * 1115 * @param { Want } want - Indicates the ability to start. 1116 * @param { StartOptions } options - Indicates the start options. 1117 * @returns { Promise<void> } The promise returned by the function. 1118 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1119 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1120 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1121 * 2. Incorrect parameter types; 3. Parameter verification failed. 1122 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1123 * @throws { BusinessError } 16000002 - Incorrect ability type. 1124 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1125 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1126 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1127 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1128 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1129 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1130 * @throws { BusinessError } 16000011 - The context does not exist. 1131 * @throws { BusinessError } 16000012 - The application is controlled. 1132 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1133 * @throws { BusinessError } 16000050 - Internal error. 1134 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1135 * @throws { BusinessError } 16000055 - Installation-free timed out. 1136 * @throws { BusinessError } 16000071 - App clone is not supported. 1137 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1138 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1139 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1140 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1141 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1142 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1143 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1144 * @throws { BusinessError } 16200001 - The caller has been released. 1145 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1146 * @systemapi 1147 * @stagemodelonly 1148 * @since 14 1149 */ 1150 startAbilityAsCaller(want: Want, options?: StartOptions): Promise<void>; 1151 1152 /** 1153 * Get the caller object of the startup capability. 1154 * 1155 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 1156 * @param { Want } want - Indicates the ability to start. 1157 * @returns { Promise<Caller> } Returns the Caller interface. 1158 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1159 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1160 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1161 * @throws { BusinessError } 16000002 - Incorrect ability type. 1162 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1163 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1164 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1165 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1166 * @throws { BusinessError } 16000011 - The context does not exist. 1167 * @throws { BusinessError } 16000050 - Internal error. 1168 * @throws { BusinessError } 16200001 - The caller has been released. 1169 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1170 * @stagemodelonly 1171 * @since 9 1172 */ 1173 /** 1174 * Get the caller object of the startup capability. 1175 * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION to use this method. 1176 * If the caller application is in foreground, you can use this method to start ability; 1177 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1178 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1179 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1180 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1181 * 1182 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 1183 * @param { Want } want - Indicates the ability to start. 1184 * @returns { Promise<Caller> } Returns the Caller interface. 1185 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1186 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1187 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1188 * @throws { BusinessError } 16000002 - Incorrect ability type. 1189 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1190 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1191 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1192 * @throws { BusinessError } 16000011 - The context does not exist. 1193 * @throws { BusinessError } 16000012 - The application is controlled. 1194 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1195 * @throws { BusinessError } 16000050 - Internal error. 1196 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1197 * @stagemodelonly 1198 * @since 10 1199 */ 1200 /** 1201 * Get the caller object of the startup capability in cross-device. 1202 * 1203 * If the caller application is in foreground, you can use this method to start ability; 1204 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1205 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1206 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1207 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1208 * 1209 * @permission ohos.permission.DISTRIBUTED_DATASYNC 1210 * @param { Want } want - Indicates the ability to start. 1211 * @returns { Promise<Caller> } Returns the Caller interface. 1212 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1213 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1214 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1215 * @throws { BusinessError } 16000002 - Incorrect ability type. 1216 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1217 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1218 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1219 * @throws { BusinessError } 16000011 - The context does not exist. 1220 * @throws { BusinessError } 16000012 - The application is controlled. 1221 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1222 * @throws { BusinessError } 16000050 - Internal error. 1223 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1224 * @stagemodelonly 1225 * @since 11 1226 */ 1227 /** 1228 * Get the caller object of the startup capability in cross-device. 1229 * 1230 * If the caller application is in foreground, you can use this method to start ability; 1231 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1232 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1233 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1234 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1235 * 1236 * @permission ohos.permission.DISTRIBUTED_DATASYNC 1237 * @param { Want } want - Indicates the ability to start. 1238 * @returns { Promise<Caller> } Returns the Caller interface. 1239 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1240 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1241 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1242 * @throws { BusinessError } 16000002 - Incorrect ability type. 1243 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1244 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1245 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1246 * @throws { BusinessError } 16000011 - The context does not exist. 1247 * @throws { BusinessError } 16000012 - The application is controlled. 1248 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1249 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 1250 * @throws { BusinessError } 16000050 - Internal error. 1251 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1252 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1253 * @stagemodelonly 1254 * @since 12 1255 */ 1256 /** 1257 * Get the caller object of the startup capability in cross-device. 1258 * 1259 * If the caller application is in foreground, you can use this method to start ability; 1260 * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1261 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1262 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1263 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1264 * 1265 * @permission ohos.permission.DISTRIBUTED_DATASYNC 1266 * @param { Want } want - Indicates the ability to start. 1267 * @returns { Promise<Caller> } Returns the Caller interface. 1268 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1269 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1270 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1271 * @throws { BusinessError } 16000002 - Incorrect ability type. 1272 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1273 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1274 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1275 * @throws { BusinessError } 16000011 - The context does not exist. 1276 * @throws { BusinessError } 16000012 - The application is controlled. 1277 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1278 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 1279 * @throws { BusinessError } 16000050 - Internal error. 1280 * @throws { BusinessError } 16000071 - App clone is not supported. 1281 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1282 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1283 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1284 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1285 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1286 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1287 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1288 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1289 * @stagemodelonly 1290 * @since 14 1291 */ 1292 startAbilityByCall(want: Want): Promise<Caller>; 1293 1294 /** 1295 * Get the caller object that specifies the accountId startup capability 1296 * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 1297 * and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS to use this method. 1298 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 1299 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1300 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1301 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1302 * 1303 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1304 * @param { Want } want - Indicates the ability to start. 1305 * @param { number } accountId - Indicates the account to start. 1306 * @returns { Promise<Caller> } Returns the Caller interface. 1307 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1308 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1309 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1310 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1311 * @throws { BusinessError } 16000002 - Incorrect ability type. 1312 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1313 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1314 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1315 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1316 * @throws { BusinessError } 16000011 - The context does not exist. 1317 * @throws { BusinessError } 16000012 - The application is controlled. 1318 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1319 * @throws { BusinessError } 16000050 - Internal error. 1320 * @throws { BusinessError } 16200001 - The caller has been released. 1321 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1322 * @systemapi 1323 * @stagemodelonly 1324 * @since 10 1325 */ 1326 /** 1327 * Get the caller object that specifies the accountId startup capability 1328 * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 1329 * and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS to use this method. 1330 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 1331 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1332 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1333 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1334 * 1335 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1336 * @param { Want } want - Indicates the ability to start. 1337 * @param { number } accountId - Indicates the account to start. 1338 * @returns { Promise<Caller> } Returns the Caller interface. 1339 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1340 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1341 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1342 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1343 * @throws { BusinessError } 16000002 - Incorrect ability type. 1344 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1345 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1346 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1347 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1348 * @throws { BusinessError } 16000011 - The context does not exist. 1349 * @throws { BusinessError } 16000012 - The application is controlled. 1350 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1351 * @throws { BusinessError } 16000050 - Internal error. 1352 * @throws { BusinessError } 16200001 - The caller has been released. 1353 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1354 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1355 * @systemapi 1356 * @stagemodelonly 1357 * @since 12 1358 */ 1359 /** 1360 * Get the caller object that specifies the accountId startup capability 1361 * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 1362 * and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS to use this method. 1363 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 1364 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1365 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1366 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1367 * 1368 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1369 * @param { Want } want - Indicates the ability to start. 1370 * @param { number } accountId - Indicates the account to start. 1371 * @returns { Promise<Caller> } Returns the Caller interface. 1372 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1373 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1374 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1375 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1376 * @throws { BusinessError } 16000002 - Incorrect ability type. 1377 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1378 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1379 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1380 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1381 * @throws { BusinessError } 16000011 - The context does not exist. 1382 * @throws { BusinessError } 16000012 - The application is controlled. 1383 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1384 * @throws { BusinessError } 16000050 - Internal error. 1385 * @throws { BusinessError } 16000071 - App clone is not supported. 1386 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1387 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1388 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1389 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1390 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1391 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1392 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1393 * @throws { BusinessError } 16200001 - The caller has been released. 1394 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1395 * @systemapi 1396 * @stagemodelonly 1397 * @since 14 1398 */ 1399 startAbilityByCallWithAccount(want: Want, accountId: number): Promise<Caller>; 1400 1401 /** 1402 * Starts a new ability with account. If the caller application is in foreground, 1403 * you can use this method to start ability; If the caller application is in the background, 1404 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1405 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1406 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1407 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1408 * 1409 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1410 * @param { Want } want - Indicates the want info to start. 1411 * @param { number } accountId - Indicates the account to start. 1412 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1413 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1414 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1415 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1416 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1417 * @throws { BusinessError } 16000002 - Incorrect ability type. 1418 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1419 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1420 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1421 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1422 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1423 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1424 * @throws { BusinessError } 16000011 - The context does not exist. 1425 * @throws { BusinessError } 16000012 - The application is controlled. 1426 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1427 * @throws { BusinessError } 16000050 - Internal error. 1428 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1429 * @throws { BusinessError } 16000055 - Installation-free timed out. 1430 * @throws { BusinessError } 16200001 - The caller has been released. 1431 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1432 * @systemapi 1433 * @stagemodelonly 1434 * @since 9 1435 */ 1436 /** 1437 * Starts a new ability with account. If the caller application is in foreground, 1438 * you can use this method to start ability; If the caller application is in the background, 1439 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1440 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1441 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1442 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1443 * 1444 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1445 * @param { Want } want - Indicates the want info to start. 1446 * @param { number } accountId - Indicates the account to start. 1447 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1448 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1449 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1450 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1451 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1452 * @throws { BusinessError } 16000002 - Incorrect ability type. 1453 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1454 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1455 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1456 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1457 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1458 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1459 * @throws { BusinessError } 16000011 - The context does not exist. 1460 * @throws { BusinessError } 16000012 - The application is controlled. 1461 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1462 * @throws { BusinessError } 16000019 - No matching ability is found. 1463 * @throws { BusinessError } 16000050 - Internal error. 1464 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1465 * @throws { BusinessError } 16000055 - Installation-free timed out. 1466 * @throws { BusinessError } 16200001 - The caller has been released. 1467 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1468 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1469 * @systemapi 1470 * @stagemodelonly 1471 * @since 12 1472 */ 1473 /** 1474 * Starts a new ability with account. If the caller application is in foreground, 1475 * you can use this method to start ability; If the caller application is in the background, 1476 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1477 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1478 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1479 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1480 * 1481 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1482 * @param { Want } want - Indicates the want info to start. 1483 * @param { number } accountId - Indicates the account to start. 1484 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1485 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1486 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1487 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1488 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1489 * @throws { BusinessError } 16000002 - Incorrect ability type. 1490 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1491 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1492 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1493 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1494 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1495 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1496 * @throws { BusinessError } 16000011 - The context does not exist. 1497 * @throws { BusinessError } 16000012 - The application is controlled. 1498 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1499 * @throws { BusinessError } 16000019 - No matching ability is found. 1500 * @throws { BusinessError } 16000050 - Internal error. 1501 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1502 * @throws { BusinessError } 16000055 - Installation-free timed out. 1503 * @throws { BusinessError } 16000071 - App clone is not supported. 1504 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1505 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1506 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1507 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1508 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1509 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1510 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1511 * @throws { BusinessError } 16200001 - The caller has been released. 1512 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1513 * @systemapi 1514 * @stagemodelonly 1515 * @since 14 1516 */ 1517 startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void; 1518 1519 /** 1520 * Starts a new ability with account. 1521 * 1522 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1523 * @param { Want } want - Indicates the want info to start. 1524 * @param { number } accountId - Indicates the account to start. 1525 * @param { StartOptions } options - Indicates the start options. 1526 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1527 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1528 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1529 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1530 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1531 * @throws { BusinessError } 16000002 - Incorrect ability type. 1532 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1533 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1534 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1535 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1536 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1537 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1538 * @throws { BusinessError } 16000011 - The context does not exist. 1539 * @throws { BusinessError } 16000050 - Internal error. 1540 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1541 * @throws { BusinessError } 16000055 - Installation-free timed out. 1542 * @throws { BusinessError } 16200001 - The caller has been released. 1543 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1544 * @systemapi 1545 * @stagemodelonly 1546 * @since 9 1547 */ 1548 /** 1549 * Starts a new ability with account. If the caller application is in foreground, 1550 * you can use this method to start ability; If the caller application is in the background, 1551 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1552 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1553 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1554 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1555 * 1556 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1557 * @param { Want } want - Indicates the want info to start. 1558 * @param { number } accountId - Indicates the account to start. 1559 * @param { StartOptions } options - Indicates the start options. 1560 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1561 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1562 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1563 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1564 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1565 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1566 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1567 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1568 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1569 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1570 * @throws { BusinessError } 16000011 - The context does not exist. 1571 * @throws { BusinessError } 16000012 - The application is controlled. 1572 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1573 * @throws { BusinessError } 16000050 - Internal error. 1574 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1575 * @throws { BusinessError } 16000055 - Installation-free timed out. 1576 * @throws { BusinessError } 16200001 - The caller has been released. 1577 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1578 * @systemapi 1579 * @stagemodelonly 1580 * @since 10 1581 */ 1582 /** 1583 * Starts a new ability with account. If the caller application is in foreground, 1584 * you can use this method to start ability; If the caller application is in the background, 1585 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1586 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1587 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1588 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1589 * 1590 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1591 * @param { Want } want - Indicates the want info to start. 1592 * @param { number } accountId - Indicates the account to start. 1593 * @param { StartOptions } options - Indicates the start options. 1594 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1595 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1596 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1597 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1598 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1599 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1600 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1601 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1602 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1603 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1604 * @throws { BusinessError } 16000011 - The context does not exist. 1605 * @throws { BusinessError } 16000012 - The application is controlled. 1606 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1607 * @throws { BusinessError } 16000019 - No matching ability is found. 1608 * @throws { BusinessError } 16000050 - Internal error. 1609 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1610 * @throws { BusinessError } 16000055 - Installation-free timed out. 1611 * @throws { BusinessError } 16200001 - The caller has been released. 1612 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1613 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1614 * @systemapi 1615 * @stagemodelonly 1616 * @since 12 1617 */ 1618 /** 1619 * Starts a new ability with account. If the caller application is in foreground, 1620 * you can use this method to start ability; If the caller application is in the background, 1621 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1622 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1623 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1624 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1625 * 1626 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1627 * @param { Want } want - Indicates the want info to start. 1628 * @param { number } accountId - Indicates the account to start. 1629 * @param { StartOptions } options - Indicates the start options. 1630 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1631 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1632 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1633 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1634 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1635 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1636 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1637 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1638 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1639 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1640 * @throws { BusinessError } 16000011 - The context does not exist. 1641 * @throws { BusinessError } 16000012 - The application is controlled. 1642 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1643 * @throws { BusinessError } 16000019 - No matching ability is found. 1644 * @throws { BusinessError } 16000050 - Internal error. 1645 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1646 * @throws { BusinessError } 16000055 - Installation-free timed out. 1647 * @throws { BusinessError } 16000071 - App clone is not supported. 1648 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1649 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1650 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1651 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1652 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1653 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1654 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1655 * @throws { BusinessError } 16200001 - The caller has been released. 1656 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1657 * @systemapi 1658 * @stagemodelonly 1659 * @since 14 1660 */ 1661 startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void; 1662 1663 /** 1664 * Starts a new ability with account. If the caller application is in foreground, 1665 * you can use this method to start ability; If the caller application is in the background, 1666 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1667 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1668 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1669 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1670 * 1671 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1672 * @param { Want } want - Indicates the want info to start. 1673 * @param { number } accountId - Indicates the account to start. 1674 * @param { StartOptions } [options] - Indicates the start options. 1675 * @returns { Promise<void> } The promise returned by the function. 1676 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1677 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1678 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1679 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1680 * @throws { BusinessError } 16000002 - Incorrect ability type. 1681 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1682 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1683 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1684 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1685 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1686 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1687 * @throws { BusinessError } 16000011 - The context does not exist. 1688 * @throws { BusinessError } 16000012 - The application is controlled. 1689 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1690 * @throws { BusinessError } 16000050 - Internal error. 1691 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1692 * @throws { BusinessError } 16000055 - Installation-free timed out. 1693 * @throws { BusinessError } 16200001 - The caller has been released. 1694 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1695 * @systemapi 1696 * @stagemodelonly 1697 * @since 9 1698 */ 1699 /** 1700 * Starts a new ability with account. If the caller application is in foreground, 1701 * you can use this method to start ability; If the caller application is in the background, 1702 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1703 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1704 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1705 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1706 * 1707 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1708 * @param { Want } want - Indicates the want info to start. 1709 * @param { number } accountId - Indicates the account to start. 1710 * @param { StartOptions } [options] - Indicates the start options. 1711 * @returns { Promise<void> } The promise returned by the function. 1712 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1713 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1714 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1715 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1716 * @throws { BusinessError } 16000002 - Incorrect ability type. 1717 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1718 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1719 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1720 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1721 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1722 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1723 * @throws { BusinessError } 16000011 - The context does not exist. 1724 * @throws { BusinessError } 16000012 - The application is controlled. 1725 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1726 * @throws { BusinessError } 16000019 - No matching ability is found. 1727 * @throws { BusinessError } 16000050 - Internal error. 1728 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1729 * @throws { BusinessError } 16000055 - Installation-free timed out. 1730 * @throws { BusinessError } 16200001 - The caller has been released. 1731 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1732 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1733 * @systemapi 1734 * @stagemodelonly 1735 * @since 12 1736 */ 1737 /** 1738 * Starts a new ability with account. If the caller application is in foreground, 1739 * you can use this method to start ability; If the caller application is in the background, 1740 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1741 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1742 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1743 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1744 * 1745 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1746 * @param { Want } want - Indicates the want info to start. 1747 * @param { number } accountId - Indicates the account to start. 1748 * @param { StartOptions } [options] - Indicates the start options. 1749 * @returns { Promise<void> } The promise returned by the function. 1750 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1751 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1752 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1753 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1754 * @throws { BusinessError } 16000002 - Incorrect ability type. 1755 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1756 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1757 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1758 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1759 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1760 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1761 * @throws { BusinessError } 16000011 - The context does not exist. 1762 * @throws { BusinessError } 16000012 - The application is controlled. 1763 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1764 * @throws { BusinessError } 16000019 - No matching ability is found. 1765 * @throws { BusinessError } 16000050 - Internal error. 1766 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1767 * @throws { BusinessError } 16000055 - Installation-free timed out. 1768 * @throws { BusinessError } 16000071 - App clone is not supported. 1769 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1770 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1771 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1772 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1773 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1774 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1775 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1776 * @throws { BusinessError } 16200001 - The caller has been released. 1777 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1778 * @systemapi 1779 * @stagemodelonly 1780 * @since 14 1781 */ 1782 startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void>; 1783 1784 /** 1785 * Starts an ability and returns the execution result when the ability is destroyed. 1786 * 1787 * @param { Want } want - Indicates the ability to start. 1788 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 1789 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1790 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1791 * @throws { BusinessError } 16000002 - Incorrect ability type. 1792 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1793 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1794 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1795 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1796 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1797 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1798 * @throws { BusinessError } 16000011 - The context does not exist. 1799 * @throws { BusinessError } 16000050 - Internal error. 1800 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1801 * @throws { BusinessError } 16000055 - Installation-free timed out. 1802 * @throws { BusinessError } 16200001 - The caller has been released. 1803 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1804 * @stagemodelonly 1805 * @since 9 1806 */ 1807 /** 1808 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 1809 * you can use this method to start ability; If the caller application is in the background, 1810 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1811 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1812 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1813 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1814 * 1815 * @param { Want } want - Indicates the ability to start. 1816 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 1817 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1818 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1819 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1820 * @throws { BusinessError } 16000002 - Incorrect ability type. 1821 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1822 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1823 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1824 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1825 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1826 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1827 * @throws { BusinessError } 16000011 - The context does not exist. 1828 * @throws { BusinessError } 16000012 - The application is controlled. 1829 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1830 * @throws { BusinessError } 16000050 - Internal error. 1831 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1832 * @throws { BusinessError } 16000055 - Installation-free timed out. 1833 * @throws { BusinessError } 16200001 - The caller has been released. 1834 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1835 * @stagemodelonly 1836 * @since 10 1837 */ 1838 /** 1839 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 1840 * you can use this method to start ability; If the caller application is in the background, 1841 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1842 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1843 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1844 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1845 * 1846 * @param { Want } want - Indicates the ability to start. 1847 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 1848 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1849 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1850 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1851 * @throws { BusinessError } 16000002 - Incorrect ability type. 1852 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1853 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1854 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1855 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1856 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1857 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1858 * @throws { BusinessError } 16000011 - The context does not exist. 1859 * @throws { BusinessError } 16000012 - The application is controlled. 1860 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1861 * @throws { BusinessError } 16000050 - Internal error. 1862 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1863 * @throws { BusinessError } 16000055 - Installation-free timed out. 1864 * @throws { BusinessError } 16200001 - The caller has been released. 1865 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1866 * @stagemodelonly 1867 * @atomicservice 1868 * @since 11 1869 */ 1870 /** 1871 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 1872 * you can use this method to start ability; If the caller application is in the background, 1873 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1874 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1875 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1876 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1877 * 1878 * @param { Want } want - Indicates the ability to start. 1879 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 1880 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1881 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1882 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1883 * @throws { BusinessError } 16000002 - Incorrect ability type. 1884 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1885 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1886 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1887 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1888 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1889 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1890 * @throws { BusinessError } 16000011 - The context does not exist. 1891 * @throws { BusinessError } 16000012 - The application is controlled. 1892 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1893 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 1894 * @throws { BusinessError } 16000019 - No matching ability is found. 1895 * @throws { BusinessError } 16000050 - Internal error. 1896 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1897 * @throws { BusinessError } 16000055 - Installation-free timed out. 1898 * @throws { BusinessError } 16200001 - The caller has been released. 1899 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1900 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1901 * @stagemodelonly 1902 * @atomicservice 1903 * @since 12 1904 */ 1905 /** 1906 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 1907 * you can use this method to start ability; If the caller application is in the background, 1908 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1909 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1910 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1911 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1912 * 1913 * @param { Want } want - Indicates the ability to start. 1914 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 1915 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1916 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1917 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1918 * @throws { BusinessError } 16000002 - Incorrect ability type. 1919 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1920 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1921 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1922 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1923 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1924 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1925 * @throws { BusinessError } 16000011 - The context does not exist. 1926 * @throws { BusinessError } 16000012 - The application is controlled. 1927 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1928 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 1929 * @throws { BusinessError } 16000019 - No matching ability is found. 1930 * @throws { BusinessError } 16000050 - Internal error. 1931 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1932 * @throws { BusinessError } 16000055 - Installation-free timed out. 1933 * @throws { BusinessError } 16000071 - App clone is not supported. 1934 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1935 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1936 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1937 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1938 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1939 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1940 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1941 * @throws { BusinessError } 16200001 - The caller has been released. 1942 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1943 * @stagemodelonly 1944 * @atomicservice 1945 * @since 14 1946 */ 1947 /** 1948 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 1949 * you can use this method to start ability; If the caller application is in the background, 1950 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1951 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1952 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1953 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1954 * 1955 * @param { Want } want - Indicates the ability to start. 1956 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 1957 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1958 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 1959 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1960 * @throws { BusinessError } 16000002 - Incorrect ability type. 1961 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1962 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1963 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1964 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1965 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1966 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1967 * @throws { BusinessError } 16000011 - The context does not exist. 1968 * @throws { BusinessError } 16000012 - The application is controlled. 1969 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1970 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 1971 * @throws { BusinessError } 16000019 - No matching ability is found. 1972 * @throws { BusinessError } 16000050 - Internal error. 1973 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1974 * @throws { BusinessError } 16000055 - Installation-free timed out. 1975 * @throws { BusinessError } 16000071 - App clone is not supported. 1976 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1977 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1978 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1979 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1980 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1981 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1982 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1983 * @throws { BusinessError } 16200001 - The caller has been released. 1984 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1985 * @stagemodelonly 1986 * @crossplatform 1987 * @atomicservice 1988 * @since arkts {'1.1':'18', '1.2':'20'} 1989 * @arkts 1.1&1.2 1990 */ 1991 startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void; 1992 1993 /** 1994 * Starts an ability and returns the execution result when the ability is destroyed. 1995 * 1996 * @param { Want } want - Indicates the ability to start. 1997 * @param { StartOptions } options - Indicates the start options. 1998 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 1999 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2000 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2001 * @throws { BusinessError } 16000002 - Incorrect ability type. 2002 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2003 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2004 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2005 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2006 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2007 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2008 * @throws { BusinessError } 16000011 - The context does not exist. 2009 * @throws { BusinessError } 16000050 - Internal error. 2010 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2011 * @throws { BusinessError } 16000055 - Installation-free timed out. 2012 * @throws { BusinessError } 16200001 - The caller has been released. 2013 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2014 * @stagemodelonly 2015 * @since 9 2016 */ 2017 /** 2018 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2019 * you can use this method to start ability; If the caller application is in the background, 2020 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2021 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2022 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2023 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2024 * 2025 * @param { Want } want - Indicates the ability to start. 2026 * @param { StartOptions } options - Indicates the start options. 2027 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2028 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2029 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2030 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2031 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2032 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2033 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2034 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2035 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2036 * @throws { BusinessError } 16000011 - The context does not exist. 2037 * @throws { BusinessError } 16000012 - The application is controlled. 2038 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2039 * @throws { BusinessError } 16000050 - Internal error. 2040 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2041 * @throws { BusinessError } 16000055 - Installation-free timed out. 2042 * @throws { BusinessError } 16200001 - The caller has been released. 2043 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2044 * @stagemodelonly 2045 * @since 10 2046 */ 2047 /** 2048 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2049 * you can use this method to start ability; If the caller application is in the background, 2050 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2051 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2052 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2053 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2054 * 2055 * @param { Want } want - Indicates the ability to start. 2056 * @param { StartOptions } options - Indicates the start options. 2057 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2058 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2059 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2060 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2061 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2062 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2063 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2064 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2065 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2066 * @throws { BusinessError } 16000011 - The context does not exist. 2067 * @throws { BusinessError } 16000012 - The application is controlled. 2068 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2069 * @throws { BusinessError } 16000050 - Internal error. 2070 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2071 * @throws { BusinessError } 16000055 - Installation-free timed out. 2072 * @throws { BusinessError } 16200001 - The caller has been released. 2073 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2074 * @stagemodelonly 2075 * @atomicservice 2076 * @since 11 2077 */ 2078 /** 2079 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2080 * you can use this method to start ability; If the caller application is in the background, 2081 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2082 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2083 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2084 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2085 * 2086 * @param { Want } want - Indicates the ability to start. 2087 * @param { StartOptions } options - Indicates the start options. 2088 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2089 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2090 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2091 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2092 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2093 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2094 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2095 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2096 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2097 * @throws { BusinessError } 16000011 - The context does not exist. 2098 * @throws { BusinessError } 16000012 - The application is controlled. 2099 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2100 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 2101 * @throws { BusinessError } 16000019 - No matching ability is found. 2102 * @throws { BusinessError } 16000050 - Internal error. 2103 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2104 * @throws { BusinessError } 16000055 - Installation-free timed out. 2105 * @throws { BusinessError } 16200001 - The caller has been released. 2106 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2107 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2108 * @stagemodelonly 2109 * @atomicservice 2110 * @since 12 2111 */ 2112 /** 2113 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2114 * you can use this method to start ability; If the caller application is in the background, 2115 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2116 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2117 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2118 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2119 * 2120 * @param { Want } want - Indicates the ability to start. 2121 * @param { StartOptions } options - Indicates the start options. 2122 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2123 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2124 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2125 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2126 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2127 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2128 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2129 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2130 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2131 * @throws { BusinessError } 16000011 - The context does not exist. 2132 * @throws { BusinessError } 16000012 - The application is controlled. 2133 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2134 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 2135 * @throws { BusinessError } 16000019 - No matching ability is found. 2136 * @throws { BusinessError } 16000050 - Internal error. 2137 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2138 * @throws { BusinessError } 16000055 - Installation-free timed out. 2139 * @throws { BusinessError } 16000071 - App clone is not supported. 2140 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2141 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2142 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2143 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2144 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2145 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2146 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2147 * @throws { BusinessError } 16200001 - The caller has been released. 2148 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2149 * @stagemodelonly 2150 * @atomicservice 2151 * @since 14 2152 */ 2153 /** 2154 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2155 * you can use this method to start ability; If the caller application is in the background, 2156 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2157 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2158 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2159 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2160 * 2161 * @param { Want } want - Indicates the ability to start. 2162 * @param { StartOptions } options - Indicates the start options. 2163 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2164 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2165 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2166 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2167 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2168 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2169 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2170 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2171 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2172 * @throws { BusinessError } 16000011 - The context does not exist. 2173 * @throws { BusinessError } 16000012 - The application is controlled. 2174 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2175 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 2176 * @throws { BusinessError } 16000019 - No matching ability is found. 2177 * @throws { BusinessError } 16000050 - Internal error. 2178 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2179 * @throws { BusinessError } 16000055 - Installation-free timed out. 2180 * @throws { BusinessError } 16000071 - App clone is not supported. 2181 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2182 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2183 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2184 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2185 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2186 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2187 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2188 * @throws { BusinessError } 16200001 - The caller has been released. 2189 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2190 * @stagemodelonly 2191 * @crossplatform 2192 * @atomicservice 2193 * @since arkts {'1.1':'18', '1.2':'20'} 2194 * @arkts 1.1&1.2 2195 */ 2196 startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void; 2197 2198 /** 2199 * Starts an ability and returns the execution result when the ability is destroyed. 2200 * 2201 * @param { Want } want - Indicates the ability to start. 2202 * @param { StartOptions } [options] - Indicates the start options. 2203 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2204 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2205 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2206 * @throws { BusinessError } 16000002 - Incorrect ability type. 2207 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2208 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2209 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2210 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2211 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2212 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2213 * @throws { BusinessError } 16000011 - The context does not exist. 2214 * @throws { BusinessError } 16000050 - Internal error. 2215 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2216 * @throws { BusinessError } 16000055 - Installation-free timed out. 2217 * @throws { BusinessError } 16200001 - The caller has been released. 2218 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2219 * @stagemodelonly 2220 * @since 9 2221 */ 2222 /** 2223 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2224 * you can use this method to start ability; If the caller application is in the background, 2225 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2226 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2227 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2228 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2229 * 2230 * @param { Want } want - Indicates the ability to start. 2231 * @param { StartOptions } [options] - Indicates the start options. 2232 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2233 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2234 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2235 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2236 * @throws { BusinessError } 16000002 - Incorrect ability type. 2237 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2238 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2239 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2240 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2241 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2242 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2243 * @throws { BusinessError } 16000011 - The context does not exist. 2244 * @throws { BusinessError } 16000012 - The application is controlled. 2245 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2246 * @throws { BusinessError } 16000050 - Internal error. 2247 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2248 * @throws { BusinessError } 16000055 - Installation-free timed out. 2249 * @throws { BusinessError } 16200001 - The caller has been released. 2250 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2251 * @stagemodelonly 2252 * @since 10 2253 */ 2254 /** 2255 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2256 * you can use this method to start ability; If the caller application is in the background, 2257 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2258 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2259 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2260 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2261 * 2262 * @param { Want } want - Indicates the ability to start. 2263 * @param { StartOptions } [options] - Indicates the start options. 2264 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2265 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2266 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2267 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2268 * @throws { BusinessError } 16000002 - Incorrect ability type. 2269 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2270 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2271 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2272 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2273 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2274 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2275 * @throws { BusinessError } 16000011 - The context does not exist. 2276 * @throws { BusinessError } 16000012 - The application is controlled. 2277 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2278 * @throws { BusinessError } 16000050 - Internal error. 2279 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2280 * @throws { BusinessError } 16000055 - Installation-free timed out. 2281 * @throws { BusinessError } 16200001 - The caller has been released. 2282 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2283 * @stagemodelonly 2284 * @atomicservice 2285 * @since 11 2286 */ 2287 /** 2288 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2289 * you can use this method to start ability; If the caller application is in the background, 2290 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2291 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2292 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2293 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2294 * 2295 * @param { Want } want - Indicates the ability to start. 2296 * @param { StartOptions } [options] - Indicates the start options. 2297 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2298 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2299 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2300 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2301 * @throws { BusinessError } 16000002 - Incorrect ability type. 2302 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2303 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2304 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2305 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2306 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2307 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2308 * @throws { BusinessError } 16000011 - The context does not exist. 2309 * @throws { BusinessError } 16000012 - The application is controlled. 2310 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2311 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 2312 * @throws { BusinessError } 16000019 - No matching ability is found. 2313 * @throws { BusinessError } 16000050 - Internal error. 2314 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2315 * @throws { BusinessError } 16000055 - Installation-free timed out. 2316 * @throws { BusinessError } 16200001 - The caller has been released. 2317 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2318 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2319 * @stagemodelonly 2320 * @atomicservice 2321 * @since 12 2322 */ 2323 /** 2324 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2325 * you can use this method to start ability; If the caller application is in the background, 2326 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2327 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2328 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2329 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2330 * 2331 * @param { Want } want - Indicates the ability to start. 2332 * @param { StartOptions } [options] - Indicates the start options. 2333 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2334 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2335 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2336 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2337 * @throws { BusinessError } 16000002 - Incorrect ability type. 2338 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2339 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2340 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2341 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2342 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2343 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2344 * @throws { BusinessError } 16000011 - The context does not exist. 2345 * @throws { BusinessError } 16000012 - The application is controlled. 2346 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2347 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 2348 * @throws { BusinessError } 16000019 - No matching ability is found. 2349 * @throws { BusinessError } 16000050 - Internal error. 2350 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2351 * @throws { BusinessError } 16000055 - Installation-free timed out. 2352 * @throws { BusinessError } 16000071 - App clone is not supported. 2353 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2354 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2355 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2356 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2357 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2358 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2359 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2360 * @throws { BusinessError } 16200001 - The caller has been released. 2361 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2362 * @stagemodelonly 2363 * @atomicservice 2364 * @since 14 2365 */ 2366 /** 2367 * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, 2368 * you can use this method to start ability; If the caller application is in the background, 2369 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2370 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2371 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2372 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2373 * 2374 * @param { Want } want - Indicates the ability to start. 2375 * @param { StartOptions } [options] - Indicates the start options. 2376 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2377 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2378 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2379 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2380 * @throws { BusinessError } 16000002 - Incorrect ability type. 2381 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2382 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2383 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2384 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2385 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2386 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2387 * @throws { BusinessError } 16000011 - The context does not exist. 2388 * @throws { BusinessError } 16000012 - The application is controlled. 2389 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2390 * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version greater than 11. 2391 * @throws { BusinessError } 16000019 - No matching ability is found. 2392 * @throws { BusinessError } 16000050 - Internal error. 2393 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2394 * @throws { BusinessError } 16000055 - Installation-free timed out. 2395 * @throws { BusinessError } 16000071 - App clone is not supported. 2396 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2397 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2398 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2399 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2400 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2401 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2402 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2403 * @throws { BusinessError } 16200001 - The caller has been released. 2404 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2405 * @stagemodelonly 2406 * @crossplatform 2407 * @atomicservice 2408 * @since arkts {'1.1':'18', '1.2':'20'} 2409 * @arkts 1.1&1.2 2410 */ 2411 startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>; 2412 2413 /** 2414 * Starts an ability and returns the execution result when the ability is destroyed with account. 2415 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2416 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2417 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2418 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2419 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2420 * 2421 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2422 * @param { Want } want - Indicates the want info to start. 2423 * @param { number } accountId - Indicates the account to start. 2424 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2425 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2426 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2427 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2428 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2429 * @throws { BusinessError } 16000002 - Incorrect ability type. 2430 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2431 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2432 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2433 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2434 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2435 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2436 * @throws { BusinessError } 16000011 - The context does not exist. 2437 * @throws { BusinessError } 16000050 - Internal error. 2438 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2439 * @throws { BusinessError } 16000055 - Installation-free timed out. 2440 * @throws { BusinessError } 16200001 - The caller has been released. 2441 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2442 * @systemapi 2443 * @stagemodelonly 2444 * @since 9 2445 */ 2446 /** 2447 * Starts an ability and returns the execution result when the ability is destroyed with account. 2448 * 2449 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2450 * @param { Want } want - Indicates the want info to start. 2451 * @param { number } accountId - Indicates the account to start. 2452 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2453 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2454 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2455 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2456 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2457 * @throws { BusinessError } 16000002 - Incorrect ability type. 2458 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2459 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2460 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2461 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2462 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2463 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2464 * @throws { BusinessError } 16000011 - The context does not exist. 2465 * @throws { BusinessError } 16000012 - The application is controlled. 2466 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2467 * @throws { BusinessError } 16000050 - Internal error. 2468 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2469 * @throws { BusinessError } 16000055 - Installation-free timed out. 2470 * @throws { BusinessError } 16200001 - The caller has been released. 2471 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2472 * @systemapi 2473 * @stagemodelonly 2474 * @since 10 2475 */ 2476 /** 2477 * Starts an ability and returns the execution result when the ability is destroyed with account. 2478 * 2479 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2480 * @param { Want } want - Indicates the want info to start. 2481 * @param { number } accountId - Indicates the account to start. 2482 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2483 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2484 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2485 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2486 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2487 * @throws { BusinessError } 16000002 - Incorrect ability type. 2488 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2489 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2490 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2491 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2492 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2493 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2494 * @throws { BusinessError } 16000011 - The context does not exist. 2495 * @throws { BusinessError } 16000012 - The application is controlled. 2496 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2497 * @throws { BusinessError } 16000019 - No matching ability is found. 2498 * @throws { BusinessError } 16000050 - Internal error. 2499 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2500 * @throws { BusinessError } 16000055 - Installation-free timed out. 2501 * @throws { BusinessError } 16200001 - The caller has been released. 2502 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2503 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2504 * @systemapi 2505 * @stagemodelonly 2506 * @since 12 2507 */ 2508 /** 2509 * Starts an ability and returns the execution result when the ability is destroyed with account. 2510 * 2511 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2512 * @param { Want } want - Indicates the want info to start. 2513 * @param { number } accountId - Indicates the account to start. 2514 * @param { AsyncCallback<AbilityResult> } callback - The callback is used to return the result of startAbility. 2515 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2516 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2517 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2518 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2519 * @throws { BusinessError } 16000002 - Incorrect ability type. 2520 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2521 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2522 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2523 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2524 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2525 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2526 * @throws { BusinessError } 16000011 - The context does not exist. 2527 * @throws { BusinessError } 16000012 - The application is controlled. 2528 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2529 * @throws { BusinessError } 16000019 - No matching ability is found. 2530 * @throws { BusinessError } 16000050 - Internal error. 2531 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2532 * @throws { BusinessError } 16000055 - Installation-free timed out. 2533 * @throws { BusinessError } 16000071 - App clone is not supported. 2534 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2535 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2536 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2537 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2538 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2539 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2540 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2541 * @throws { BusinessError } 16200001 - The caller has been released. 2542 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2543 * @systemapi 2544 * @stagemodelonly 2545 * @since 14 2546 */ 2547 startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback<AbilityResult>): void; 2548 2549 /** 2550 * Starts an ability and returns the execution result when the ability is destroyed with account. 2551 * 2552 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2553 * @param { Want } want - Indicates the want info to start. 2554 * @param { number } accountId - Indicates the account to start. 2555 * @param { StartOptions } options - Indicates the start options. 2556 * @param { AsyncCallback<void> } callback - The callback is used to return the result of startAbility. 2557 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2558 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2559 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2560 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2561 * @throws { BusinessError } 16000002 - Incorrect ability type. 2562 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2563 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2564 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2565 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2566 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2567 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2568 * @throws { BusinessError } 16000011 - The context does not exist. 2569 * @throws { BusinessError } 16000050 - Internal error. 2570 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2571 * @throws { BusinessError } 16000055 - Installation-free timed out. 2572 * @throws { BusinessError } 16200001 - The caller has been released. 2573 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2574 * @systemapi 2575 * @stagemodelonly 2576 * @since 9 2577 */ 2578 /** 2579 * Starts an ability and returns the execution result when the ability is destroyed with account. 2580 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2581 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2582 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2583 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2584 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2585 * 2586 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2587 * @param { Want } want - Indicates the want info to start. 2588 * @param { number } accountId - Indicates the account to start. 2589 * @param { StartOptions } options - Indicates the start options. 2590 * @param { AsyncCallback<void> } callback - The callback is used to return the result of startAbility. 2591 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2592 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2593 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2594 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2595 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2596 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2597 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2598 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2599 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2600 * @throws { BusinessError } 16000011 - The context does not exist. 2601 * @throws { BusinessError } 16000012 - The application is controlled. 2602 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2603 * @throws { BusinessError } 16000050 - Internal error. 2604 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2605 * @throws { BusinessError } 16000055 - Installation-free timed out. 2606 * @throws { BusinessError } 16200001 - The caller has been released. 2607 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2608 * @systemapi 2609 * @stagemodelonly 2610 * @since 10 2611 */ 2612 /** 2613 * Starts an ability and returns the execution result when the ability is destroyed with account. 2614 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2615 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2616 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2617 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2618 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2619 * 2620 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2621 * @param { Want } want - Indicates the want info to start. 2622 * @param { number } accountId - Indicates the account to start. 2623 * @param { StartOptions } options - Indicates the start options. 2624 * @param { AsyncCallback<void> } callback - The callback is used to return the result of startAbility. 2625 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2626 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2627 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2628 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2629 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2630 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2631 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2632 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2633 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2634 * @throws { BusinessError } 16000011 - The context does not exist. 2635 * @throws { BusinessError } 16000012 - The application is controlled. 2636 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2637 * @throws { BusinessError } 16000019 - No matching ability is found. 2638 * @throws { BusinessError } 16000050 - Internal error. 2639 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2640 * @throws { BusinessError } 16000055 - Installation-free timed out. 2641 * @throws { BusinessError } 16200001 - The caller has been released. 2642 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2643 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2644 * @systemapi 2645 * @stagemodelonly 2646 * @since 12 2647 */ 2648 /** 2649 * Starts an ability and returns the execution result when the ability is destroyed with account. 2650 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2651 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2652 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2653 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2654 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2655 * 2656 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2657 * @param { Want } want - Indicates the want info to start. 2658 * @param { number } accountId - Indicates the account to start. 2659 * @param { StartOptions } options - Indicates the start options. 2660 * @param { AsyncCallback<void> } callback - The callback is used to return the result of startAbility. 2661 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2662 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2663 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2664 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2665 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2666 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2667 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2668 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2669 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2670 * @throws { BusinessError } 16000011 - The context does not exist. 2671 * @throws { BusinessError } 16000012 - The application is controlled. 2672 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2673 * @throws { BusinessError } 16000019 - No matching ability is found. 2674 * @throws { BusinessError } 16000050 - Internal error. 2675 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2676 * @throws { BusinessError } 16000055 - Installation-free timed out. 2677 * @throws { BusinessError } 16000071 - App clone is not supported. 2678 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2679 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2680 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2681 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2682 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2683 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2684 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2685 * @throws { BusinessError } 16200001 - The caller has been released. 2686 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2687 * @systemapi 2688 * @stagemodelonly 2689 * @since 14 2690 */ 2691 startAbilityForResultWithAccount( 2692 want: Want, 2693 accountId: number, 2694 options: StartOptions, 2695 callback: AsyncCallback<void> 2696 ): void; 2697 2698 /** 2699 * Starts an ability and returns the execution result when the ability is destroyed with account. 2700 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2701 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2702 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2703 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2704 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2705 * 2706 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2707 * @param { Want } want - Indicates the want info to start. 2708 * @param { number } accountId - Indicates the account to start. 2709 * @param { StartOptions } [options] - Indicates the start options. 2710 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2711 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2712 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2713 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2714 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2715 * @throws { BusinessError } 16000002 - Incorrect ability type. 2716 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2717 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2718 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2719 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2720 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2721 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2722 * @throws { BusinessError } 16000011 - The context does not exist. 2723 * @throws { BusinessError } 16000050 - Internal error. 2724 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2725 * @throws { BusinessError } 16000055 - Installation-free timed out. 2726 * @throws { BusinessError } 16200001 - The caller has been released. 2727 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2728 * @systemapi 2729 * @stagemodelonly 2730 * @since 9 2731 */ 2732 /** 2733 * Starts an ability and returns the execution result when the ability is destroyed with account. 2734 * 2735 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2736 * @param { Want } want - Indicates the want info to start. 2737 * @param { number } accountId - Indicates the account to start. 2738 * @param { StartOptions } [options] - Indicates the start options. 2739 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2740 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2741 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2742 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2743 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2744 * @throws { BusinessError } 16000002 - Incorrect ability type. 2745 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2746 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2747 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2748 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2749 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2750 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2751 * @throws { BusinessError } 16000011 - The context does not exist. 2752 * @throws { BusinessError } 16000012 - The application is controlled. 2753 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2754 * @throws { BusinessError } 16000050 - Internal error. 2755 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2756 * @throws { BusinessError } 16000055 - Installation-free timed out. 2757 * @throws { BusinessError } 16200001 - The caller has been released. 2758 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2759 * @systemapi 2760 * @stagemodelonly 2761 * @since 10 2762 */ 2763 /** 2764 * Starts an ability and returns the execution result when the ability is destroyed with account. 2765 * 2766 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2767 * @param { Want } want - Indicates the want info to start. 2768 * @param { number } accountId - Indicates the account to start. 2769 * @param { StartOptions } [options] - Indicates the start options. 2770 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2771 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2772 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2773 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2774 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2775 * @throws { BusinessError } 16000002 - Incorrect ability type. 2776 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2777 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2778 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2779 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2780 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2781 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2782 * @throws { BusinessError } 16000011 - The context does not exist. 2783 * @throws { BusinessError } 16000012 - The application is controlled. 2784 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2785 * @throws { BusinessError } 16000019 - No matching ability is found. 2786 * @throws { BusinessError } 16000050 - Internal error. 2787 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2788 * @throws { BusinessError } 16000055 - Installation-free timed out. 2789 * @throws { BusinessError } 16200001 - The caller has been released. 2790 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2791 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2792 * @systemapi 2793 * @stagemodelonly 2794 * @since 12 2795 */ 2796 /** 2797 * Starts an ability and returns the execution result when the ability is destroyed with account. 2798 * 2799 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2800 * @param { Want } want - Indicates the want info to start. 2801 * @param { number } accountId - Indicates the account to start. 2802 * @param { StartOptions } [options] - Indicates the start options. 2803 * @returns { Promise<AbilityResult> } Returns the result of startAbility. 2804 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2805 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2806 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2807 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2808 * @throws { BusinessError } 16000002 - Incorrect ability type. 2809 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2810 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2811 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2812 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2813 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2814 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2815 * @throws { BusinessError } 16000011 - The context does not exist. 2816 * @throws { BusinessError } 16000012 - The application is controlled. 2817 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2818 * @throws { BusinessError } 16000019 - No matching ability is found. 2819 * @throws { BusinessError } 16000050 - Internal error. 2820 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2821 * @throws { BusinessError } 16000055 - Installation-free timed out. 2822 * @throws { BusinessError } 16000071 - App clone is not supported. 2823 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2824 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2825 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2826 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2827 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2828 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2829 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2830 * @throws { BusinessError } 16200001 - The caller has been released. 2831 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2832 * @systemapi 2833 * @stagemodelonly 2834 * @since 14 2835 */ 2836 startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<AbilityResult>; 2837 2838 /** 2839 * Starts a new service extension ability. 2840 * 2841 * @param { Want } want - Indicates the want info to start. 2842 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbility. 2843 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2844 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2845 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2846 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2847 * @throws { BusinessError } 16000002 - Incorrect ability type. 2848 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2849 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2850 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2851 * @throws { BusinessError } 16000011 - The context does not exist. 2852 * @throws { BusinessError } 16000050 - Internal error. 2853 * @throws { BusinessError } 16200001 - The caller has been released. 2854 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2855 * @systemapi 2856 * @stagemodelonly 2857 * @since 9 2858 */ 2859 /** 2860 * Starts a new service extension ability. 2861 * If the target service extension ability is visible, you can start the target service extension ability; 2862 * If the target service extension ability is invisible, 2863 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 2864 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2865 * 2866 * @param { Want } want - Indicates the want info to start. 2867 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbility. 2868 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2869 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2870 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2871 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2872 * @throws { BusinessError } 16000002 - Incorrect ability type. 2873 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2874 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2875 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2876 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2877 * @throws { BusinessError } 16000011 - The context does not exist. 2878 * @throws { BusinessError } 16000012 - The application is controlled. 2879 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2880 * @throws { BusinessError } 16000050 - Internal error. 2881 * @throws { BusinessError } 16200001 - The caller has been released. 2882 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2883 * @systemapi 2884 * @stagemodelonly 2885 * @since 10 2886 */ 2887 /** 2888 * Starts a new service extension ability. 2889 * If the target service extension ability is visible, you can start the target service extension ability; 2890 * If the target service extension ability is invisible, 2891 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 2892 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2893 * 2894 * @param { Want } want - Indicates the want info to start. 2895 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbility. 2896 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2897 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2898 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2899 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2900 * @throws { BusinessError } 16000002 - Incorrect ability type. 2901 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2902 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2903 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2904 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2905 * @throws { BusinessError } 16000011 - The context does not exist. 2906 * @throws { BusinessError } 16000012 - The application is controlled. 2907 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2908 * @throws { BusinessError } 16000019 - No matching ability is found. 2909 * @throws { BusinessError } 16000050 - Internal error. 2910 * @throws { BusinessError } 16200001 - The caller has been released. 2911 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2912 * @systemapi 2913 * @stagemodelonly 2914 * @since arkts {'1.1':'12', '1.2':'20'} 2915 * @arkts 1.1&1.2 2916 */ 2917 startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void; 2918 2919 /** 2920 * Starts a new service extension ability. 2921 * 2922 * @param { Want } want - Indicates the want info to start. 2923 * @returns { Promise<void> } The promise returned by the function. 2924 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2925 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2926 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2927 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2928 * @throws { BusinessError } 16000002 - Incorrect ability type. 2929 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2930 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2931 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2932 * @throws { BusinessError } 16000011 - The context does not exist. 2933 * @throws { BusinessError } 16000050 - Internal error. 2934 * @throws { BusinessError } 16200001 - The caller has been released. 2935 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2936 * @systemapi 2937 * @stagemodelonly 2938 * @since 9 2939 */ 2940 /** 2941 * Starts a new service extension ability. 2942 * If the target service extension ability is visible, you can start the target service extension ability; 2943 * If the target service extension ability is invisible, 2944 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 2945 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2946 * 2947 * @param { Want } want - Indicates the want info to start. 2948 * @returns { Promise<void> } The promise returned by the function. 2949 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2950 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2951 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2952 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2953 * @throws { BusinessError } 16000002 - Incorrect ability type. 2954 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2955 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2956 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2957 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2958 * @throws { BusinessError } 16000011 - The context does not exist. 2959 * @throws { BusinessError } 16000012 - The application is controlled. 2960 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2961 * @throws { BusinessError } 16000050 - Internal error. 2962 * @throws { BusinessError } 16200001 - The caller has been released. 2963 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2964 * @systemapi 2965 * @stagemodelonly 2966 * @since 10 2967 */ 2968 /** 2969 * Starts a new service extension ability. 2970 * If the target service extension ability is visible, you can start the target service extension ability; 2971 * If the target service extension ability is invisible, 2972 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 2973 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2974 * 2975 * @param { Want } want - Indicates the want info to start. 2976 * @returns { Promise<void> } The promise returned by the function. 2977 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2978 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2979 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2980 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2981 * @throws { BusinessError } 16000002 - Incorrect ability type. 2982 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2983 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2984 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2985 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2986 * @throws { BusinessError } 16000011 - The context does not exist. 2987 * @throws { BusinessError } 16000012 - The application is controlled. 2988 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2989 * @throws { BusinessError } 16000019 - No matching ability is found. 2990 * @throws { BusinessError } 16000050 - Internal error. 2991 * @throws { BusinessError } 16200001 - The caller has been released. 2992 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2993 * @systemapi 2994 * @stagemodelonly 2995 * @since arkts {'1.1':'12', '1.2':'20'} 2996 * @arkts 1.1&1.2 2997 */ 2998 startServiceExtensionAbility(want: Want): Promise<void>; 2999 3000 /** 3001 * Starts a new service extension ability with account. 3002 * 3003 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3004 * @param { Want } want - Indicates the want info to start. 3005 * @param { number } accountId - Indicates the account to start. 3006 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbilityWithAccount. 3007 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3008 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3009 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3010 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3011 * @throws { BusinessError } 16000002 - Incorrect ability type. 3012 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3013 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3014 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3015 * @throws { BusinessError } 16000011 - The context does not exist. 3016 * @throws { BusinessError } 16000050 - Internal error. 3017 * @throws { BusinessError } 16200001 - The caller has been released. 3018 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3019 * @systemapi 3020 * @stagemodelonly 3021 * @since 9 3022 */ 3023 /** 3024 * Starts a new service extension ability with account. 3025 * If the target service extension ability is visible, you can start the target service extension ability; 3026 * If the target service extension ability is invisible, 3027 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 3028 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3029 * 3030 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3031 * @param { Want } want - Indicates the want info to start. 3032 * @param { number } accountId - Indicates the account to start. 3033 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbilityWithAccount. 3034 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3035 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3036 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3037 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3038 * @throws { BusinessError } 16000002 - Incorrect ability type. 3039 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3040 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3041 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3042 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3043 * @throws { BusinessError } 16000011 - The context does not exist. 3044 * @throws { BusinessError } 16000012 - The application is controlled. 3045 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 3046 * @throws { BusinessError } 16000050 - Internal error. 3047 * @throws { BusinessError } 16200001 - The caller has been released. 3048 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3049 * @systemapi 3050 * @stagemodelonly 3051 * @since 10 3052 */ 3053 /** 3054 * Starts a new service extension ability with account. 3055 * If the target service extension ability is visible, you can start the target service extension ability; 3056 * If the target service extension ability is invisible, 3057 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 3058 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3059 * 3060 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3061 * @param { Want } want - Indicates the want info to start. 3062 * @param { number } accountId - Indicates the account to start. 3063 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbilityWithAccount. 3064 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3065 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3066 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3067 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3068 * @throws { BusinessError } 16000002 - Incorrect ability type. 3069 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3070 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3071 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3072 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3073 * @throws { BusinessError } 16000011 - The context does not exist. 3074 * @throws { BusinessError } 16000012 - The application is controlled. 3075 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 3076 * @throws { BusinessError } 16000019 - No matching ability is found. 3077 * @throws { BusinessError } 16000050 - Internal error. 3078 * @throws { BusinessError } 16200001 - The caller has been released. 3079 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3080 * @systemapi 3081 * @stagemodelonly 3082 * @since 12 3083 */ 3084 startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void; 3085 3086 /** 3087 * Starts a new service extension ability with account. 3088 * 3089 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3090 * @param { Want } want - Indicates the want info to start. 3091 * @param { number } accountId - Indicates the account to start. 3092 * @returns { Promise<void> } The promise returned by the function. 3093 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3094 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3095 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3096 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3097 * @throws { BusinessError } 16000002 - Incorrect ability type. 3098 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3099 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3100 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3101 * @throws { BusinessError } 16000011 - The context does not exist. 3102 * @throws { BusinessError } 16000050 - Internal error. 3103 * @throws { BusinessError } 16200001 - The caller has been released. 3104 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3105 * @systemapi 3106 * @stagemodelonly 3107 * @since 9 3108 */ 3109 /** 3110 * Starts a new service extension ability with account. 3111 * If the target service extension ability is visible, you can start the target service extension ability; 3112 * If the target service extension ability is invisible, 3113 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 3114 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3115 * 3116 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3117 * @param { Want } want - Indicates the want info to start. 3118 * @param { number } accountId - Indicates the account to start. 3119 * @returns { Promise<void> } The promise returned by the function. 3120 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3121 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3122 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3123 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3124 * @throws { BusinessError } 16000002 - Incorrect ability type. 3125 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3126 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3127 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3128 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3129 * @throws { BusinessError } 16000011 - The context does not exist. 3130 * @throws { BusinessError } 16000012 - The application is controlled. 3131 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 3132 * @throws { BusinessError } 16000050 - Internal error. 3133 * @throws { BusinessError } 16200001 - The caller has been released. 3134 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3135 * @systemapi 3136 * @stagemodelonly 3137 * @since 10 3138 */ 3139 /** 3140 * Starts a new service extension ability with account. 3141 * If the target service extension ability is visible, you can start the target service extension ability; 3142 * If the target service extension ability is invisible, 3143 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 3144 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3145 * 3146 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3147 * @param { Want } want - Indicates the want info to start. 3148 * @param { number } accountId - Indicates the account to start. 3149 * @returns { Promise<void> } The promise returned by the function. 3150 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3151 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3152 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3153 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3154 * @throws { BusinessError } 16000002 - Incorrect ability type. 3155 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3156 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3157 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3158 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3159 * @throws { BusinessError } 16000011 - The context does not exist. 3160 * @throws { BusinessError } 16000012 - The application is controlled. 3161 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 3162 * @throws { BusinessError } 16000019 - No matching ability is found. 3163 * @throws { BusinessError } 16000050 - Internal error. 3164 * @throws { BusinessError } 16200001 - The caller has been released. 3165 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3166 * @systemapi 3167 * @stagemodelonly 3168 * @since 12 3169 */ 3170 startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void>; 3171 3172 /** 3173 * Stops other service extension ability. 3174 * 3175 * @param { Want } want - Indicates the want info to start. 3176 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbility. 3177 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3178 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3179 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3180 * @throws { BusinessError } 16000002 - Incorrect ability type. 3181 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3182 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3183 * @throws { BusinessError } 16000011 - The context does not exist. 3184 * @throws { BusinessError } 16000050 - Internal error. 3185 * @throws { BusinessError } 16200001 - The caller has been released. 3186 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3187 * @systemapi 3188 * @stagemodelonly 3189 * @since 9 3190 */ 3191 /** 3192 * Stops other service extension ability. 3193 * If the target service extension ability is visible, you can stop the target service extension ability; 3194 * If the target service extension ability is invisible, 3195 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 3196 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3197 * 3198 * @param { Want } want - Indicates the want info to start. 3199 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbility. 3200 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3201 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3202 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3203 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3204 * @throws { BusinessError } 16000002 - Incorrect ability type. 3205 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3206 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3207 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3208 * @throws { BusinessError } 16000011 - The context does not exist. 3209 * @throws { BusinessError } 16000012 - The application is controlled. 3210 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 3211 * @throws { BusinessError } 16000050 - Internal error. 3212 * @throws { BusinessError } 16200001 - The caller has been released. 3213 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3214 * @systemapi 3215 * @stagemodelonly 3216 * @since 10 3217 */ 3218 stopServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void; 3219 3220 /** 3221 * Stops other service extension ability. 3222 * 3223 * @param { Want } want - Indicates the want info to start. 3224 * @returns { Promise<void> } The promise returned by the function. 3225 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3226 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3227 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3228 * @throws { BusinessError } 16000002 - Incorrect ability type. 3229 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3230 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3231 * @throws { BusinessError } 16000011 - The context does not exist. 3232 * @throws { BusinessError } 16000050 - Internal error. 3233 * @throws { BusinessError } 16200001 - The caller has been released. 3234 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3235 * @systemapi 3236 * @stagemodelonly 3237 * @since 9 3238 */ 3239 /** 3240 * Stops other service extension ability. 3241 * If the target service extension ability is visible, you can stop the target service extension ability; 3242 * If the target service extension ability is invisible, 3243 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 3244 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3245 * 3246 * @param { Want } want - Indicates the want info to start. 3247 * @returns { Promise<void> } The promise returned by the function. 3248 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3249 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3250 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3251 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3252 * @throws { BusinessError } 16000002 - Incorrect ability type. 3253 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3254 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3255 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3256 * @throws { BusinessError } 16000011 - The context does not exist. 3257 * @throws { BusinessError } 16000050 - Internal error. 3258 * @throws { BusinessError } 16200001 - The caller has been released. 3259 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3260 * @systemapi 3261 * @stagemodelonly 3262 * @since 10 3263 */ 3264 stopServiceExtensionAbility(want: Want): Promise<void>; 3265 3266 /** 3267 * Stops other service extension ability with account. 3268 * 3269 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3270 * @param { Want } want - Indicates the want info to start. 3271 * @param { number } accountId - Indicates the accountId to start. 3272 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbilityWithAccount. 3273 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3274 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3275 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3276 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3277 * @throws { BusinessError } 16000002 - Incorrect ability type. 3278 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3279 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3280 * @throws { BusinessError } 16000011 - The context does not exist. 3281 * @throws { BusinessError } 16000050 - Internal error. 3282 * @throws { BusinessError } 16200001 - The caller has been released. 3283 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3284 * @systemapi 3285 * @stagemodelonly 3286 * @since 9 3287 */ 3288 /** 3289 * Stops other service extension ability with account. 3290 * If the target service extension ability is visible, you can stop the target service extension ability; 3291 * If the target service extension ability is invisible, 3292 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 3293 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3294 * 3295 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3296 * @param { Want } want - Indicates the want info to start. 3297 * @param { number } accountId - Indicates the accountId to start. 3298 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbilityWithAccount. 3299 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3300 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3301 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3302 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3303 * @throws { BusinessError } 16000002 - Incorrect ability type. 3304 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3305 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3306 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3307 * @throws { BusinessError } 16000011 - The context does not exist. 3308 * @throws { BusinessError } 16000050 - Internal error. 3309 * @throws { BusinessError } 16200001 - The caller has been released. 3310 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3311 * @systemapi 3312 * @stagemodelonly 3313 * @since 10 3314 */ 3315 stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void; 3316 3317 /** 3318 * Stops other service extension ability with account. 3319 * 3320 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3321 * @param { Want } want - Indicates the want info to start. 3322 * @param { number } accountId - Indicates the accountId to start. 3323 * @returns { Promise<void> } The promise returned by the function. 3324 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3325 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3326 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3327 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3328 * @throws { BusinessError } 16000002 - Incorrect ability type. 3329 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3330 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3331 * @throws { BusinessError } 16000011 - The context does not exist. 3332 * @throws { BusinessError } 16000050 - Internal error. 3333 * @throws { BusinessError } 16200001 - The caller has been released. 3334 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3335 * @systemapi 3336 * @stagemodelonly 3337 * @since 9 3338 */ 3339 /** 3340 * Stops other service extension ability with account. 3341 * If the target service extension ability is visible, you can stop the target service extension ability; 3342 * If the target service extension ability is invisible, 3343 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 3344 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3345 * 3346 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3347 * @param { Want } want - Indicates the want info to start. 3348 * @param { number } accountId - Indicates the accountId to start. 3349 * @returns { Promise<void> } The promise returned by the function. 3350 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3351 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3352 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3353 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3354 * @throws { BusinessError } 16000002 - Incorrect ability type. 3355 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3356 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3357 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3358 * @throws { BusinessError } 16000011 - The context does not exist. 3359 * @throws { BusinessError } 16000050 - Internal error. 3360 * @throws { BusinessError } 16200001 - The caller has been released. 3361 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3362 * @systemapi 3363 * @stagemodelonly 3364 * @since 10 3365 */ 3366 stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void>; 3367 3368 /** 3369 * Destroys this Page ability. 3370 * 3371 * @param { AsyncCallback<void> } callback - The callback of terminateSelf. 3372 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3373 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3374 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3375 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3376 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3377 * @throws { BusinessError } 16000011 - The context does not exist. 3378 * @throws { BusinessError } 16000050 - Internal error. 3379 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3380 * @stagemodelonly 3381 * @since 9 3382 */ 3383 /** 3384 * Destroys this Page ability. 3385 * 3386 * @param { AsyncCallback<void> } callback - The callback of terminateSelf. 3387 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3388 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3389 * @throws { BusinessError } 16000011 - The context does not exist. 3390 * @throws { BusinessError } 16000050 - Internal error. 3391 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3392 * @stagemodelonly 3393 * @crossplatform 3394 * @since 10 3395 */ 3396 /** 3397 * Destroys this Page ability. 3398 * 3399 * @param { AsyncCallback<void> } callback - The callback of terminateSelf. 3400 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3401 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3402 * @throws { BusinessError } 16000011 - The context does not exist. 3403 * @throws { BusinessError } 16000050 - Internal error. 3404 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3405 * @stagemodelonly 3406 * @crossplatform 3407 * @atomicservice 3408 * @since arkts {'1.1':'11', '1.2':'20'} 3409 * @arkts 1.1&1.2 3410 */ 3411 terminateSelf(callback: AsyncCallback<void>): void; 3412 3413 /** 3414 * Destroys this Page ability. 3415 * 3416 * @returns { Promise<void> } The promise returned by the function. 3417 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3418 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3419 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3420 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3421 * @throws { BusinessError } 16000011 - The context does not exist. 3422 * @throws { BusinessError } 16000050 - Internal error. 3423 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3424 * @stagemodelonly 3425 * @since 9 3426 */ 3427 /** 3428 * Destroys this Page ability. 3429 * 3430 * @returns { Promise<void> } The promise returned by the function. 3431 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3432 * @throws { BusinessError } 16000011 - The context does not exist. 3433 * @throws { BusinessError } 16000050 - Internal error. 3434 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3435 * @stagemodelonly 3436 * @crossplatform 3437 * @since 10 3438 */ 3439 /** 3440 * Destroys this Page ability. 3441 * 3442 * @returns { Promise<void> } The promise returned by the function. 3443 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3444 * @throws { BusinessError } 16000011 - The context does not exist. 3445 * @throws { BusinessError } 16000050 - Internal error. 3446 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3447 * @stagemodelonly 3448 * @crossplatform 3449 * @atomicservice 3450 * @since arkts {'1.1':'11', '1.2':'20'} 3451 * @arkts 1.1&1.2 3452 */ 3453 terminateSelf(): Promise<void>; 3454 3455 /** 3456 * Destroys the Page ability while returning the specified result code and data to the caller. 3457 * 3458 * @param { AbilityResult } parameter - Indicates the result to return. 3459 * @param { AsyncCallback<void> } callback - The callback of terminateSelfWithResult. 3460 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3461 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3462 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3463 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3464 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3465 * @throws { BusinessError } 16000011 - The context does not exist. 3466 * @throws { BusinessError } 16000050 - Internal error. 3467 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3468 * @stagemodelonly 3469 * @since 9 3470 */ 3471 /** 3472 * Destroys the Page ability while returning the specified result code and data to the caller. 3473 * 3474 * @param { AbilityResult } parameter - Indicates the result to return. 3475 * @param { AsyncCallback<void> } callback - The callback of terminateSelfWithResult. 3476 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3477 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3478 * @throws { BusinessError } 16000011 - The context does not exist. 3479 * @throws { BusinessError } 16000050 - Internal error. 3480 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3481 * @stagemodelonly 3482 * @since 10 3483 */ 3484 /** 3485 * Destroys the Page ability while returning the specified result code and data to the caller. 3486 * 3487 * @param { AbilityResult } parameter - Indicates the result to return. 3488 * @param { AsyncCallback<void> } callback - The callback of terminateSelfWithResult. 3489 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3490 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3491 * @throws { BusinessError } 16000011 - The context does not exist. 3492 * @throws { BusinessError } 16000050 - Internal error. 3493 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3494 * @stagemodelonly 3495 * @atomicservice 3496 * @since arkts {'1.1':'11', '1.2':'20'} 3497 * @arkts 1.1&1.2 3498 */ 3499 terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void; 3500 3501 /** 3502 * Destroys the Page ability while returning the specified result code and data to the caller. 3503 * 3504 * @param { AbilityResult } parameter - Indicates the result to return. 3505 * @returns { Promise<void> } The promise returned by the function. 3506 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3507 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3508 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3509 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3510 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3511 * @throws { BusinessError } 16000011 - The context does not exist. 3512 * @throws { BusinessError } 16000050 - Internal error. 3513 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3514 * @stagemodelonly 3515 * @since 9 3516 */ 3517 /** 3518 * Destroys the Page ability while returning the specified result code and data to the caller. 3519 * 3520 * @param { AbilityResult } parameter - Indicates the result to return. 3521 * @returns { Promise<void> } The promise returned by the function. 3522 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3523 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3524 * @throws { BusinessError } 16000011 - The context does not exist. 3525 * @throws { BusinessError } 16000050 - Internal error. 3526 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3527 * @stagemodelonly 3528 * @since 10 3529 */ 3530 /** 3531 * Destroys the Page ability while returning the specified result code and data to the caller. 3532 * 3533 * @param { AbilityResult } parameter - Indicates the result to return. 3534 * @returns { Promise<void> } The promise returned by the function. 3535 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3536 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3537 * @throws { BusinessError } 16000011 - The context does not exist. 3538 * @throws { BusinessError } 16000050 - Internal error. 3539 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3540 * @stagemodelonly 3541 * @atomicservice 3542 * @since arkts {'1.1':'11', '1.2':'20'} 3543 * @arkts 1.1&1.2 3544 */ 3545 terminateSelfWithResult(parameter: AbilityResult): Promise<void>; 3546 3547 /** 3548 * Return to caller application with specified result code and data while not destroying current ability. 3549 * If the current application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 3550 * 3551 * @param { AbilityResult } abilityResult - Indicates the result to return. 3552 * @param { string } requestCode - Indicates the request code of caller ability. 3553 * @returns { Promise<void> } The promise returned by the function. 3554 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3555 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3556 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3557 * @throws { BusinessError } 16000011 - The context does not exist. 3558 * @throws { BusinessError } 16000050 - Internal error. 3559 * @throws { BusinessError } 16000074 - The caller does not exist. 3560 * @throws { BusinessError } 16000075 - BackToCaller is not supported. 3561 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3562 * @stagemodelonly 3563 * @atomicservice 3564 * @since 12 3565 */ 3566 backToCallerAbilityWithResult(abilityResult: AbilityResult, requestCode: string): Promise<void>; 3567 3568 /** 3569 * Connects the current ability to an service extension ability. 3570 * 3571 * @param { Want } want - The element name of the service ability 3572 * @param { ConnectOptions } options - The remote object instance 3573 * @returns { number } Returns the number code of the ability connected 3574 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3575 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3576 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3577 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3578 * @throws { BusinessError } 16000011 - The context does not exist. 3579 * @throws { BusinessError } 16000050 - Internal error. 3580 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3581 * @stagemodelonly 3582 * @since 9 3583 */ 3584 /** 3585 * Connects the current ability to an service extension ability. 3586 * If the target service extension ability is visible, you can connect the target service extension ability; 3587 * If the target service extension ability is invisible, 3588 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible service extension ability. 3589 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3590 * 3591 * @param { Want } want - The element name of the service ability 3592 * @param { ConnectOptions } options - The remote object instance 3593 * @returns { number } Returns the number code of the ability connected 3594 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3595 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3596 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3597 * @throws { BusinessError } 16000002 - Incorrect ability type. 3598 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3599 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3600 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3601 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3602 * @throws { BusinessError } 16000011 - The context does not exist. 3603 * @throws { BusinessError } 16000050 - Internal error. 3604 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 3605 * @throws { BusinessError } 16000055 - Installation-free timed out. 3606 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3607 * @stagemodelonly 3608 * @since 10 3609 */ 3610 connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; 3611 3612 /** 3613 * Connects the current ability to an service extension ability with account. 3614 * 3615 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3616 * @param { Want } want - The element name of the service ability 3617 * @param { number } accountId - The account to connect 3618 * @param { ConnectOptions } options - The remote object instance 3619 * @returns { number } Returns the number code of the ability connected 3620 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3621 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3622 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3623 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3624 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3625 * @throws { BusinessError } 16000011 - The context does not exist. 3626 * @throws { BusinessError } 16000050 - Internal error. 3627 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3628 * @systemapi 3629 * @stagemodelonly 3630 * @since 9 3631 */ 3632 /** 3633 * Connects the current ability to an service extension ability with account. 3634 * If the target service extension ability is visible, you can connect the target service extension ability; 3635 * If the target service extension ability is invisible, 3636 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible service extension ability. 3637 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3638 * 3639 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 3640 * @param { Want } want - The element name of the service ability 3641 * @param { number } accountId - The account to connect 3642 * @param { ConnectOptions } options - The remote object instance 3643 * @returns { number } Returns the number code of the ability connected 3644 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3645 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3646 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3647 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3648 * @throws { BusinessError } 16000002 - Incorrect ability type. 3649 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3650 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3651 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3652 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3653 * @throws { BusinessError } 16000011 - The context does not exist. 3654 * @throws { BusinessError } 16000050 - Internal error. 3655 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 3656 * @throws { BusinessError } 16000055 - Installation-free timed out. 3657 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3658 * @systemapi 3659 * @stagemodelonly 3660 * @since 10 3661 */ 3662 connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; 3663 3664 /** 3665 * Disconnect an ability from a service extension, in contrast to {@link connectAbility}. 3666 * 3667 * @param { number } connection - The number code of the ability connected 3668 * @param { AsyncCallback<void> } callback - The callback of disconnectAbility. 3669 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3670 * @throws { BusinessError } 16000011 - The context does not exist. 3671 * @throws { BusinessError } 16000050 - Internal error. 3672 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3673 * @stagemodelonly 3674 * @since 9 3675 */ 3676 disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback<void>): void; 3677 3678 /** 3679 * Disconnect an ability from a service extension, in contrast to {@link connectAbility}. 3680 * 3681 * @param { number } connection - The number code of the ability connected 3682 * @returns { Promise<void> } The promise returned by the function. 3683 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3684 * @throws { BusinessError } 16000011 - The context does not exist. 3685 * @throws { BusinessError } 16000050 - Internal error. 3686 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3687 * @stagemodelonly 3688 * @since 9 3689 */ 3690 disconnectServiceExtensionAbility(connection: number): Promise<void>; 3691 3692 /** 3693 * Set mission label of current ability. 3694 * 3695 * @param { string } label - The label of ability that showed in recent missions. 3696 * @param { AsyncCallback<void> } callback - The callback of setMissionLabel. 3697 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3698 * @throws { BusinessError } 16000011 - The context does not exist. 3699 * @throws { BusinessError } 16000050 - Internal error. 3700 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3701 * @stagemodelonly 3702 * @since 9 3703 */ 3704 /** 3705 * Set mission label of current ability. 3706 * 3707 * @param { string } label - The label of ability that showed in recent missions. 3708 * @param { AsyncCallback<void> } callback - The callback of setMissionLabel. 3709 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3710 * @throws { BusinessError } 16000011 - The context does not exist. 3711 * @throws { BusinessError } 16000050 - Internal error. 3712 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3713 * @stagemodelonly 3714 * @atomicservice 3715 * @since 11 3716 */ 3717 setMissionLabel(label: string, callback: AsyncCallback<void>): void; 3718 3719 /** 3720 * Set mission label of current ability. 3721 * 3722 * @param { string } label - The label of ability that showed in recent missions. 3723 * @returns { Promise<void> } The promise returned by the function. 3724 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3725 * @throws { BusinessError } 16000011 - The context does not exist. 3726 * @throws { BusinessError } 16000050 - Internal error. 3727 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3728 * @stagemodelonly 3729 * @since 9 3730 */ 3731 /** 3732 * Set mission label of current ability. 3733 * 3734 * @param { string } label - The label of ability that showed in recent missions. 3735 * @returns { Promise<void> } The promise returned by the function. 3736 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3737 * @throws { BusinessError } 16000011 - The context does not exist. 3738 * @throws { BusinessError } 16000050 - Internal error. 3739 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3740 * @stagemodelonly 3741 * @atomicservice 3742 * @since 11 3743 */ 3744 setMissionLabel(label: string): Promise<void>; 3745 3746 /** 3747 * Set mission icon of current ability. 3748 * 3749 * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. 3750 * @param { AsyncCallback<void> } callback - The callback of setMissionIcon. 3751 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3752 * @throws { BusinessError } 16000011 - The context does not exist. 3753 * @throws { BusinessError } 16000050 - Internal error. 3754 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3755 * @systemapi 3756 * @stagemodelonly 3757 * @since 9 3758 */ 3759 /** 3760 * Set mission icon of current ability. 3761 * 3762 * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. 3763 * @param { AsyncCallback<void> } callback - The callback of setMissionIcon. 3764 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3765 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3766 * @throws { BusinessError } 16000011 - The context does not exist. 3767 * @throws { BusinessError } 16000050 - Internal error. 3768 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3769 * @systemapi 3770 * @stagemodelonly 3771 * @since 10 3772 */ 3773 setMissionIcon(icon: image.PixelMap, callback: AsyncCallback<void>): void; 3774 3775 /** 3776 * Set mission icon of current ability. 3777 * 3778 * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. 3779 * @returns { Promise<void> } The promise returned by the function. 3780 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3781 * @throws { BusinessError } 16000011 - The context does not exist. 3782 * @throws { BusinessError } 16000050 - Internal error. 3783 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3784 * @systemapi 3785 * @stagemodelonly 3786 * @since 9 3787 */ 3788 /** 3789 * Set mission icon of current ability. 3790 * 3791 * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. 3792 * @returns { Promise<void> } The promise returned by the function. 3793 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 3794 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3795 * @throws { BusinessError } 16000011 - The context does not exist. 3796 * @throws { BusinessError } 16000050 - Internal error. 3797 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3798 * @systemapi 3799 * @stagemodelonly 3800 * @since 10 3801 */ 3802 setMissionIcon(icon: image.PixelMap): Promise<void>; 3803 3804 /** 3805 * Set mission continue state of current ability. 3806 * 3807 * @param { AbilityConstant.ContinueState } state - The mission continue state of current ability. 3808 * @param { AsyncCallback<void> } callback - The callback of setMissionContinueState. 3809 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3810 * @throws { BusinessError } 16000011 - The context does not exist. 3811 * @throws { BusinessError } 16000050 - Internal error. 3812 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3813 * @stagemodelonly 3814 * @since 10 3815 */ 3816 /** 3817 * Set mission continue state of current ability. 3818 * 3819 * @param { AbilityConstant.ContinueState } state - The mission continue state of current ability. 3820 * @param { AsyncCallback<void> } callback - The callback of setMissionContinueState. 3821 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3822 * @throws { BusinessError } 16000011 - The context does not exist. 3823 * @throws { BusinessError } 16000050 - Internal error. 3824 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3825 * @stagemodelonly 3826 * @atomicservice 3827 * @since 11 3828 */ 3829 setMissionContinueState(state: AbilityConstant.ContinueState, callback: AsyncCallback<void>): void; 3830 3831 /** 3832 * Set mission continue state of current ability. 3833 * 3834 * @param { AbilityConstant.ContinueState } state - The mission continue state of current ability. 3835 * @returns { Promise<void> } The promise returned by the function. 3836 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3837 * @throws { BusinessError } 16000011 - The context does not exist. 3838 * @throws { BusinessError } 16000050 - Internal error. 3839 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3840 * @stagemodelonly 3841 * @since 10 3842 */ 3843 /** 3844 * Set mission continue state of current ability. 3845 * 3846 * @param { AbilityConstant.ContinueState } state - The mission continue state of current ability. 3847 * @returns { Promise<void> } The promise returned by the function. 3848 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3849 * @throws { BusinessError } 16000011 - The context does not exist. 3850 * @throws { BusinessError } 16000050 - Internal error. 3851 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3852 * @stagemodelonly 3853 * @atomicservice 3854 * @since 11 3855 */ 3856 setMissionContinueState(state: AbilityConstant.ContinueState): Promise<void>; 3857 3858 /** 3859 * Restore window stage data in ability continuation 3860 * 3861 * @param { LocalStorage } localStorage - the storage data used to restore window stage 3862 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3863 * @throws { BusinessError } 16000011 - The context does not exist. 3864 * @throws { BusinessError } 16000050 - Internal error. 3865 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3866 * @stagemodelonly 3867 * @since 9 3868 */ 3869 /** 3870 * Restore window stage data in ability continuation 3871 * 3872 * @param { LocalStorage } localStorage - the storage data used to restore window stage 3873 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 3874 * @throws { BusinessError } 16000011 - The context does not exist. 3875 * @throws { BusinessError } 16000050 - Internal error. 3876 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3877 * @stagemodelonly 3878 * @atomicservice 3879 * @since 11 3880 */ 3881 restoreWindowStage(localStorage: LocalStorage): void; 3882 3883 /** 3884 * Check to see ability is in terminating state. 3885 * 3886 * @returns { boolean } Returns true when ability is in terminating state, else returns false. 3887 * @throws { BusinessError } 16000011 - The context does not exist. 3888 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3889 * @stagemodelonly 3890 * @since 9 3891 */ 3892 /** 3893 * Check to see ability is in terminating state. 3894 * 3895 * @returns { boolean } Returns true when ability is in terminating state, else returns false. 3896 * @throws { BusinessError } 16000011 - The context does not exist. 3897 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3898 * @stagemodelonly 3899 * @atomicservice 3900 * @since arkts {'1.1':'11', '1.2':'20'} 3901 * @arkts 1.1&1.2 3902 */ 3903 isTerminating(): boolean; 3904 3905 /** 3906 * Service extension uses this method to start a specific ability, 3907 * if ability is multi instance, will start a recent instance. 3908 * 3909 * @param { Want } want - Indicates the ability to start. 3910 * @param { AsyncCallback<void> } callback - The callback of startAbility. 3911 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3912 * 2. Incorrect parameter types; 3. Parameter verification failed. 3913 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3914 * @throws { BusinessError } 16000002 - Incorrect ability type. 3915 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3916 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3917 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3918 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3919 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3920 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 3921 * @throws { BusinessError } 16000011 - The context does not exist. 3922 * @throws { BusinessError } 16000050 - Internal error. 3923 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 3924 * @throws { BusinessError } 16000055 - Installation-free timed out. 3925 * @throws { BusinessError } 16200001 - The caller has been released. 3926 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3927 * @systemapi 3928 * @stagemodelonly 3929 * @since 9 3930 */ 3931 /** 3932 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 3933 * you can use this method to start ability; If the caller application is in the background, 3934 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 3935 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 3936 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 3937 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3938 * 3939 * @param { Want } want - Indicates the ability to start. 3940 * @param { AsyncCallback<void> } callback - The callback of startAbility. 3941 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3942 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3943 * 2. Incorrect parameter types; 3. Parameter verification failed. 3944 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3945 * @throws { BusinessError } 16000002 - Incorrect ability type. 3946 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3947 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3948 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3949 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3950 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3951 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 3952 * @throws { BusinessError } 16000011 - The context does not exist. 3953 * @throws { BusinessError } 16000012 - The application is controlled. 3954 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 3955 * @throws { BusinessError } 16000050 - Internal error. 3956 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 3957 * @throws { BusinessError } 16000055 - Installation-free timed out. 3958 * @throws { BusinessError } 16200001 - The caller has been released. 3959 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3960 * @systemapi 3961 * @stagemodelonly 3962 * @since 10 3963 */ 3964 /** 3965 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 3966 * you can use this method to start ability; If the caller application is in the background, 3967 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 3968 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 3969 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 3970 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 3971 * 3972 * @param { Want } want - Indicates the ability to start. 3973 * @param { AsyncCallback<void> } callback - The callback of startAbility. 3974 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 3975 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3976 * 2. Incorrect parameter types; 3. Parameter verification failed. 3977 * @throws { BusinessError } 16000001 - The specified ability does not exist. 3978 * @throws { BusinessError } 16000002 - Incorrect ability type. 3979 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 3980 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 3981 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 3982 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 3983 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 3984 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 3985 * @throws { BusinessError } 16000011 - The context does not exist. 3986 * @throws { BusinessError } 16000012 - The application is controlled. 3987 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 3988 * @throws { BusinessError } 16000050 - Internal error. 3989 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 3990 * @throws { BusinessError } 16000055 - Installation-free timed out. 3991 * @throws { BusinessError } 16200001 - The caller has been released. 3992 * @throws { BusinessError } 16000073 - The app clone index is invalid. 3993 * @syscap SystemCapability.Ability.AbilityRuntime.Core 3994 * @systemapi 3995 * @stagemodelonly 3996 * @since 12 3997 */ 3998 /** 3999 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 4000 * you can use this method to start ability; If the caller application is in the background, 4001 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4002 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4003 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4004 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 4005 * 4006 * @param { Want } want - Indicates the ability to start. 4007 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4008 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4009 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 4010 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4011 * 2. Incorrect parameter types; 3. Parameter verification failed. 4012 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4013 * @throws { BusinessError } 16000002 - Incorrect ability type. 4014 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4015 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4016 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4017 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4018 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4019 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4020 * @throws { BusinessError } 16000011 - The context does not exist. 4021 * @throws { BusinessError } 16000012 - The application is controlled. 4022 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4023 * @throws { BusinessError } 16000050 - Internal error. 4024 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4025 * @throws { BusinessError } 16000055 - Installation-free timed out. 4026 * @throws { BusinessError } 16000071 - App clone is not supported. 4027 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 4028 * @throws { BusinessError } 16000073 - The app clone index is invalid. 4029 * @throws { BusinessError } 16000076 - The app instance key is invalid. 4030 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 4031 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 4032 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 4033 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 4034 * @throws { BusinessError } 16200001 - The caller has been released. 4035 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4036 * @systemapi 4037 * @stagemodelonly 4038 * @since 14 4039 */ 4040 startRecentAbility(want: Want, callback: AsyncCallback<void>): void; 4041 4042 /** 4043 * Service extension uses this method to start a specific ability, 4044 * if ability is multi instance, will start a recent instance. 4045 * 4046 * @param { Want } want - Indicates the ability to start. 4047 * @param { StartOptions } options - Indicates the start options. 4048 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4049 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4050 * 2. Incorrect parameter types; 3. Parameter verification failed. 4051 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4052 * @throws { BusinessError } 16000002 - Incorrect ability type. 4053 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4054 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4055 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4056 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4057 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4058 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4059 * @throws { BusinessError } 16000011 - The context does not exist. 4060 * @throws { BusinessError } 16000050 - Internal error. 4061 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4062 * @throws { BusinessError } 16000055 - Installation-free timed out. 4063 * @throws { BusinessError } 16200001 - The caller has been released. 4064 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4065 * @systemapi 4066 * @stagemodelonly 4067 * @since 9 4068 */ 4069 /** 4070 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 4071 * you can use this method to start ability; If the caller application is in the background, 4072 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4073 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4074 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4075 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 4076 * 4077 * @param { Want } want - Indicates the ability to start. 4078 * @param { StartOptions } options - Indicates the start options. 4079 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4080 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4081 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4082 * 2. Incorrect parameter types; 3. Parameter verification failed. 4083 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4084 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4085 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4086 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4087 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4088 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4089 * @throws { BusinessError } 16000011 - The context does not exist. 4090 * @throws { BusinessError } 16000012 - The application is controlled. 4091 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4092 * @throws { BusinessError } 16000050 - Internal error. 4093 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4094 * @throws { BusinessError } 16000055 - Installation-free timed out. 4095 * @throws { BusinessError } 16200001 - The caller has been released. 4096 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4097 * @systemapi 4098 * @stagemodelonly 4099 * @since 10 4100 */ 4101 /** 4102 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 4103 * you can use this method to start ability; If the caller application is in the background, 4104 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4105 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4106 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4107 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 4108 * 4109 * @param { Want } want - Indicates the ability to start. 4110 * @param { StartOptions } options - Indicates the start options. 4111 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4112 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4113 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4114 * 2. Incorrect parameter types; 3. Parameter verification failed. 4115 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4116 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4117 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4118 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4119 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4120 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4121 * @throws { BusinessError } 16000011 - The context does not exist. 4122 * @throws { BusinessError } 16000012 - The application is controlled. 4123 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4124 * @throws { BusinessError } 16000050 - Internal error. 4125 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4126 * @throws { BusinessError } 16000055 - Installation-free timed out. 4127 * @throws { BusinessError } 16200001 - The caller has been released. 4128 * @throws { BusinessError } 16000073 - The app clone index is invalid. 4129 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4130 * @systemapi 4131 * @stagemodelonly 4132 * @since 12 4133 */ 4134 /** 4135 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 4136 * you can use this method to start ability; If the caller application is in the background, 4137 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4138 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4139 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4140 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 4141 * 4142 * @param { Want } want - Indicates the ability to start. 4143 * @param { StartOptions } options - Indicates the start options. 4144 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4145 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4146 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 4147 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4148 * 2. Incorrect parameter types; 3. Parameter verification failed. 4149 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4150 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4151 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4152 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4153 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4154 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4155 * @throws { BusinessError } 16000011 - The context does not exist. 4156 * @throws { BusinessError } 16000012 - The application is controlled. 4157 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4158 * @throws { BusinessError } 16000050 - Internal error. 4159 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4160 * @throws { BusinessError } 16000055 - Installation-free timed out. 4161 * @throws { BusinessError } 16000071 - App clone is not supported. 4162 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 4163 * @throws { BusinessError } 16000073 - The app clone index is invalid. 4164 * @throws { BusinessError } 16000076 - The app instance key is invalid. 4165 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 4166 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 4167 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 4168 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 4169 * @throws { BusinessError } 16200001 - The caller has been released. 4170 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4171 * @systemapi 4172 * @stagemodelonly 4173 * @since 14 4174 */ 4175 startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; 4176 4177 /** 4178 * Service extension uses this method to start a specific ability, 4179 * if ability is multi instance, will start a recent instance. 4180 * 4181 * @param { Want } want - Indicates the ability to start. 4182 * @param { StartOptions } [options] - Indicates the start options. 4183 * @returns { Promise<void> } The promise returned by the function. 4184 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4185 * 2. Incorrect parameter types; 3. Parameter verification failed. 4186 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4187 * @throws { BusinessError } 16000002 - Incorrect ability type. 4188 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4189 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4190 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4191 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4192 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4193 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4194 * @throws { BusinessError } 16000011 - The context does not exist. 4195 * @throws { BusinessError } 16000050 - Internal error. 4196 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4197 * @throws { BusinessError } 16000055 - Installation-free timed out. 4198 * @throws { BusinessError } 16200001 - The caller has been released. 4199 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4200 * @systemapi 4201 * @stagemodelonly 4202 * @since 9 4203 */ 4204 /** 4205 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 4206 * you can use this method to start ability; If the caller application is in the background, 4207 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4208 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4209 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4210 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 4211 * 4212 * @param { Want } want - Indicates the ability to start. 4213 * @param { StartOptions } [options] - Indicates the start options. 4214 * @returns { Promise<void> } The promise returned by the function. 4215 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4216 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4217 * 2. Incorrect parameter types; 3. Parameter verification failed. 4218 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4219 * @throws { BusinessError } 16000002 - Incorrect ability type. 4220 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4221 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4222 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4223 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4224 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4225 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4226 * @throws { BusinessError } 16000011 - The context does not exist. 4227 * @throws { BusinessError } 16000012 - The application is controlled. 4228 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4229 * @throws { BusinessError } 16000050 - Internal error. 4230 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4231 * @throws { BusinessError } 16000055 - Installation-free timed out. 4232 * @throws { BusinessError } 16200001 - The caller has been released. 4233 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4234 * @systemapi 4235 * @stagemodelonly 4236 * @since 10 4237 */ 4238 /** 4239 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 4240 * you can use this method to start ability; If the caller application is in the background, 4241 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4242 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4243 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4244 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 4245 * 4246 * @param { Want } want - Indicates the ability to start. 4247 * @param { StartOptions } [options] - Indicates the start options. 4248 * @returns { Promise<void> } The promise returned by the function. 4249 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4250 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4251 * 2. Incorrect parameter types; 3. Parameter verification failed. 4252 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4253 * @throws { BusinessError } 16000002 - Incorrect ability type. 4254 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4255 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4256 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4257 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4258 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4259 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4260 * @throws { BusinessError } 16000011 - The context does not exist. 4261 * @throws { BusinessError } 16000012 - The application is controlled. 4262 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4263 * @throws { BusinessError } 16000050 - Internal error. 4264 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4265 * @throws { BusinessError } 16000055 - Installation-free timed out. 4266 * @throws { BusinessError } 16200001 - The caller has been released. 4267 * @throws { BusinessError } 16000073 - The app clone index is invalid. 4268 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4269 * @systemapi 4270 * @stagemodelonly 4271 * @since 12 4272 */ 4273 /** 4274 * If ability is multi instance, will start a recent instance. If the caller application is in foreground, 4275 * you can use this method to start ability; If the caller application is in the background, 4276 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4277 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4278 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4279 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 4280 * 4281 * @param { Want } want - Indicates the ability to start. 4282 * @param { StartOptions } [options] - Indicates the start options. 4283 * @returns { Promise<void> } The promise returned by the function. 4284 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4285 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 4286 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4287 * 2. Incorrect parameter types; 3. Parameter verification failed. 4288 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4289 * @throws { BusinessError } 16000002 - Incorrect ability type. 4290 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4291 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4292 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4293 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4294 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4295 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4296 * @throws { BusinessError } 16000011 - The context does not exist. 4297 * @throws { BusinessError } 16000012 - The application is controlled. 4298 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4299 * @throws { BusinessError } 16000050 - Internal error. 4300 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4301 * @throws { BusinessError } 16000055 - Installation-free timed out. 4302 * @throws { BusinessError } 16000071 - App clone is not supported. 4303 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 4304 * @throws { BusinessError } 16000073 - The app clone index is invalid. 4305 * @throws { BusinessError } 16000076 - The app instance key is invalid. 4306 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 4307 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 4308 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 4309 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 4310 * @throws { BusinessError } 16200001 - The caller has been released. 4311 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4312 * @systemapi 4313 * @stagemodelonly 4314 * @since 14 4315 */ 4316 startRecentAbility(want: Want, options?: StartOptions): Promise<void>; 4317 4318 /** 4319 * Requests certain permissions from the system. 4320 * 4321 * @param { Want } want - Indicates the dialog service to start. 4322 * @param { AsyncCallback<dialogRequest.RequestResult> } result - The callback is used to return the request result. 4323 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4324 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4325 * @throws { BusinessError } 16000002 - Incorrect ability type. 4326 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4327 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4328 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4329 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4330 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4331 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4332 * @throws { BusinessError } 16000011 - The context does not exist. 4333 * @throws { BusinessError } 16000050 - Internal error. 4334 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4335 * @throws { BusinessError } 16000055 - Installation-free timed out. 4336 * @throws { BusinessError } 16200001 - The caller has been released. 4337 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4338 * @stagemodelonly 4339 * @since 9 4340 */ 4341 /** 4342 * Starts a service extension ability that supports modal dialog. If the caller application is in foreground, 4343 * you can use this method to start service extension ability; If the caller application is in the background, 4344 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4345 * If the target service extension ability is visible, you can start the target service extension ability; 4346 * If the target service extension ability is invisible, 4347 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 4348 * 4349 * @param { Want } want - Indicates the dialog service to start. 4350 * @param { AsyncCallback<dialogRequest.RequestResult> } result - The callback is used to return the request result. 4351 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4352 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4353 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4354 * @throws { BusinessError } 16000002 - Incorrect ability type. 4355 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4356 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4357 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4358 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4359 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4360 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4361 * @throws { BusinessError } 16000011 - The context does not exist. 4362 * @throws { BusinessError } 16000012 - The application is controlled. 4363 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4364 * @throws { BusinessError } 16000050 - Internal error. 4365 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4366 * @throws { BusinessError } 16000055 - Installation-free timed out. 4367 * @throws { BusinessError } 16200001 - The caller has been released. 4368 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4369 * @stagemodelonly 4370 * @since 10 4371 */ 4372 requestDialogService(want: Want, result: AsyncCallback<dialogRequest.RequestResult>): void; 4373 4374 /** 4375 * Requests certain permissions from the system. 4376 * 4377 * @param { Want } want - Indicates the dialog service to start. 4378 * @returns { Promise<dialogRequest.RequestResult> } Returns the request result. 4379 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4380 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4381 * @throws { BusinessError } 16000002 - Incorrect ability type. 4382 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4383 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4384 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4385 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4386 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4387 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4388 * @throws { BusinessError } 16000011 - The context does not exist. 4389 * @throws { BusinessError } 16000050 - Internal error. 4390 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4391 * @throws { BusinessError } 16000055 - Installation-free timed out. 4392 * @throws { BusinessError } 16200001 - The caller has been released. 4393 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4394 * @stagemodelonly 4395 * @since 9 4396 */ 4397 /** 4398 * Starts a service extension ability that supports modal dialog. If the caller application is in foreground, 4399 * you can use this method to start service extension ability; If the caller application is in the background, 4400 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 4401 * If the target service extension ability is visible, you can start the target service extension ability; 4402 * If the target service extension ability is invisible, 4403 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service 4404 * extension ability. 4405 * 4406 * @param { Want } want - Indicates the dialog service to start. 4407 * @returns { Promise<dialogRequest.RequestResult> } Returns the request result. 4408 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4409 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4410 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4411 * @throws { BusinessError } 16000002 - Incorrect ability type. 4412 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4413 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4414 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4415 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4416 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 4417 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 4418 * @throws { BusinessError } 16000011 - The context does not exist. 4419 * @throws { BusinessError } 16000012 - The application is controlled. 4420 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4421 * @throws { BusinessError } 16000050 - Internal error. 4422 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4423 * @throws { BusinessError } 16000055 - Installation-free timed out. 4424 * @throws { BusinessError } 16200001 - The caller has been released. 4425 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4426 * @stagemodelonly 4427 * @since 10 4428 */ 4429 requestDialogService(want: Want): Promise<dialogRequest.RequestResult>; 4430 4431 /** 4432 * Report to system when the ability is drawn completed. 4433 * 4434 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4435 * @throws { BusinessError } 16000011 - The context does not exist. 4436 * @throws { BusinessError } 16000050 - Internal error. 4437 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4438 * @stagemodelonly 4439 * @since 10 4440 */ 4441 /** 4442 * Report to system when the ability is drawn completed. 4443 * 4444 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4445 * @throws { BusinessError } 16000011 - The context does not exist. 4446 * @throws { BusinessError } 16000050 - Internal error. 4447 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4448 * @stagemodelonly 4449 * @atomicservice 4450 * @since 11 4451 */ 4452 /** 4453 * Report to system when the ability is drawn completed. 4454 * 4455 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4456 * @throws { BusinessError } 16000011 - The context does not exist. 4457 * @throws { BusinessError } 16000050 - Internal error. 4458 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4459 * @stagemodelonly 4460 * @crossplatform 4461 * @atomicservice 4462 * @since arkts {'1.1':'12', '1.2':'20'} 4463 * @arkts 1.1&1.2 4464 */ 4465 reportDrawnCompleted(callback: AsyncCallback<void>): void; 4466 4467 /** 4468 * Starts the UIAbility or UIExtensionAbility by type. 4469 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4470 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4471 * 4472 * @param { string } type - The type of target ability. 4473 * @param { Record<string, Object> } wantParam - Indicates the want parameter. 4474 * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback. 4475 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4476 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4477 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4478 * <br>2.Incorrect parameter types. 4479 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4480 * @throws { BusinessError } 16000002 - Incorrect ability type. 4481 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4482 * @throws { BusinessError } 16000050 - Internal error. 4483 * @throws { BusinessError } 16200001 - The caller has been released. 4484 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4485 * @stagemodelonly 4486 * @atomicservice 4487 * @since 11 4488 */ 4489 /** 4490 * Starts the UIAbility or UIExtensionAbility by type. 4491 * If the caller application is in the background, it is not allowed to call this interface. 4492 * 4493 * @param { string } type - The type of target ability. 4494 * @param { Record<string, Object> } wantParam - Indicates the want parameter. 4495 * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback. 4496 * @param { AsyncCallback<void> } callback - The callback of startAbility. 4497 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4498 * <br>2.Incorrect parameter types. 4499 * @throws { BusinessError } 16000050 - Internal error. 4500 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4501 * @stagemodelonly 4502 * @atomicservice 4503 * @since 12 4504 */ 4505 startAbilityByType(type: string, wantParam: Record<string, Object>, 4506 abilityStartCallback: AbilityStartCallback, callback: AsyncCallback<void>): void; 4507 4508 /** 4509 * Starts the UIAbility or UIExtensionAbility by type. 4510 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 4511 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 4512 * 4513 * @param { string } type - The type of target ability. 4514 * @param { Record<string, Object> } wantParam - Indicates the want parameter. 4515 * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback. 4516 * @returns { Promise<void> } The promise returned by the function. 4517 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4518 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4519 * <br>2.Incorrect parameter types. 4520 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4521 * @throws { BusinessError } 16000002 - Incorrect ability type. 4522 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4523 * @throws { BusinessError } 16000050 - Internal error. 4524 * @throws { BusinessError } 16200001 - The caller has been released. 4525 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4526 * @stagemodelonly 4527 * @atomicservice 4528 * @since 11 4529 */ 4530 /** 4531 * Starts the UIAbility or UIExtensionAbility by type. 4532 * If the caller application is in the background, it is not allowed to call this interface. 4533 * 4534 * @param { string } type - The type of target ability. 4535 * @param { Record<string, Object> } wantParam - Indicates the want parameter. 4536 * @param { AbilityStartCallback } abilityStartCallback - Indicates the abilityStartCallback. 4537 * @returns { Promise<void> } The promise returned by the function. 4538 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4539 * <br>2.Incorrect parameter types. 4540 * @throws { BusinessError } 16000050 - Internal error. 4541 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4542 * @stagemodelonly 4543 * @atomicservice 4544 * @since 12 4545 */ 4546 startAbilityByType(type: string, wantParam: Record<string, Object>, 4547 abilityStartCallback: AbilityStartCallback): Promise<void>; 4548 4549 /** 4550 * Requests the Modal UIExtensionAbility. 4551 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 4552 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 4553 * 4554 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 4555 * @param { AsyncCallback<void> } callback - The callback of requestModalUIExtension. 4556 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4557 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 4558 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4559 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4560 * @throws { BusinessError } 16000002 - Incorrect ability type. 4561 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4562 * @throws { BusinessError } 16000050 - Internal error. 4563 * @throws { BusinessError } 16200001 - The caller has been released. 4564 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4565 * @systemapi 4566 * @stagemodelonly 4567 * @since 11 4568 */ 4569 /** 4570 * Requests the specified foreground application to start the UIExtensionAbility of the corresponding type. The foreground 4571 * application is specified by bundleName in want.parameters. If bundleName is left unspecified, or if the application 4572 * specified by bundleName is not running in the foreground or does not exist, the UIExtensionAbility is directly started 4573 * on the system interface. The UIExtensionAbility to start is determined by the combination of the bundleName, abilityName, 4574 * and moduleName fields in want, and its type is determined by the ability.want.params.uiExtensionType field in want.parameters. 4575 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 4576 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 4577 * 4578 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 4579 * @param { AsyncCallback<void> } callback - The callback of requestModalUIExtension. 4580 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 4581 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4582 * @throws { BusinessError } 16000050 - Internal error. 4583 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4584 * @systemapi 4585 * @stagemodelonly 4586 * @since arkts {'1.1':'12', '1.2':'20'} 4587 * @arkts 1.1&1.2 4588 */ 4589 requestModalUIExtension(pickerWant: Want, callback: AsyncCallback<void>): void; 4590 4591 /** 4592 * Requests the Modal UIExtensionAbility. 4593 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 4594 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 4595 * 4596 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 4597 * @returns { Promise<void> } The promise returned by the requestModalUIExtension. 4598 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4599 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 4600 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4601 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4602 * @throws { BusinessError } 16000002 - Incorrect ability type. 4603 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4604 * @throws { BusinessError } 16000050 - Internal error. 4605 * @throws { BusinessError } 16200001 - The caller has been released. 4606 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4607 * @systemapi 4608 * @stagemodelonly 4609 * @since 11 4610 */ 4611 /** 4612 * Requests the specified foreground application to start the UIExtensionAbility of the corresponding type. The foreground 4613 * application is specified by bundleName in want.parameters. If bundleName is left unspecified, or if the application 4614 * specified by bundleName is not running in the foreground or does not exist, the UIExtensionAbility is directly started 4615 * on the system interface. The UIExtensionAbility to start is determined by the combination of the bundleName, abilityName, 4616 * and moduleName fields in want, and its type is determined by the ability.want.params.uiExtensionType field in want.parameters. 4617 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 4618 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 4619 * 4620 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 4621 * @returns { Promise<void> } The promise returned by the requestModalUIExtension. 4622 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 4623 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4624 * @throws { BusinessError } 16000050 - Internal error. 4625 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4626 * @systemapi 4627 * @stagemodelonly 4628 * @since arkts {'1.1':'12', '1.2':'20'} 4629 * @arkts 1.1&1.2 4630 */ 4631 requestModalUIExtension(pickerWant: Want): Promise<void>; 4632 4633 /** 4634 * Full-screen pop-us startup atomic service. 4635 * 4636 * @param { string } appId - Globally unique identifier of an application, which is allocated by the cloud. 4637 * @param { AtomicServiceOptions } [options] - Indicates the atomic service start options. 4638 * @returns { Promise<AbilityResult> } Returns the result of openAtomicService. 4639 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 4640 * @throws { BusinessError } 16000002 - Incorrect ability type. 4641 * @throws { BusinessError } 16000003 - The specified ID does not exist. 4642 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4643 * @throws { BusinessError } 16000011 - The context does not exist. 4644 * @throws { BusinessError } 16000012 - The application is controlled. 4645 * @throws { BusinessError } 16000050 - Internal error. 4646 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 4647 * @throws { BusinessError } 16000055 - Installation-free timed out. 4648 * @throws { BusinessError } 16200001 - The caller has been released. 4649 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4650 * @stagemodelonly 4651 * @atomicservice 4652 * @since 12 4653 */ 4654 openAtomicService(appId: string, options?: AtomicServiceOptions): Promise<AbilityResult>; 4655 4656 /** 4657 * Move current ability to background. 4658 * 4659 * @returns { Promise<void> } Returns the result of moveAbilityToBackground. 4660 * @throws { BusinessError } 16000011 - The context does not exist. 4661 * @throws { BusinessError } 16000050 - Internal error. 4662 * @throws { BusinessError } 16000061 - Operation not supported. 4663 * @throws { BusinessError } 16000065 - The API can be called only when the ability is running in the foreground. 4664 * @throws { BusinessError } 16000066 - An ability cannot switch to the foreground or background in Wukong mode. 4665 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4666 * @stagemodelonly 4667 * @atomicservice 4668 * @since arkts {'1.1':'12', '1.2':'20'} 4669 * @arkts 1.1&1.2 4670 */ 4671 moveAbilityToBackground(): Promise<void>; 4672 4673 /** 4674 * Show current ability. The ability needs to be started by UIAbilityContext.startAbility 4675 * with input parameter options.processMode setting to NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM. 4676 * 4677 * @returns { Promise<void> } The promise returned by the function. 4678 * @throws { BusinessError } 801 - Capability not support. 4679 * @throws { BusinessError } 16000050 - Internal error. 4680 * @throws { BusinessError } 16000067 - The StartOptions check failed. 4681 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4682 * @stagemodelonly 4683 * @since 12 4684 */ 4685 showAbility(): Promise<void>; 4686 4687 /** 4688 * Hide current ability. The ability needs to be started by UIAbilityContext.startAbility 4689 * with input parameter options.processMode setting to NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM. 4690 * 4691 * @returns { Promise<void> } The promise returned by the function. 4692 * @throws { BusinessError } 801 - Capability not support. 4693 * @throws { BusinessError } 16000050 - Internal error. 4694 * @throws { BusinessError } 16000067 - The StartOptions check failed. 4695 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4696 * @stagemodelonly 4697 * @since 12 4698 */ 4699 hideAbility(): Promise<void>; 4700 4701 /** 4702 * Set whether restoration is enabled when the UIAbility is switched back from the background. 4703 * 4704 * @param { boolean } enabled - The flag that indicates whether restoration is enabled when the UIAbility is switched 4705 * back from the background. 4706 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 4707 * @throws { BusinessError } 16000011 - The context does not exist. 4708 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4709 * @stagemodelonly 4710 * @atomicservice 4711 * @since 14 4712 */ 4713 setRestoreEnabled(enabled: boolean): void; 4714 4715 /** 4716 * Starts a UI service extension ability. 4717 * If the target UI service extension ability is visible, you can start the target UI service extension ability; 4718 * If the target UI service extension ability is invisible, 4719 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UI service extension ability. 4720 * 4721 * @param { Want } want - Indicates the want info to start. 4722 * @returns { Promise<void> } The promise returned by the function. 4723 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4724 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4725 * 2. Incorrect parameter types; 3. Parameter verification failed. 4726 * @throws { BusinessError } 801 - Capability not supported. 4727 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4728 * @throws { BusinessError } 16000002 - Incorrect ability type. 4729 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4730 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4731 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4732 * @throws { BusinessError } 16000011 - The context does not exist. 4733 * @throws { BusinessError } 16000012 - The application is controlled. 4734 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4735 * @throws { BusinessError } 16000019 - No matching ability is found. 4736 * @throws { BusinessError } 16000050 - Internal error. 4737 * @throws { BusinessError } 16200001 - The caller has been released. 4738 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4739 * @stagemodelonly 4740 * @atomicservice 4741 * @since 14 4742 */ 4743 startUIServiceExtensionAbility(want: Want): Promise<void>; 4744 4745 /** 4746 * Connects to a UI service extension ability. 4747 * If the target UI service extension ability is visible, you can connect the target UI service extension ability; 4748 * If the target UI service extension ability is invisible, 4749 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible UI service extension ability. 4750 * 4751 * @param { Want } want - Indicates the want info to connect. 4752 * @param { UIServiceExtensionConnectCallback } callback - The callback of connection. 4753 * @returns { Promise<UIServiceProxy> } The promise to get UIServiceProxy. 4754 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4755 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4756 * 2. Incorrect parameter types; 3. Parameter verification failed. 4757 * @throws { BusinessError } 801 - Capability not supported. 4758 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4759 * @throws { BusinessError } 16000002 - Incorrect ability type. 4760 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4761 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4762 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4763 * @throws { BusinessError } 16000011 - The context does not exist. 4764 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4765 * @throws { BusinessError } 16000050 - Internal error. 4766 * @throws { BusinessError } 16000055 - Installation-free timed out. 4767 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4768 * @stagemodelonly 4769 * @atomicservice 4770 * @since 14 4771 */ 4772 connectUIServiceExtensionAbility(want: Want, callback: UIServiceExtensionConnectCallback) : Promise<UIServiceProxy>; 4773 4774 /** 4775 * Disconnects from a UI service extension, in contrast to {@link connectUIServiceExtensionAbility}. 4776 * 4777 * @param { UIServiceProxy } proxy - The UI service proxy return by connectUIServiceExtensionAbility. 4778 * @returns { Promise<void> } The promise returned by the function. 4779 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4780 * 2. Incorrect parameter types; 3. Parameter verification failed. 4781 * @throws { BusinessError } 16000011 - The context does not exist. 4782 * @throws { BusinessError } 16000050 - Internal error. 4783 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4784 * @stagemodelonly 4785 * @atomicservice 4786 * @since 14 4787 */ 4788 disconnectUIServiceExtensionAbility(proxy: UIServiceProxy): Promise<void>; 4789 4790 /** 4791 * Set label and icon for current ability instance. 4792 * You need to apply for permission:ohos.permission.SET_ABILITY_INSTANCE_INFO to call this function. 4793 * 4794 * @permission ohos.permission.SET_ABILITY_INSTANCE_INFO 4795 * @param { string } label - The label of ability to be displayed in the Task Center and shortcut bar. 4796 * @param { image.PixelMap } icon - The icon of ability to be displayed in the Task Center and shortcut bar. 4797 * @returns { Promise<void> } The promise returned by the function. 4798 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 4799 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 4800 * 2.Incorrect parameter types. 3. Parameter verification failed. 4801 * @throws { BusinessError } 801 - Capability not supported. 4802 * @throws { BusinessError } 16000011 - The context does not exist. 4803 * @throws { BusinessError } 16000050 - Internal error. 4804 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4805 * @stagemodelonly 4806 * @since 15 4807 */ 4808 setAbilityInstanceInfo(label: string, icon: image.PixelMap): Promise<void>; 4809 4810 /** 4811 * Revoke delegator. 4812 * 4813 * @returns { Promise<void> } The promise returned by the function. 4814 * @throws { BusinessError } 801 - Capability not support. 4815 * @throws { BusinessError } 16000011 - The context does not exist. 4816 * @throws { BusinessError } 16000050 - Internal error. 4817 * @throws { BusinessError } 16000065 - The API can be called only when the ability is running in the foreground. 4818 * @throws { BusinessError } 16000084 - Only DelegatorAbility is allowed to call this API, and only once. 4819 * @throws { BusinessError } 16000085 - An error occurred during the interaction between the ability and window. 4820 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4821 * @stagemodelonly 4822 * @since 17 4823 */ 4824 revokeDelegator(): Promise<void>; 4825 4826 /** 4827 * Set colorMode of uiability. 4828 * 4829 * @param { ConfigurationConstant.ColorMode } colorMode - Color mode. 4830 * @throws { BusinessError } 16000011 - The context does not exist. 4831 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4832 * @stagemodelonly 4833 * @atomicservice 4834 * @since 18 4835 */ 4836 setColorMode(colorMode: ConfigurationConstant.ColorMode): void; 4837 4838 /** 4839 * Starts a new app service extension ability. 4840 * If the target app service extension ability is invisible, 4841 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible app service extension ability. 4842 * 4843 * @param { Want } want - Indicates the want info to start. 4844 * @returns { Promise<void> } The promise returned by the function. 4845 * @throws { BusinessError } 801 - Capability not supported. 4846 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4847 * @throws { BusinessError } 16000002 - Incorrect ability type. 4848 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4849 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4850 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4851 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4852 * @throws { BusinessError } 16000011 - The context does not exist. 4853 * @throws { BusinessError } 16000012 - The application is controlled. 4854 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 4855 * @throws { BusinessError } 16000019 - No matching ability is found. 4856 * @throws { BusinessError } 16000050 - Internal error. 4857 * @throws { BusinessError } 16000200 - The caller is not in the appIdentifierAllowList of the target application. 4858 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4859 * @stagemodelonly 4860 * @since 20 4861 */ 4862 startAppServiceExtensionAbility(want: Want): Promise<void>; 4863 4864 /** 4865 * Stops an app service extension ability. 4866 * If the target app service extension ability is invisible, 4867 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible app service extension ability. 4868 * 4869 * @param { Want } want - Indicates the want info to start. 4870 * @returns { Promise<void> } The promise returned by the function. 4871 * @throws { BusinessError } 801 - Capability not supported. 4872 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4873 * @throws { BusinessError } 16000002 - Incorrect ability type. 4874 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4875 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4876 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4877 * @throws { BusinessError } 16000011 - The context does not exist. 4878 * @throws { BusinessError } 16000050 - Internal error. 4879 * @throws { BusinessError } 16000200 - The caller is not in the appIdentifierAllowList of the target application. 4880 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4881 * @stagemodelonly 4882 * @since 20 4883 */ 4884 stopAppServiceExtensionAbility(want: Want): Promise<void>; 4885 4886 /** 4887 * Connects current ability to an app service extension ability. 4888 * If the target app service extension ability is invisible, 4889 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible app service extension ability. 4890 * 4891 * @param { Want } want - The element name of the app service ability 4892 * @param { ConnectOptions } callback - The callback for obtaining the connection result 4893 * @returns { number } Returns the number code of the ability connected 4894 * @throws { BusinessError } 801 - Capability not supported. 4895 * @throws { BusinessError } 16000001 - The specified ability does not exist. 4896 * @throws { BusinessError } 16000002 - Incorrect ability type. 4897 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 4898 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 4899 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 4900 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 4901 * @throws { BusinessError } 16000011 - The context does not exist. 4902 * @throws { BusinessError } 16000050 - Internal error. 4903 * @throws { BusinessError } 16000201 - The target service has not been started yet. 4904 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4905 * @stagemodelonly 4906 * @since 20 4907 */ 4908 connectAppServiceExtensionAbility(want: Want, callback: ConnectOptions): number; 4909 4910 /** 4911 * Disconnect current ability from an app service extension, in contrast to {@link connectAppServiceExtensionAbility}. 4912 * 4913 * @param { number } connection - The number code of the ability connected 4914 * @returns { Promise<void> } The promise returned by the function. 4915 * @throws { BusinessError } 801 - Capability not supported. 4916 * @throws { BusinessError } 16000011 - The context does not exist. 4917 * @throws { BusinessError } 16000050 - Internal error. 4918 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4919 * @stagemodelonly 4920 * @since 20 4921 */ 4922 disconnectAppServiceExtensionAbility(connection: number): Promise<void>; 4923 4924 /** 4925 * The onNewWant callback is not triggered when a UIAbility's lifecycle is driven by scenarios. 4926 * For scenarios, refer to {@link contextConstant.Scenarios}. 4927 * 4928 * @param { number } scenarios - The number code of the scenarios. 4929 * @returns { Promise<void> } The promise returned by the function. 4930 * @throws { BusinessError } 16000050 - Internal error. Possible causes: Connection to service failed. 4931 * @syscap SystemCapability.Ability.AbilityRuntime.Core 4932 * @stagemodelonly 4933 * @atomicservice 4934 * @since 20 4935 */ 4936 setOnNewWantSkipScenarios(scenarios: number): Promise<void>; 4937} 4938 4939export default UIAbilityContext;