1/* 2 * Copyright (c) 2022-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 OpenLinkOptions from '../@ohos.app.ability.OpenLinkOptions'; 25import type AtomicServiceOptions from '../@ohos.app.ability.AtomicServiceOptions'; 26/*** endif */ 27import { AsyncCallback } from '../@ohos.base'; 28import ExtensionContext from './ExtensionContext'; 29import StartOptions from '../@ohos.app.ability.StartOptions'; 30import Want from '../@ohos.app.ability.Want'; 31 32/** 33 * The context of service extension. It allows access to 34 * serviceExtension-specific resources. 35 * 36 * @extends ExtensionContext 37 * @syscap SystemCapability.Ability.AbilityRuntime.Core 38 * @systemapi 39 * @stagemodelonly 40 * @since arkts {'1.1':'9', '1.2':'20'} 41 * @arkts 1.1&1.2 42 */ 43declare class ServiceExtensionContext extends ExtensionContext { 44 /** 45 * Service extension uses this method to start a specific ability. 46 * 47 * @param { Want } want - Indicates the ability to start. 48 * @param { AsyncCallback<void> } callback - The callback of startAbility. 49 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 50 * 2. Incorrect parameter types; 3. Parameter verification failed. 51 * @throws { BusinessError } 16000001 - The specified ability does not exist. 52 * @throws { BusinessError } 16000002 - Incorrect ability type. 53 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 54 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 55 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 56 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 57 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 58 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 59 * @throws { BusinessError } 16000011 - The context does not exist. 60 * @throws { BusinessError } 16000050 - Internal error. 61 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 62 * @throws { BusinessError } 16000055 - Installation-free timed out. 63 * @throws { BusinessError } 16200001 - The caller has been released. 64 * @syscap SystemCapability.Ability.AbilityRuntime.Core 65 * @systemapi 66 * @stagemodelonly 67 * @since 9 68 */ 69 /** 70 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 71 * you can use this method to start ability; If the caller application is in the background, 72 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 73 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 74 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 75 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 76 * 77 * @param { Want } want - Indicates the ability to start. 78 * @param { AsyncCallback<void> } callback - The callback of startAbility. 79 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 80 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 81 * 2. Incorrect parameter types; 3. Parameter verification failed. 82 * @throws { BusinessError } 16000001 - The specified ability does not exist. 83 * @throws { BusinessError } 16000002 - Incorrect ability type. 84 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 85 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 86 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 87 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 88 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 89 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 90 * @throws { BusinessError } 16000011 - The context does not exist. 91 * @throws { BusinessError } 16000012 - The application is controlled. 92 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 93 * @throws { BusinessError } 16000050 - Internal error. 94 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 95 * @throws { BusinessError } 16000055 - Installation-free timed out. 96 * @throws { BusinessError } 16200001 - The caller has been released. 97 * @syscap SystemCapability.Ability.AbilityRuntime.Core 98 * @systemapi 99 * @stagemodelonly 100 * @since 10 101 */ 102 /** 103 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 104 * you can use this method to start ability; If the caller application is in the background, 105 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 106 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 107 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 108 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 109 * 110 * @param { Want } want - Indicates the ability to start. 111 * @param { AsyncCallback<void> } callback - The callback of startAbility. 112 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 113 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 114 * 2. Incorrect parameter types; 3. Parameter verification failed. 115 * @throws { BusinessError } 16000001 - The specified ability does not exist. 116 * @throws { BusinessError } 16000002 - Incorrect ability type. 117 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 118 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 119 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 120 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 121 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 122 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 123 * @throws { BusinessError } 16000011 - The context does not exist. 124 * @throws { BusinessError } 16000012 - The application is controlled. 125 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 126 * @throws { BusinessError } 16000019 - No matching ability is found. 127 * @throws { BusinessError } 16000050 - Internal error. 128 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 129 * @throws { BusinessError } 16000055 - Installation-free timed out. 130 * @throws { BusinessError } 16200001 - The caller has been released. 131 * @throws { BusinessError } 16000073 - The app clone index is invalid. 132 * @syscap SystemCapability.Ability.AbilityRuntime.Core 133 * @systemapi 134 * @stagemodelonly 135 * @since 12 136 */ 137 /** 138 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 139 * you can use this method to start ability; If the caller application is in the background, 140 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 141 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 142 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 143 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 144 * 145 * @param { Want } want - Indicates the ability to start. 146 * @param { AsyncCallback<void> } callback - The callback of startAbility. 147 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 148 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 149 * 2. Incorrect parameter types; 3. Parameter verification failed. 150 * @throws { BusinessError } 16000001 - The specified ability does not exist. 151 * @throws { BusinessError } 16000002 - Incorrect ability type. 152 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 153 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 154 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 155 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 156 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 157 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 158 * @throws { BusinessError } 16000011 - The context does not exist. 159 * @throws { BusinessError } 16000012 - The application is controlled. 160 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 161 * @throws { BusinessError } 16000019 - No matching ability is found. 162 * @throws { BusinessError } 16000050 - Internal error. 163 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 164 * @throws { BusinessError } 16000055 - Installation-free timed out. 165 * @throws { BusinessError } 16000071 - App clone is not supported. 166 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 167 * @throws { BusinessError } 16000073 - The app clone index is invalid. 168 * @throws { BusinessError } 16000076 - The app instance key is invalid. 169 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 170 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 171 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 172 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 173 * @throws { BusinessError } 16200001 - The caller has been released. 174 * @syscap SystemCapability.Ability.AbilityRuntime.Core 175 * @systemapi 176 * @stagemodelonly 177 * @since arkts {'1.1':'14', '1.2':'20'} 178 * @arkts 1.1&1.2 179 */ 180 startAbility(want: Want, callback: AsyncCallback<void>): void; 181 182 /** 183 * Service extension uses this method to start a specific ability. 184 * 185 * @param { Want } want - Indicates the ability to start. 186 * @param { StartOptions } options - Indicates the start options. 187 * @param { AsyncCallback<void> } callback - The callback of startAbility. 188 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 189 * 2. Incorrect parameter types; 3. Parameter verification failed. 190 * @throws { BusinessError } 16000001 - The specified ability does not exist. 191 * @throws { BusinessError } 16000002 - Incorrect ability type. 192 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 193 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 194 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 195 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 196 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 197 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 198 * @throws { BusinessError } 16000011 - The context does not exist. 199 * @throws { BusinessError } 16000050 - Internal error. 200 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 201 * @throws { BusinessError } 16000055 - Installation-free timed out. 202 * @throws { BusinessError } 16200001 - The caller has been released. 203 * @syscap SystemCapability.Ability.AbilityRuntime.Core 204 * @systemapi 205 * @stagemodelonly 206 * @since 9 207 */ 208 /** 209 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 210 * you can use this method to start ability; If the caller application is in the background, 211 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 212 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 213 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 214 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 215 * 216 * @param { Want } want - Indicates the ability to start. 217 * @param { StartOptions } options - Indicates the start options. 218 * @param { AsyncCallback<void> } callback - The callback of startAbility. 219 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 220 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 221 * 2. Incorrect parameter types; 3. Parameter verification failed. 222 * @throws { BusinessError } 16000001 - The specified ability does not exist. 223 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 224 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 225 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 226 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 227 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 228 * @throws { BusinessError } 16000011 - The context does not exist. 229 * @throws { BusinessError } 16000012 - The application is controlled. 230 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 231 * @throws { BusinessError } 16000050 - Internal error. 232 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 233 * @throws { BusinessError } 16000055 - Installation-free timed out. 234 * @throws { BusinessError } 16200001 - The caller has been released. 235 * @syscap SystemCapability.Ability.AbilityRuntime.Core 236 * @systemapi 237 * @stagemodelonly 238 * @since 10 239 */ 240 /** 241 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 242 * you can use this method to start ability; If the caller application is in the background, 243 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 244 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 245 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 246 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 247 * 248 * @param { Want } want - Indicates the ability to start. 249 * @param { StartOptions } options - Indicates the start options. 250 * @param { AsyncCallback<void> } callback - The callback of startAbility. 251 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 252 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 253 * 2. Incorrect parameter types; 3. Parameter verification failed. 254 * @throws { BusinessError } 16000001 - The specified ability does not exist. 255 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 256 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 257 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 258 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 259 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 260 * @throws { BusinessError } 16000011 - The context does not exist. 261 * @throws { BusinessError } 16000012 - The application is controlled. 262 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 263 * @throws { BusinessError } 16000019 - No matching ability is found. 264 * @throws { BusinessError } 16000050 - Internal error. 265 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 266 * @throws { BusinessError } 16000055 - Installation-free timed out. 267 * @throws { BusinessError } 16200001 - The caller has been released. 268 * @throws { BusinessError } 16000073 - The app clone index is invalid. 269 * @syscap SystemCapability.Ability.AbilityRuntime.Core 270 * @systemapi 271 * @stagemodelonly 272 * @since 12 273 */ 274 /** 275 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 276 * you can use this method to start ability; If the caller application is in the background, 277 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 278 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 279 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 280 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 281 * 282 * @param { Want } want - Indicates the ability to start. 283 * @param { StartOptions } options - Indicates the start options. 284 * @param { AsyncCallback<void> } callback - The callback of startAbility. 285 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 286 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 287 * 2. Incorrect parameter types; 3. Parameter verification failed. 288 * @throws { BusinessError } 16000001 - The specified ability does not exist. 289 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 290 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 291 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 292 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 293 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 294 * @throws { BusinessError } 16000011 - The context does not exist. 295 * @throws { BusinessError } 16000012 - The application is controlled. 296 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 297 * @throws { BusinessError } 16000019 - No matching ability is found. 298 * @throws { BusinessError } 16000050 - Internal error. 299 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 300 * @throws { BusinessError } 16000055 - Installation-free timed out. 301 * @throws { BusinessError } 16000071 - App clone is not supported. 302 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 303 * @throws { BusinessError } 16000073 - The app clone index is invalid. 304 * @throws { BusinessError } 16000076 - The app instance key is invalid. 305 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 306 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 307 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 308 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 309 * @throws { BusinessError } 16200001 - The caller has been released. 310 * @syscap SystemCapability.Ability.AbilityRuntime.Core 311 * @systemapi 312 * @stagemodelonly 313 * @since arkts {'1.1':'14', '1.2':'20'} 314 * @arkts 1.1&1.2 315 */ 316 startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; 317 318 /** 319 * Service extension uses this method to start a specific ability. 320 * 321 * @param { Want } want - Indicates the ability to start. 322 * @param { StartOptions } options - Indicates the start options. 323 * @returns { Promise<void> } The promise returned by the function. 324 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 325 * 2. Incorrect parameter types; 3. Parameter verification failed. 326 * @throws { BusinessError } 16000001 - The specified ability does not exist. 327 * @throws { BusinessError } 16000002 - Incorrect ability type. 328 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 329 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 330 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 331 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 332 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 333 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 334 * @throws { BusinessError } 16000011 - The context does not exist. 335 * @throws { BusinessError } 16000050 - Internal error. 336 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 337 * @throws { BusinessError } 16000055 - Installation-free timed out. 338 * @throws { BusinessError } 16200001 - The caller has been released. 339 * @syscap SystemCapability.Ability.AbilityRuntime.Core 340 * @systemapi 341 * @stagemodelonly 342 * @since 9 343 */ 344 /** 345 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 346 * you can use this method to start ability; If the caller application is in the background, 347 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 348 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 349 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 350 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 351 * 352 * @param { Want } want - Indicates the ability to start. 353 * @param { StartOptions } [options] - Indicates the start options. 354 * @returns { Promise<void> } The promise returned by the function. 355 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 356 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 357 * 2. Incorrect parameter types; 3. Parameter verification failed. 358 * @throws { BusinessError } 16000001 - The specified ability does not exist. 359 * @throws { BusinessError } 16000002 - Incorrect ability type. 360 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 361 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 362 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 363 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 364 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 365 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 366 * @throws { BusinessError } 16000011 - The context does not exist. 367 * @throws { BusinessError } 16000012 - The application is controlled. 368 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 369 * @throws { BusinessError } 16000050 - Internal error. 370 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 371 * @throws { BusinessError } 16000055 - Installation-free timed out. 372 * @throws { BusinessError } 16200001 - The caller has been released. 373 * @syscap SystemCapability.Ability.AbilityRuntime.Core 374 * @systemapi 375 * @stagemodelonly 376 * @since 10 377 */ 378 /** 379 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 380 * you can use this method to start ability; If the caller application is in the background, 381 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 382 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 383 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 384 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 385 * 386 * @param { Want } want - Indicates the ability to start. 387 * @param { StartOptions } [options] - Indicates the start options. 388 * @returns { Promise<void> } The promise returned by the function. 389 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 390 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 391 * 2. Incorrect parameter types; 3. Parameter verification failed. 392 * @throws { BusinessError } 16000001 - The specified ability does not exist. 393 * @throws { BusinessError } 16000002 - Incorrect ability type. 394 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 395 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 396 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 397 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 398 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 399 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 400 * @throws { BusinessError } 16000011 - The context does not exist. 401 * @throws { BusinessError } 16000012 - The application is controlled. 402 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 403 * @throws { BusinessError } 16000019 - No matching ability is found. 404 * @throws { BusinessError } 16000050 - Internal error. 405 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 406 * @throws { BusinessError } 16000055 - Installation-free timed out. 407 * @throws { BusinessError } 16200001 - The caller has been released. 408 * @throws { BusinessError } 16000073 - The app clone index is invalid. 409 * @syscap SystemCapability.Ability.AbilityRuntime.Core 410 * @systemapi 411 * @stagemodelonly 412 * @since 12 413 */ 414 /** 415 * Service extension uses this method to start a specific ability. If the caller application is in foreground, 416 * you can use this method to start ability; If the caller application is in the background, 417 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 418 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 419 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 420 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 421 * 422 * @param { Want } want - Indicates the ability to start. 423 * @param { StartOptions } [options] - Indicates the start options. 424 * @returns { Promise<void> } The promise returned by the function. 425 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 426 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 427 * 2. Incorrect parameter types; 3. Parameter verification failed. 428 * @throws { BusinessError } 16000001 - The specified ability does not exist. 429 * @throws { BusinessError } 16000002 - Incorrect ability type. 430 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 431 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 432 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 433 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 434 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 435 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 436 * @throws { BusinessError } 16000011 - The context does not exist. 437 * @throws { BusinessError } 16000012 - The application is controlled. 438 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 439 * @throws { BusinessError } 16000019 - No matching ability is found. 440 * @throws { BusinessError } 16000050 - Internal error. 441 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 442 * @throws { BusinessError } 16000055 - Installation-free timed out. 443 * @throws { BusinessError } 16000071 - App clone is not supported. 444 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 445 * @throws { BusinessError } 16000073 - The app clone index is invalid. 446 * @throws { BusinessError } 16000076 - The app instance key is invalid. 447 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 448 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 449 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 450 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 451 * @throws { BusinessError } 16200001 - The caller has been released. 452 * @syscap SystemCapability.Ability.AbilityRuntime.Core 453 * @systemapi 454 * @stagemodelonly 455 * @since arkts {'1.1':'14', '1.2':'20'} 456 * @arkts 1.1&1.2 457 */ 458 startAbility(want: Want, options?: StartOptions): Promise<void>; 459 460 /** 461 * Service extension uses this method to start a specific ability by implicit want. If the caller application is in foreground, 462 * you can use this method to start ability; If the caller application is in the background, 463 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 464 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 465 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 466 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 467 * 468 * @param { string } link - Indicates the ability to start. 469 * @param { OpenLinkOptions } [options] - Indicates the open link options. 470 * @returns { Promise<void> } The promise returned by the function. 471 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 472 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 473 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 474 * 2. Incorrect parameter types; 3. Parameter verification failed. 475 * @throws { BusinessError } 16000001 - The specified ability does not exist. 476 * @throws { BusinessError } 16000002 - Incorrect ability type. 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 } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 483 * @throws { BusinessError } 16000011 - The context does not exist. 484 * @throws { BusinessError } 16000012 - The application is controlled. 485 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 486 * @throws { BusinessError } 16000019 - No matching ability is found. 487 * @throws { BusinessError } 16200001 - The caller has been released. 488 * @syscap SystemCapability.Ability.AbilityRuntime.Core 489 * @systemapi 490 * @stagemodelonly 491 * @since 12 492 */ 493 openLink(link: string, options?: OpenLinkOptions): Promise<void>; 494 495 /** 496 * Service extension start an ability using the original caller information. If the caller application is in 497 * foreground, you can use this method to start ability; If the caller application is in the background, 498 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 499 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 500 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 501 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 502 * 503 * @param { Want } want - Indicates the ability to start. 504 * @param { AsyncCallback<void> } callback - The callback of startAbility. 505 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 506 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 507 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 508 * 2. Incorrect parameter types; 3. Parameter verification failed. 509 * @throws { BusinessError } 16000001 - The specified ability does not exist. 510 * @throws { BusinessError } 16000002 - Incorrect ability type. 511 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 512 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 513 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 514 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 515 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 516 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 517 * @throws { BusinessError } 16000011 - The context does not exist. 518 * @throws { BusinessError } 16000012 - The application is controlled. 519 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 520 * @throws { BusinessError } 16000050 - Internal error. 521 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 522 * @throws { BusinessError } 16000055 - Installation-free timed out. 523 * @throws { BusinessError } 16200001 - The caller has been released. 524 * @syscap SystemCapability.Ability.AbilityRuntime.Core 525 * @systemapi 526 * @stagemodelonly 527 * @since 10 528 */ 529 /** 530 * Service extension start an ability using the original caller information. If the caller application is in 531 * foreground, you can use this method to start ability; If the caller application is in the background, 532 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 533 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 534 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 535 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 536 * 537 * @param { Want } want - Indicates the ability to start. 538 * @param { AsyncCallback<void> } callback - The callback of startAbility. 539 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 540 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 541 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 542 * 2. Incorrect parameter types; 3. Parameter verification failed. 543 * @throws { BusinessError } 16000001 - The specified ability does not exist. 544 * @throws { BusinessError } 16000002 - Incorrect ability type. 545 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 546 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 547 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 548 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 549 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 550 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 551 * @throws { BusinessError } 16000011 - The context does not exist. 552 * @throws { BusinessError } 16000012 - The application is controlled. 553 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 554 * @throws { BusinessError } 16000050 - Internal error. 555 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 556 * @throws { BusinessError } 16000055 - Installation-free timed out. 557 * @throws { BusinessError } 16200001 - The caller has been released. 558 * @throws { BusinessError } 16000073 - The app clone index is invalid. 559 * @syscap SystemCapability.Ability.AbilityRuntime.Core 560 * @systemapi 561 * @stagemodelonly 562 * @since 12 563 */ 564 /** 565 * Service extension start an ability using the original caller information. If the caller application is in 566 * foreground, you can use this method to start ability; If the caller application is in the background, 567 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 568 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 569 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 570 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 571 * 572 * @param { Want } want - Indicates the ability to start. 573 * @param { AsyncCallback<void> } callback - The callback of startAbility. 574 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 575 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 576 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 577 * 2. Incorrect parameter types; 3. Parameter verification failed. 578 * @throws { BusinessError } 16000001 - The specified ability does not exist. 579 * @throws { BusinessError } 16000002 - Incorrect ability type. 580 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 581 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 582 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 583 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 584 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 585 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 586 * @throws { BusinessError } 16000011 - The context does not exist. 587 * @throws { BusinessError } 16000012 - The application is controlled. 588 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 589 * @throws { BusinessError } 16000050 - Internal error. 590 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 591 * @throws { BusinessError } 16000055 - Installation-free timed out. 592 * @throws { BusinessError } 16000071 - App clone is not supported. 593 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 594 * @throws { BusinessError } 16000073 - The app clone index is invalid. 595 * @throws { BusinessError } 16000076 - The app instance key is invalid. 596 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 597 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 598 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 599 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 600 * @throws { BusinessError } 16200001 - The caller has been released. 601 * @syscap SystemCapability.Ability.AbilityRuntime.Core 602 * @systemapi 603 * @stagemodelonly 604 * @since 14 605 */ 606 startAbilityAsCaller(want: Want, callback: AsyncCallback<void>): void; 607 608 /** 609 * Service extension start an ability using the original caller information. If the caller application is in 610 * foreground, you can use this method to start ability; If the caller application is in the background, 611 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 612 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 613 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 614 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 615 * 616 * @param { Want } want - Indicates the ability to start. 617 * @param { StartOptions } options - Indicates the start options. 618 * @param { AsyncCallback<void> } callback - The callback of startAbility. 619 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 620 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 621 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 622 * 2. Incorrect parameter types; 3. Parameter verification failed. 623 * @throws { BusinessError } 16000001 - The specified ability does not exist. 624 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 625 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 626 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 627 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 628 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 629 * @throws { BusinessError } 16000011 - The context does not exist. 630 * @throws { BusinessError } 16000012 - The application is controlled. 631 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 632 * @throws { BusinessError } 16000050 - Internal error. 633 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 634 * @throws { BusinessError } 16000055 - Installation-free timed out. 635 * @throws { BusinessError } 16200001 - The caller has been released. 636 * @syscap SystemCapability.Ability.AbilityRuntime.Core 637 * @systemapi 638 * @stagemodelonly 639 * @since 10 640 */ 641 /** 642 * Service extension start an ability using the original caller information. If the caller application is in 643 * foreground, you can use this method to start ability; If the caller application is in the background, 644 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 645 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 646 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 647 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 648 * 649 * @param { Want } want - Indicates the ability to start. 650 * @param { StartOptions } options - Indicates the start options. 651 * @param { AsyncCallback<void> } callback - The callback of startAbility. 652 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 653 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 654 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 655 * 2. Incorrect parameter types; 3. Parameter verification failed. 656 * @throws { BusinessError } 16000001 - The specified ability does not exist. 657 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 658 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 659 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 660 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 661 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 662 * @throws { BusinessError } 16000011 - The context does not exist. 663 * @throws { BusinessError } 16000012 - The application is controlled. 664 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 665 * @throws { BusinessError } 16000050 - Internal error. 666 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 667 * @throws { BusinessError } 16000055 - Installation-free timed out. 668 * @throws { BusinessError } 16200001 - The caller has been released. 669 * @throws { BusinessError } 16000073 - The app clone index is invalid. 670 * @syscap SystemCapability.Ability.AbilityRuntime.Core 671 * @systemapi 672 * @stagemodelonly 673 * @since 12 674 */ 675 /** 676 * Service extension start an ability using the original caller information. If the caller application is in 677 * foreground, you can use this method to start ability; If the caller application is in the background, 678 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 679 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 680 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 681 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 682 * 683 * @param { Want } want - Indicates the ability to start. 684 * @param { StartOptions } options - Indicates the start options. 685 * @param { AsyncCallback<void> } callback - The callback of startAbility. 686 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 687 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 688 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 689 * 2. Incorrect parameter types; 3. Parameter verification failed. 690 * @throws { BusinessError } 16000001 - The specified ability does not exist. 691 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 692 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 693 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 694 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 695 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 696 * @throws { BusinessError } 16000011 - The context does not exist. 697 * @throws { BusinessError } 16000012 - The application is controlled. 698 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 699 * @throws { BusinessError } 16000050 - Internal error. 700 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 701 * @throws { BusinessError } 16000055 - Installation-free timed out. 702 * @throws { BusinessError } 16000071 - App clone is not supported. 703 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 704 * @throws { BusinessError } 16000073 - The app clone index is invalid. 705 * @throws { BusinessError } 16000076 - The app instance key is invalid. 706 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 707 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 708 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 709 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 710 * @throws { BusinessError } 16200001 - The caller has been released. 711 * @syscap SystemCapability.Ability.AbilityRuntime.Core 712 * @systemapi 713 * @stagemodelonly 714 * @since 14 715 */ 716 startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; 717 718 /** 719 * Service extension start an ability using the original caller information. If the caller application is in 720 * foreground, you can use this method to start ability; If the caller application is in the background, 721 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 722 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 723 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 724 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 725 * 726 * @param { Want } want - Indicates the ability to start. 727 * @param { StartOptions } options - Indicates the start options. 728 * @returns { Promise<void> } The promise returned by the function. 729 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 730 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 731 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 732 * 2. Incorrect parameter types; 3. Parameter verification failed. 733 * @throws { BusinessError } 16000001 - The specified ability does not exist. 734 * @throws { BusinessError } 16000002 - Incorrect ability type. 735 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 736 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 737 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 738 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 739 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 740 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 741 * @throws { BusinessError } 16000011 - The context does not exist. 742 * @throws { BusinessError } 16000012 - The application is controlled. 743 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 744 * @throws { BusinessError } 16000050 - Internal error. 745 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 746 * @throws { BusinessError } 16000055 - Installation-free timed out. 747 * @throws { BusinessError } 16200001 - The caller has been released. 748 * @syscap SystemCapability.Ability.AbilityRuntime.Core 749 * @systemapi 750 * @stagemodelonly 751 * @since 10 752 */ 753 /** 754 * Service extension start an ability using the original caller information. If the caller application is in 755 * foreground, you can use this method to start ability; If the caller application is in the background, 756 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 757 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 758 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 759 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 760 * 761 * @param { Want } want - Indicates the ability to start. 762 * @param { StartOptions } options - Indicates the start options. 763 * @returns { Promise<void> } The promise returned by the function. 764 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 765 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 766 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 767 * 2. Incorrect parameter types; 3. Parameter verification failed. 768 * @throws { BusinessError } 16000001 - The specified ability does not exist. 769 * @throws { BusinessError } 16000002 - Incorrect ability type. 770 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 771 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 772 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 773 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 774 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 775 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 776 * @throws { BusinessError } 16000011 - The context does not exist. 777 * @throws { BusinessError } 16000012 - The application is controlled. 778 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 779 * @throws { BusinessError } 16000050 - Internal error. 780 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 781 * @throws { BusinessError } 16000055 - Installation-free timed out. 782 * @throws { BusinessError } 16200001 - The caller has been released. 783 * @throws { BusinessError } 16000073 - The app clone index is invalid. 784 * @syscap SystemCapability.Ability.AbilityRuntime.Core 785 * @systemapi 786 * @stagemodelonly 787 * @since 12 788 */ 789 /** 790 * Service extension start an ability using the original caller information. If the caller application is in 791 * foreground, you can use this method to start ability; If the caller application is in the background, 792 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 793 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 794 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 795 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 796 * 797 * @param { Want } want - Indicates the ability to start. 798 * @param { StartOptions } options - Indicates the start options. 799 * @returns { Promise<void> } The promise returned by the function. 800 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 801 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 802 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 803 * 2. Incorrect parameter types; 3. Parameter verification failed. 804 * @throws { BusinessError } 16000001 - The specified ability does not exist. 805 * @throws { BusinessError } 16000002 - Incorrect ability type. 806 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 807 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 808 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 809 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 810 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 811 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 812 * @throws { BusinessError } 16000011 - The context does not exist. 813 * @throws { BusinessError } 16000012 - The application is controlled. 814 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 815 * @throws { BusinessError } 16000050 - Internal error. 816 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 817 * @throws { BusinessError } 16000055 - Installation-free timed out. 818 * @throws { BusinessError } 16000071 - App clone is not supported. 819 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 820 * @throws { BusinessError } 16000073 - The app clone index is invalid. 821 * @throws { BusinessError } 16000076 - The app instance key is invalid. 822 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 823 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 824 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 825 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 826 * @throws { BusinessError } 16200001 - The caller has been released. 827 * @syscap SystemCapability.Ability.AbilityRuntime.Core 828 * @systemapi 829 * @stagemodelonly 830 * @since 14 831 */ 832 startAbilityAsCaller(want: Want, options?: StartOptions): Promise<void>; 833 834 /** 835 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 836 * you can use this method to start ability; If the caller application is in the background, 837 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 838 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 839 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 840 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 841 * 842 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 843 * @param { Want } want - Indicates the ability to start. 844 * @param { number } accountId - Indicates the accountId to start. 845 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 846 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 847 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 848 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 849 * 2. Incorrect parameter types; 3. Parameter verification failed. 850 * @throws { BusinessError } 16000001 - The specified ability does not exist. 851 * @throws { BusinessError } 16000002 - Incorrect ability type. 852 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 853 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 854 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 855 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 856 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 857 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 858 * @throws { BusinessError } 16000011 - The context does not exist. 859 * @throws { BusinessError } 16000012 - The application is controlled. 860 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 861 * @throws { BusinessError } 16000050 - Internal error. 862 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 863 * @throws { BusinessError } 16000055 - Installation-free timed out. 864 * @throws { BusinessError } 16200001 - The caller has been released. 865 * @syscap SystemCapability.Ability.AbilityRuntime.Core 866 * @systemapi 867 * @stagemodelonly 868 * @since 9 869 */ 870 /** 871 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 872 * you can use this method to start ability; If the caller application is in the background, 873 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 874 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 875 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 876 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 877 * 878 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 879 * @param { Want } want - Indicates the ability to start. 880 * @param { number } accountId - Indicates the accountId to start. 881 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 882 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 883 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 884 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 885 * 2. Incorrect parameter types; 3. Parameter verification failed. 886 * @throws { BusinessError } 16000001 - The specified ability does not exist. 887 * @throws { BusinessError } 16000002 - Incorrect ability type. 888 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 889 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 890 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 891 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 892 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 893 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 894 * @throws { BusinessError } 16000011 - The context does not exist. 895 * @throws { BusinessError } 16000012 - The application is controlled. 896 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 897 * @throws { BusinessError } 16000019 - No matching ability is found. 898 * @throws { BusinessError } 16000050 - Internal error. 899 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 900 * @throws { BusinessError } 16000055 - Installation-free timed out. 901 * @throws { BusinessError } 16200001 - The caller has been released. 902 * @throws { BusinessError } 16000073 - The app clone index is invalid. 903 * @syscap SystemCapability.Ability.AbilityRuntime.Core 904 * @systemapi 905 * @stagemodelonly 906 * @since 12 907 */ 908 /** 909 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 910 * you can use this method to start ability; If the caller application is in the background, 911 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 912 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 913 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 914 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 915 * 916 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 917 * @param { Want } want - Indicates the ability to start. 918 * @param { number } accountId - Indicates the accountId to start. 919 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 920 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 921 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 922 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 923 * 2. Incorrect parameter types; 3. Parameter verification failed. 924 * @throws { BusinessError } 16000001 - The specified ability does not exist. 925 * @throws { BusinessError } 16000002 - Incorrect ability type. 926 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 927 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 928 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 929 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 930 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 931 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 932 * @throws { BusinessError } 16000011 - The context does not exist. 933 * @throws { BusinessError } 16000012 - The application is controlled. 934 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 935 * @throws { BusinessError } 16000019 - No matching ability is found. 936 * @throws { BusinessError } 16000050 - Internal error. 937 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 938 * @throws { BusinessError } 16000055 - Installation-free timed out. 939 * @throws { BusinessError } 16000071 - App clone is not supported. 940 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 941 * @throws { BusinessError } 16000073 - The app clone index is invalid. 942 * @throws { BusinessError } 16000076 - The app instance key is invalid. 943 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 944 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 945 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 946 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 947 * @throws { BusinessError } 16200001 - The caller has been released. 948 * @syscap SystemCapability.Ability.AbilityRuntime.Core 949 * @systemapi 950 * @stagemodelonly 951 * @since 14 952 */ 953 startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void; 954 955 /** 956 * Service extension uses this method to start a specific ability with account. 957 * 958 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 959 * @param { Want } want - Indicates the ability to start. 960 * @param { number } accountId - Indicates the accountId to start. 961 * @param { StartOptions } options - Indicates the start options. 962 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 963 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 964 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 965 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 966 * 2. Incorrect parameter types; 3. Parameter verification failed. 967 * @throws { BusinessError } 16000001 - The specified ability does not exist. 968 * @throws { BusinessError } 16000002 - Incorrect ability type. 969 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 970 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 971 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 972 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 973 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 974 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 975 * @throws { BusinessError } 16000011 - The context does not exist. 976 * @throws { BusinessError } 16000050 - Internal error. 977 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 978 * @throws { BusinessError } 16000055 - Installation-free timed out. 979 * @throws { BusinessError } 16200001 - The caller has been released. 980 * @syscap SystemCapability.Ability.AbilityRuntime.Core 981 * @systemapi 982 * @stagemodelonly 983 * @since 9 984 */ 985 /** 986 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 987 * you can use this method to start ability; If the caller application is in the background, 988 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 989 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 990 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 991 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 992 * 993 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 994 * @param { Want } want - Indicates the ability to start. 995 * @param { number } accountId - Indicates the accountId to start. 996 * @param { StartOptions } options - Indicates the start options. 997 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 998 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 999 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1000 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1001 * 2. Incorrect parameter types; 3. Parameter verification failed. 1002 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1003 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1004 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1005 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1006 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1007 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1008 * @throws { BusinessError } 16000011 - The context does not exist. 1009 * @throws { BusinessError } 16000012 - The application is controlled. 1010 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1011 * @throws { BusinessError } 16000050 - Internal error. 1012 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1013 * @throws { BusinessError } 16000055 - Installation-free timed out. 1014 * @throws { BusinessError } 16200001 - The caller has been released. 1015 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1016 * @systemapi 1017 * @stagemodelonly 1018 * @since 10 1019 */ 1020 /** 1021 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 1022 * you can use this method to start ability; If the caller application is in the background, 1023 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1024 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1025 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1026 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1027 * 1028 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1029 * @param { Want } want - Indicates the ability to start. 1030 * @param { number } accountId - Indicates the accountId to start. 1031 * @param { StartOptions } options - Indicates the start options. 1032 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1033 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1034 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1035 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1036 * 2. Incorrect parameter types; 3. Parameter verification failed. 1037 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1038 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1039 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1040 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1041 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1042 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1043 * @throws { BusinessError } 16000011 - The context does not exist. 1044 * @throws { BusinessError } 16000012 - The application is controlled. 1045 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1046 * @throws { BusinessError } 16000019 - No matching ability is found. 1047 * @throws { BusinessError } 16000050 - Internal error. 1048 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1049 * @throws { BusinessError } 16000055 - Installation-free timed out. 1050 * @throws { BusinessError } 16200001 - The caller has been released. 1051 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1052 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1053 * @systemapi 1054 * @stagemodelonly 1055 * @since 12 1056 */ 1057 /** 1058 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 1059 * you can use this method to start ability; If the caller application is in the background, 1060 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1061 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1062 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1063 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1064 * 1065 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1066 * @param { Want } want - Indicates the ability to start. 1067 * @param { number } accountId - Indicates the accountId to start. 1068 * @param { StartOptions } options - Indicates the start options. 1069 * @param { AsyncCallback<void> } callback - The callback of startAbilityWithAccount. 1070 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1071 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1072 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1073 * 2. Incorrect parameter types; 3. Parameter verification failed. 1074 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1075 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1076 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1077 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1078 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1079 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1080 * @throws { BusinessError } 16000011 - The context does not exist. 1081 * @throws { BusinessError } 16000012 - The application is controlled. 1082 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1083 * @throws { BusinessError } 16000019 - No matching ability is found. 1084 * @throws { BusinessError } 16000050 - Internal error. 1085 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1086 * @throws { BusinessError } 16000055 - Installation-free timed out. 1087 * @throws { BusinessError } 16000071 - App clone is not supported. 1088 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1089 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1090 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1091 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1092 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1093 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1094 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1095 * @throws { BusinessError } 16200001 - The caller has been released. 1096 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1097 * @systemapi 1098 * @stagemodelonly 1099 * @since 14 1100 */ 1101 startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>): void; 1102 1103 /** 1104 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 1105 * you can use this method to start ability; If the caller application is in the background, 1106 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1107 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1108 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1109 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1110 * 1111 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1112 * @param { Want } want - Indicates the ability to start. 1113 * @param { number } accountId - Indicates the accountId to start. 1114 * @param { StartOptions } [options] - Indicates the start options. 1115 * @returns { Promise<void> } The promise returned by the function. 1116 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1117 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1118 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1119 * 2. Incorrect parameter types; 3. Parameter verification failed. 1120 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1121 * @throws { BusinessError } 16000002 - Incorrect ability type. 1122 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1123 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1124 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1125 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1126 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1127 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1128 * @throws { BusinessError } 16000011 - The context does not exist. 1129 * @throws { BusinessError } 16000012 - The application is controlled. 1130 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1131 * @throws { BusinessError } 16000050 - Internal error. 1132 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1133 * @throws { BusinessError } 16000055 - Installation-free timed out. 1134 * @throws { BusinessError } 16200001 - The caller has been released. 1135 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1136 * @systemapi 1137 * @stagemodelonly 1138 * @since 9 1139 */ 1140 /** 1141 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 1142 * you can use this method to start ability; If the caller application is in the background, 1143 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1144 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1145 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1146 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1147 * 1148 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1149 * @param { Want } want - Indicates the ability to start. 1150 * @param { number } accountId - Indicates the accountId to start. 1151 * @param { StartOptions } [options] - Indicates the start options. 1152 * @returns { Promise<void> } The promise returned by the function. 1153 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1154 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1155 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1156 * 2. Incorrect parameter types; 3. Parameter verification failed. 1157 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1158 * @throws { BusinessError } 16000002 - Incorrect ability type. 1159 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1160 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1161 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1162 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1163 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1164 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1165 * @throws { BusinessError } 16000011 - The context does not exist. 1166 * @throws { BusinessError } 16000012 - The application is controlled. 1167 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1168 * @throws { BusinessError } 16000019 - No matching ability is found. 1169 * @throws { BusinessError } 16000050 - Internal error. 1170 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1171 * @throws { BusinessError } 16000055 - Installation-free timed out. 1172 * @throws { BusinessError } 16200001 - The caller has been released. 1173 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1174 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1175 * @systemapi 1176 * @stagemodelonly 1177 * @since 12 1178 */ 1179 /** 1180 * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, 1181 * you can use this method to start ability; If the caller application is in the background, 1182 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 1183 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 1184 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 1185 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1186 * 1187 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1188 * @param { Want } want - Indicates the ability to start. 1189 * @param { number } accountId - Indicates the accountId to start. 1190 * @param { StartOptions } [options] - Indicates the start options. 1191 * @returns { Promise<void> } The promise returned by the function. 1192 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1193 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1194 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1195 * 2. Incorrect parameter types; 3. Parameter verification failed. 1196 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1197 * @throws { BusinessError } 16000002 - Incorrect ability type. 1198 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1199 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1200 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1201 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1202 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1203 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 1204 * @throws { BusinessError } 16000011 - The context does not exist. 1205 * @throws { BusinessError } 16000012 - The application is controlled. 1206 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1207 * @throws { BusinessError } 16000019 - No matching ability is found. 1208 * @throws { BusinessError } 16000050 - Internal error. 1209 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1210 * @throws { BusinessError } 16000055 - Installation-free timed out. 1211 * @throws { BusinessError } 16000071 - App clone is not supported. 1212 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 1213 * @throws { BusinessError } 16000073 - The app clone index is invalid. 1214 * @throws { BusinessError } 16000076 - The app instance key is invalid. 1215 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 1216 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 1217 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 1218 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 1219 * @throws { BusinessError } 16200001 - The caller has been released. 1220 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1221 * @systemapi 1222 * @stagemodelonly 1223 * @since 14 1224 */ 1225 startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise<void>; 1226 1227 /** 1228 * Starts a new service extension ability. 1229 * 1230 * @param { Want } want - Indicates the want info to start. 1231 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbility. 1232 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1233 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1234 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1235 * 2. Incorrect parameter types; 3. Parameter verification failed. 1236 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1237 * @throws { BusinessError } 16000002 - Incorrect ability type. 1238 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1239 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1240 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1241 * @throws { BusinessError } 16000011 - The context does not exist. 1242 * @throws { BusinessError } 16000050 - Internal error. 1243 * @throws { BusinessError } 16200001 - The caller has been released. 1244 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1245 * @systemapi 1246 * @stagemodelonly 1247 * @since 9 1248 */ 1249 /** 1250 * Starts a new service extension ability. 1251 * If the target service extension ability is visible, you can start the target service extension ability; 1252 * If the target service extension ability is invisible, 1253 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1254 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1255 * 1256 * @param { Want } want - Indicates the want info to start. 1257 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbility. 1258 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1259 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1260 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1261 * 2. Incorrect parameter types; 3. Parameter verification failed. 1262 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1263 * @throws { BusinessError } 16000002 - Incorrect ability type. 1264 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1265 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1266 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1267 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1268 * @throws { BusinessError } 16000011 - The context does not exist. 1269 * @throws { BusinessError } 16000012 - The application is controlled. 1270 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1271 * @throws { BusinessError } 16000050 - Internal error. 1272 * @throws { BusinessError } 16200001 - The caller has been released. 1273 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1274 * @systemapi 1275 * @stagemodelonly 1276 * @since 10 1277 */ 1278 /** 1279 * Starts a new service extension ability. 1280 * If the target service extension ability is visible, you can start the target service extension ability; 1281 * If the target service extension ability is invisible, 1282 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1283 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1284 * 1285 * @param { Want } want - Indicates the want info to start. 1286 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbility. 1287 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1288 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1289 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1290 * 2. Incorrect parameter types; 3. Parameter verification failed. 1291 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1292 * @throws { BusinessError } 16000002 - Incorrect ability type. 1293 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1294 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1295 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1296 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1297 * @throws { BusinessError } 16000011 - The context does not exist. 1298 * @throws { BusinessError } 16000012 - The application is controlled. 1299 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1300 * @throws { BusinessError } 16000019 - No matching ability is found. 1301 * @throws { BusinessError } 16000050 - Internal error. 1302 * @throws { BusinessError } 16200001 - The caller has been released. 1303 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1304 * @systemapi 1305 * @stagemodelonly 1306 * @since arkts {'1.1':'12', '1.2':'20'} 1307 * @arkts 1.1&1.2 1308 */ 1309 startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void; 1310 1311 /** 1312 * Starts a new service extension ability. 1313 * 1314 * @param { Want } want - Indicates the want info to start. 1315 * @returns { Promise<void> } The promise returned by the function. 1316 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1317 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1318 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1319 * 2. Incorrect parameter types; 3. Parameter verification failed. 1320 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1321 * @throws { BusinessError } 16000002 - Incorrect ability type. 1322 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1323 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1324 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1325 * @throws { BusinessError } 16000011 - The context does not exist. 1326 * @throws { BusinessError } 16000050 - Internal error. 1327 * @throws { BusinessError } 16200001 - The caller has been released. 1328 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1329 * @systemapi 1330 * @stagemodelonly 1331 * @since 9 1332 */ 1333 /** 1334 * Starts a new service extension ability. 1335 * If the target service extension ability is visible, you can start the target service extension ability; 1336 * If the target service extension ability is invisible, 1337 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1338 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1339 * 1340 * @param { Want } want - Indicates the want info to start. 1341 * @returns { Promise<void> } The promise returned by the function. 1342 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1343 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1344 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1345 * 2. Incorrect parameter types; 3. Parameter verification failed. 1346 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1347 * @throws { BusinessError } 16000002 - Incorrect ability type. 1348 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1349 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1350 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1351 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1352 * @throws { BusinessError } 16000011 - The context does not exist. 1353 * @throws { BusinessError } 16000012 - The application is controlled. 1354 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1355 * @throws { BusinessError } 16000050 - Internal error. 1356 * @throws { BusinessError } 16200001 - The caller has been released. 1357 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1358 * @systemapi 1359 * @stagemodelonly 1360 * @since 10 1361 */ 1362 /** 1363 * Starts a new service extension ability. 1364 * If the target service extension ability is visible, you can start the target service extension ability; 1365 * If the target service extension ability is invisible, 1366 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1367 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1368 * 1369 * @param { Want } want - Indicates the want info to start. 1370 * @returns { Promise<void> } The promise returned by the function. 1371 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1372 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1373 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1374 * 2. Incorrect parameter types; 3. Parameter verification failed. 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 } 16000019 - No matching ability is found. 1385 * @throws { BusinessError } 16000050 - Internal error. 1386 * @throws { BusinessError } 16200001 - The caller has been released. 1387 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1388 * @systemapi 1389 * @stagemodelonly 1390 * @since arkts {'1.1':'12', '1.2':'20'} 1391 * @arkts 1.1&1.2 1392 */ 1393 startServiceExtensionAbility(want: Want): Promise<void>; 1394 1395 /** 1396 * Starts a new service extension ability with account. 1397 * 1398 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1399 * @param { Want } want - Indicates the want info to start. 1400 * @param { number } accountId - Indicates the account to start. 1401 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbilityWithAccount. 1402 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1403 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1404 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1405 * 2. Incorrect parameter types; 3. Parameter verification failed. 1406 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1407 * @throws { BusinessError } 16000002 - Incorrect ability type. 1408 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1409 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1410 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1411 * @throws { BusinessError } 16000011 - The context does not exist. 1412 * @throws { BusinessError } 16000050 - Internal error. 1413 * @throws { BusinessError } 16200001 - The caller has been released. 1414 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1415 * @systemapi 1416 * @stagemodelonly 1417 * @since 9 1418 */ 1419 /** 1420 * Starts a new service extension ability with account. 1421 * If the target service extension ability is visible, you can start the target service extension ability; 1422 * If the target service extension ability is invisible, 1423 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1424 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1425 * 1426 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1427 * @param { Want } want - Indicates the want info to start. 1428 * @param { number } accountId - Indicates the account to start. 1429 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbilityWithAccount. 1430 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1431 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1432 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1433 * 2. Incorrect parameter types; 3. Parameter verification failed. 1434 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1435 * @throws { BusinessError } 16000002 - Incorrect ability type. 1436 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1437 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1438 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1439 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1440 * @throws { BusinessError } 16000011 - The context does not exist. 1441 * @throws { BusinessError } 16000012 - The application is controlled. 1442 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1443 * @throws { BusinessError } 16000050 - Internal error. 1444 * @throws { BusinessError } 16200001 - The caller has been released. 1445 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1446 * @systemapi 1447 * @stagemodelonly 1448 * @since 10 1449 */ 1450 /** 1451 * Starts a new service extension ability with account. 1452 * If the target service extension ability is visible, you can start the target service extension ability; 1453 * If the target service extension ability is invisible, 1454 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1455 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1456 * 1457 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1458 * @param { Want } want - Indicates the want info to start. 1459 * @param { number } accountId - Indicates the account to start. 1460 * @param { AsyncCallback<void> } callback - The callback of startServiceExtensionAbilityWithAccount. 1461 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1462 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1463 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1464 * 2. Incorrect parameter types; 3. Parameter verification failed. 1465 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1466 * @throws { BusinessError } 16000002 - Incorrect ability type. 1467 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1468 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1469 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1470 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1471 * @throws { BusinessError } 16000011 - The context does not exist. 1472 * @throws { BusinessError } 16000012 - The application is controlled. 1473 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1474 * @throws { BusinessError } 16000019 - No matching ability is found. 1475 * @throws { BusinessError } 16000050 - Internal error. 1476 * @throws { BusinessError } 16200001 - The caller has been released. 1477 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1478 * @systemapi 1479 * @stagemodelonly 1480 * @since 12 1481 */ 1482 startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void; 1483 1484 /** 1485 * Starts a new service extension ability with account. 1486 * 1487 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1488 * @param { Want } want - Indicates the want info to start. 1489 * @param { number } accountId - Indicates the account to start. 1490 * @returns { Promise<void> } The promise returned by the function. 1491 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1492 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1493 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1494 * 2. Incorrect parameter types; 3. Parameter verification failed. 1495 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1496 * @throws { BusinessError } 16000002 - Incorrect ability type. 1497 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1498 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1499 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1500 * @throws { BusinessError } 16000011 - The context does not exist. 1501 * @throws { BusinessError } 16000050 - Internal error. 1502 * @throws { BusinessError } 16200001 - The caller has been released. 1503 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1504 * @systemapi 1505 * @stagemodelonly 1506 * @since 9 1507 */ 1508 /** 1509 * Starts a new service extension ability with account. 1510 * If the target service extension ability is visible, you can start the target service extension ability; 1511 * If the target service extension ability is invisible, 1512 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1513 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1514 * 1515 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1516 * @param { Want } want - Indicates the want info to start. 1517 * @param { number } accountId - Indicates the account to start. 1518 * @returns { Promise<void> } The promise returned by the function. 1519 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1520 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1521 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1522 * 2. Incorrect parameter types; 3. Parameter verification failed. 1523 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1524 * @throws { BusinessError } 16000002 - Incorrect ability type. 1525 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1526 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1527 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1528 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1529 * @throws { BusinessError } 16000011 - The context does not exist. 1530 * @throws { BusinessError } 16000012 - The application is controlled. 1531 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1532 * @throws { BusinessError } 16000050 - Internal error. 1533 * @throws { BusinessError } 16200001 - The caller has been released. 1534 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1535 * @systemapi 1536 * @stagemodelonly 1537 * @since 10 1538 */ 1539 /** 1540 * Starts a new service extension ability with account. 1541 * If the target service extension ability is visible, you can start the target service extension ability; 1542 * If the target service extension ability is invisible, 1543 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. 1544 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1545 * 1546 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1547 * @param { Want } want - Indicates the want info to start. 1548 * @param { number } accountId - Indicates the account to start. 1549 * @returns { Promise<void> } The promise returned by the function. 1550 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1551 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1552 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1553 * 2. Incorrect parameter types; 3. Parameter verification failed. 1554 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1555 * @throws { BusinessError } 16000002 - Incorrect ability type. 1556 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1557 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1558 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1559 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1560 * @throws { BusinessError } 16000011 - The context does not exist. 1561 * @throws { BusinessError } 16000012 - The application is controlled. 1562 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 1563 * @throws { BusinessError } 16000019 - No matching ability is found. 1564 * @throws { BusinessError } 16000050 - Internal error. 1565 * @throws { BusinessError } 16200001 - The caller has been released. 1566 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1567 * @systemapi 1568 * @stagemodelonly 1569 * @since 12 1570 */ 1571 startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void>; 1572 1573 /** 1574 * Stops a service within the same application. 1575 * 1576 * @param { Want } want - Indicates the want info to start. 1577 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbility. 1578 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1579 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1580 * 2. Incorrect parameter types; 3. Parameter verification failed. 1581 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1582 * @throws { BusinessError } 16000002 - Incorrect ability type. 1583 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1584 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1585 * @throws { BusinessError } 16000011 - The context does not exist. 1586 * @throws { BusinessError } 16000050 - Internal error. 1587 * @throws { BusinessError } 16200001 - The caller has been released. 1588 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1589 * @systemapi 1590 * @stagemodelonly 1591 * @since 9 1592 */ 1593 /** 1594 * Stops other service extension ability. 1595 * If the target service extension ability is visible, you can stop the target service extension ability; 1596 * If the target service extension ability is invisible, 1597 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 1598 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1599 * 1600 * @param { Want } want - Indicates the want info to start. 1601 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbility. 1602 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1603 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1604 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1605 * 2. Incorrect parameter types; 3. Parameter verification failed. 1606 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1607 * @throws { BusinessError } 16000002 - Incorrect ability type. 1608 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1609 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1610 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1611 * @throws { BusinessError } 16000011 - The context does not exist. 1612 * @throws { BusinessError } 16000050 - Internal error. 1613 * @throws { BusinessError } 16200001 - The caller has been released. 1614 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1615 * @systemapi 1616 * @stagemodelonly 1617 * @since 10 1618 */ 1619 stopServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void; 1620 1621 /** 1622 * Stops a service within the same application. 1623 * 1624 * @param { Want } want - Indicates the want info to start. 1625 * @returns { Promise<void> } The promise returned by the function. 1626 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1627 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1628 * 2. Incorrect parameter types; 3. Parameter verification failed. 1629 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1630 * @throws { BusinessError } 16000002 - Incorrect ability type. 1631 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1632 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1633 * @throws { BusinessError } 16000011 - The context does not exist. 1634 * @throws { BusinessError } 16000050 - Internal error. 1635 * @throws { BusinessError } 16200001 - The caller has been released. 1636 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1637 * @systemapi 1638 * @stagemodelonly 1639 * @since 9 1640 */ 1641 /** 1642 * Stops other service extension ability. 1643 * If the target service extension ability is visible, you can stop the target service extension ability; 1644 * If the target service extension ability is invisible, 1645 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 1646 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1647 * 1648 * @param { Want } want - Indicates the want info to start. 1649 * @returns { Promise<void> } The promise returned by the function. 1650 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1651 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1652 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1653 * 2. Incorrect parameter types; 3. Parameter verification failed. 1654 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1655 * @throws { BusinessError } 16000002 - Incorrect ability type. 1656 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1657 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1658 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1659 * @throws { BusinessError } 16000011 - The context does not exist. 1660 * @throws { BusinessError } 16000050 - Internal error. 1661 * @throws { BusinessError } 16200001 - The caller has been released. 1662 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1663 * @systemapi 1664 * @stagemodelonly 1665 * @since 10 1666 */ 1667 stopServiceExtensionAbility(want: Want): Promise<void>; 1668 1669 /** 1670 * Stops a service within the same application with account. 1671 * 1672 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1673 * @param { Want } want - Indicates the want info to start. 1674 * @param { number } accountId - Indicates the accountId to start. 1675 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbilityWithAccount. 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; 1679 * 2. Incorrect parameter types; 3. Parameter verification failed. 1680 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1681 * @throws { BusinessError } 16000002 - Incorrect ability type. 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 } 16000011 - The context does not exist. 1685 * @throws { BusinessError } 16000050 - Internal error. 1686 * @throws { BusinessError } 16200001 - The caller has been released. 1687 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1688 * @systemapi 1689 * @stagemodelonly 1690 * @since 9 1691 */ 1692 /** 1693 * Stops other service extension ability with account. 1694 * If the target service extension ability is visible, you can stop the target service extension ability; 1695 * If the target service extension ability is invisible, 1696 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 1697 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1698 * 1699 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1700 * @param { Want } want - Indicates the want info to start. 1701 * @param { number } accountId - Indicates the accountId to start. 1702 * @param { AsyncCallback<void> } callback - The callback of stopServiceExtensionAbilityWithAccount. 1703 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1704 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1705 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1706 * 2. Incorrect parameter types; 3. Parameter verification failed. 1707 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1708 * @throws { BusinessError } 16000002 - Incorrect ability type. 1709 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1710 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1711 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1712 * @throws { BusinessError } 16000011 - The context does not exist. 1713 * @throws { BusinessError } 16000050 - Internal error. 1714 * @throws { BusinessError } 16200001 - The caller has been released. 1715 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1716 * @systemapi 1717 * @stagemodelonly 1718 * @since 10 1719 */ 1720 stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>): void; 1721 1722 /** 1723 * Stops a service within the same application with account. 1724 * 1725 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1726 * @param { Want } want - Indicates the want info to start. 1727 * @param { number } accountId - Indicates the accountId to start. 1728 * @returns { Promise<void> } The promise returned by the function. 1729 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1730 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1731 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1732 * 2. Incorrect parameter types; 3. Parameter verification failed. 1733 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1734 * @throws { BusinessError } 16000002 - Incorrect ability type. 1735 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1736 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1737 * @throws { BusinessError } 16000011 - The context does not exist. 1738 * @throws { BusinessError } 16000050 - Internal error. 1739 * @throws { BusinessError } 16200001 - The caller has been released. 1740 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1741 * @systemapi 1742 * @stagemodelonly 1743 * @since 9 1744 */ 1745 /** 1746 * Stops other service extension ability with account. 1747 * If the target service extension ability is visible, you can stop the target service extension ability; 1748 * If the target service extension ability is invisible, 1749 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. 1750 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1751 * 1752 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1753 * @param { Want } want - Indicates the want info to start. 1754 * @param { number } accountId - Indicates the accountId to start. 1755 * @returns { Promise<void> } The promise returned by the function. 1756 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1757 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1758 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1759 * 2. Incorrect parameter types; 3. Parameter verification failed. 1760 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1761 * @throws { BusinessError } 16000002 - Incorrect ability type. 1762 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1763 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1764 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1765 * @throws { BusinessError } 16000011 - The context does not exist. 1766 * @throws { BusinessError } 16000050 - Internal error. 1767 * @throws { BusinessError } 16200001 - The caller has been released. 1768 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1769 * @systemapi 1770 * @stagemodelonly 1771 * @since 10 1772 */ 1773 stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise<void>; 1774 1775 /** 1776 * Destroys this service extension. 1777 * 1778 * @param { AsyncCallback<void> } callback - The callback of terminateSelf. 1779 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1780 * 2. Incorrect parameter types; 3. Parameter verification failed. 1781 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1782 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1783 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1784 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1785 * @throws { BusinessError } 16000011 - The context does not exist. 1786 * @throws { BusinessError } 16000050 - Internal error. 1787 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1788 * @systemapi 1789 * @stagemodelonly 1790 * @since 9 1791 */ 1792 /** 1793 * Destroys this service extension. 1794 * 1795 * @param { AsyncCallback<void> } callback - The callback of terminateSelf. 1796 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1797 * 2. Incorrect parameter types; 3. Parameter verification failed. 1798 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1799 * @throws { BusinessError } 16000011 - The context does not exist. 1800 * @throws { BusinessError } 16000050 - Internal error. 1801 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1802 * @systemapi 1803 * @stagemodelonly 1804 * @since arkts {'1.1':'10', '1.2':'20'} 1805 * @arkts 1.1&1.2 1806 */ 1807 terminateSelf(callback: AsyncCallback<void>): void; 1808 1809 /** 1810 * Destroys this service extension. 1811 * 1812 * @returns { Promise<void> } The promise returned by the function. 1813 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1814 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1815 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1816 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1817 * @throws { BusinessError } 16000011 - The context does not exist. 1818 * @throws { BusinessError } 16000050 - Internal error. 1819 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1820 * @systemapi 1821 * @stagemodelonly 1822 * @since 9 1823 */ 1824 /** 1825 * Destroys this service extension. 1826 * 1827 * @returns { Promise<void> } The promise returned by the function. 1828 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 1829 * @throws { BusinessError } 16000011 - The context does not exist. 1830 * @throws { BusinessError } 16000050 - Internal error. 1831 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1832 * @systemapi 1833 * @stagemodelonly 1834 * @since arkts {'1.1':'10', '1.2':'20'} 1835 * @arkts 1.1&1.2 1836 */ 1837 terminateSelf(): Promise<void>; 1838 1839 /** 1840 * Connects an ability to a Service extension. 1841 * <p>This method can be called by an ability or service extension, but the destination of the connection must be a 1842 * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target 1843 * service extension when the Service extension is connected.</p> 1844 * 1845 * @param { Want } want - Indicates the service extension to connect. 1846 * @param { ConnectOptions } options - Indicates the callback of connection. 1847 * @returns { number } Returns the connection id. 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; 1850 * 2. Incorrect parameter types; 3. Parameter verification failed. 1851 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1852 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1853 * @throws { BusinessError } 16000011 - The context does not exist. 1854 * @throws { BusinessError } 16000050 - Internal error. 1855 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1856 * @systemapi 1857 * @stagemodelonly 1858 * @since 9 1859 */ 1860 /** 1861 * Connects an ability to a service extension ability. 1862 * If the target service extension ability is visible, you can connect the target service extension ability; 1863 * If the target service extension ability is invisible, 1864 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible service extension ability. 1865 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1866 * <p>This method can be called by an ability or service extension, but the destination of the connection must be a 1867 * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target 1868 * service extension when the Service extension is connected.</p> 1869 * 1870 * @param { Want } want - Indicates the service extension to connect. 1871 * @param { ConnectOptions } options - Indicates the callback of connection. 1872 * @returns { number } Returns the connection id. 1873 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1874 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1875 * 2. Incorrect parameter types; 3. Parameter verification failed. 1876 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1877 * @throws { BusinessError } 16000002 - Incorrect ability type. 1878 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1879 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1880 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1881 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1882 * @throws { BusinessError } 16000011 - The context does not exist. 1883 * @throws { BusinessError } 16000050 - Internal error. 1884 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1885 * @throws { BusinessError } 16000055 - Installation-free timed out. 1886 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1887 * @systemapi 1888 * @stagemodelonly 1889 * @since 10 1890 */ 1891 connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; 1892 1893 /** 1894 * Connects an ability to a Service extension with account. 1895 * <p>This method can be called by an ability or service extension, but the destination of the connection must be a 1896 * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target 1897 * service extension when the Service extension is connected.</p> 1898 * 1899 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1900 * @param { Want } want - Indicates the service extension to connect. 1901 * @param { number } accountId - Indicates the account to connect. 1902 * @param { ConnectOptions } options - Indicates the callback of connection. 1903 * @returns { number } Returns the connection id. 1904 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1905 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1906 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1907 * 2. Incorrect parameter types; 3. Parameter verification failed. 1908 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1909 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1910 * @throws { BusinessError } 16000011 - The context does not exist. 1911 * @throws { BusinessError } 16000050 - Internal error. 1912 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1913 * @systemapi 1914 * @stagemodelonly 1915 * @since 9 1916 */ 1917 /** 1918 * Connects an ability to a service extension ability with account. 1919 * If the target service extension ability is visible, you can connect the target service extension ability; 1920 * If the target service extension ability is invisible, 1921 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible service extension ability. 1922 * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 1923 * <p>This method can be called by an ability or service extension, but the destination of the connection must be a 1924 * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target 1925 * service extension when the Service extension is connected.</p> 1926 * 1927 * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 1928 * @param { Want } want - Indicates the service extension to connect. 1929 * @param { number } accountId - Indicates the account to connect. 1930 * @param { ConnectOptions } options - Indicates the callback of connection. 1931 * @returns { number } Returns the connection id. 1932 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1933 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 1934 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1935 * 2. Incorrect parameter types; 3. Parameter verification failed. 1936 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1937 * @throws { BusinessError } 16000002 - Incorrect ability type. 1938 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1939 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1940 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1941 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 1942 * @throws { BusinessError } 16000011 - The context does not exist. 1943 * @throws { BusinessError } 16000050 - Internal error. 1944 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 1945 * @throws { BusinessError } 16000055 - Installation-free timed out. 1946 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1947 * @systemapi 1948 * @stagemodelonly 1949 * @since 10 1950 */ 1951 connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; 1952 1953 /** 1954 * Disconnect an ability from a service extension, in contrast to {@link connectAbility}. 1955 * 1956 * @param { number } connection - the connection id returned from connectAbility api. 1957 * @param { AsyncCallback<void> } callback - The callback of disconnectAbility. 1958 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1959 * 2. Incorrect parameter types; 3. Parameter verification failed. 1960 * @throws { BusinessError } 16000011 - The context does not exist. 1961 * @throws { BusinessError } 16000050 - Internal error. 1962 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1963 * @systemapi 1964 * @stagemodelonly 1965 * @since 9 1966 */ 1967 disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback<void>): void; 1968 1969 /** 1970 * Disconnect an ability from a service extension, in contrast to {@link connectAbility}. 1971 * 1972 * @param { number } connection - the connection id returned from connectAbility api. 1973 * @returns { Promise<void> } The promise returned by the function. 1974 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1975 * 2. Incorrect parameter types; 3. Parameter verification failed. 1976 * @throws { BusinessError } 16000011 - The context does not exist. 1977 * @throws { BusinessError } 16000050 - Internal error. 1978 * @syscap SystemCapability.Ability.AbilityRuntime.Core 1979 * @systemapi 1980 * @stagemodelonly 1981 * @since 9 1982 */ 1983 disconnectServiceExtensionAbility(connection: number): Promise<void>; 1984 1985 /** 1986 * Get the caller object of the startup capability. 1987 * 1988 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 1989 * @param { Want } want - Indicates the ability to start. 1990 * @returns { Promise<Caller> } Returns the Caller interface. 1991 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 1992 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1993 * 2. Incorrect parameter types; 3. Parameter verification failed. 1994 * @throws { BusinessError } 16000001 - The specified ability does not exist. 1995 * @throws { BusinessError } 16000002 - Incorrect ability type. 1996 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 1997 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 1998 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 1999 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2000 * @throws { BusinessError } 16000011 - The context does not exist. 2001 * @throws { BusinessError } 16000050 - Internal error. 2002 * @throws { BusinessError } 16200001 - The caller has been released. 2003 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2004 * @systemapi 2005 * @stagemodelonly 2006 * @since 9 2007 */ 2008 /** 2009 * Get the caller object of the startup capability. 2010 * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION to use this method. 2011 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2012 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2013 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2014 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2015 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2016 * 2017 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 2018 * @param { Want } want - Indicates the ability to start. 2019 * @returns { Promise<Caller> } Returns the Caller interface. 2020 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2021 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2022 * 2. Incorrect parameter types; 3. Parameter verification failed. 2023 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2024 * @throws { BusinessError } 16000002 - Incorrect ability type. 2025 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2026 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2027 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2028 * @throws { BusinessError } 16000011 - The context does not exist. 2029 * @throws { BusinessError } 16000050 - Internal error. 2030 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2031 * @systemapi 2032 * @stagemodelonly 2033 * @since 10 2034 */ 2035 startAbilityByCall(want: Want): Promise<Caller>; 2036 2037 /** 2038 * Get the caller object that specifies the accountId startup capability 2039 * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION 2040 * and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS to use this method. 2041 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2042 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2043 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2044 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2045 * 2046 * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 2047 * @param { Want } want - Indicates the ability to start. 2048 * @param { number } accountId - Indicates the account to start. 2049 * @returns { Promise<Caller> } Returns the Caller interface. 2050 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2051 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2052 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2053 * 2. Incorrect parameter types; 3. Parameter verification failed. 2054 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2055 * @throws { BusinessError } 16000002 - Incorrect ability type. 2056 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2057 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2058 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2059 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2060 * @throws { BusinessError } 16000011 - The context does not exist. 2061 * @throws { BusinessError } 16000012 - The application is controlled. 2062 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2063 * @throws { BusinessError } 16000050 - Internal error. 2064 * @throws { BusinessError } 16200001 - The caller has been released. 2065 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2066 * @systemapi 2067 * @stagemodelonly 2068 * @since 10 2069 */ 2070 startAbilityByCallWithAccount(want: Want, accountId: number): Promise<Caller>; 2071 2072 /** 2073 * Service extension uses this method to start a specific ability, 2074 * if ability is multi instance, will start a recent instance. 2075 * 2076 * @param { Want } want - Indicates the ability to start. 2077 * @param { AsyncCallback<void> } callback - The callback of startAbility. 2078 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2079 * 2. Incorrect parameter types; 3. Parameter verification failed. 2080 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2081 * @throws { BusinessError } 16000002 - Incorrect ability type. 2082 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2083 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2084 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2085 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2086 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2087 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2088 * @throws { BusinessError } 16000011 - The context does not exist. 2089 * @throws { BusinessError } 16000050 - Internal error. 2090 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2091 * @throws { BusinessError } 16000055 - Installation-free timed out. 2092 * @throws { BusinessError } 16200001 - The caller has been released. 2093 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2094 * @systemapi 2095 * @stagemodelonly 2096 * @since 9 2097 */ 2098 /** 2099 * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. 2100 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2101 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2102 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2103 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2104 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2105 * 2106 * @param { Want } want - Indicates the ability to start. 2107 * @param { AsyncCallback<void> } callback - The callback of startAbility. 2108 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2109 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2110 * 2. Incorrect parameter types; 3. Parameter verification failed. 2111 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2112 * @throws { BusinessError } 16000002 - Incorrect ability type. 2113 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2114 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2115 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2116 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2117 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2118 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2119 * @throws { BusinessError } 16000011 - The context does not exist. 2120 * @throws { BusinessError } 16000050 - Internal error. 2121 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2122 * @throws { BusinessError } 16000055 - Installation-free timed out. 2123 * @throws { BusinessError } 16200001 - The caller has been released. 2124 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2125 * @systemapi 2126 * @stagemodelonly 2127 * @since 10 2128 */ 2129 /** 2130 * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. 2131 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2132 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2133 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2134 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2135 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2136 * 2137 * @param { Want } want - Indicates the ability to start. 2138 * @param { AsyncCallback<void> } callback - The callback of startAbility. 2139 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2140 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2141 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2142 * 2. Incorrect parameter types; 3. Parameter verification failed. 2143 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2144 * @throws { BusinessError } 16000002 - Incorrect ability type. 2145 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2146 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2147 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2148 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2149 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2150 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2151 * @throws { BusinessError } 16000011 - The context does not exist. 2152 * @throws { BusinessError } 16000050 - Internal error. 2153 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2154 * @throws { BusinessError } 16000055 - Installation-free timed out. 2155 * @throws { BusinessError } 16000071 - App clone is not supported. 2156 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2157 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2158 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2159 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2160 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2161 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2162 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2163 * @throws { BusinessError } 16200001 - The caller has been released. 2164 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2165 * @systemapi 2166 * @stagemodelonly 2167 * @since 14 2168 */ 2169 startRecentAbility(want: Want, callback: AsyncCallback<void>): void; 2170 2171 /** 2172 * Service extension uses this method to start a specific ability, 2173 * if ability is multi instance, will start a recent instance. 2174 * 2175 * @param { Want } want - Indicates the ability to start. 2176 * @param { StartOptions } options - Indicates the start options. 2177 * @param { AsyncCallback<void> } callback - The callback of startAbility. 2178 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2179 * 2. Incorrect parameter types; 3. Parameter verification failed. 2180 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2181 * @throws { BusinessError } 16000002 - Incorrect ability type. 2182 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2183 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2184 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2185 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2186 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2187 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2188 * @throws { BusinessError } 16000011 - The context does not exist. 2189 * @throws { BusinessError } 16000050 - Internal error. 2190 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2191 * @throws { BusinessError } 16000055 - Installation-free timed out. 2192 * @throws { BusinessError } 16200001 - The caller has been released. 2193 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2194 * @systemapi 2195 * @stagemodelonly 2196 * @since 9 2197 */ 2198 /** 2199 * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. 2200 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2201 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2202 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2203 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2204 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2205 * 2206 * @param { Want } want - Indicates the ability to start. 2207 * @param { StartOptions } options - Indicates the start options. 2208 * @param { AsyncCallback<void> } callback - The callback of startAbility. 2209 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2210 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2211 * 2. Incorrect parameter types; 3. Parameter verification failed. 2212 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2213 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2214 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2215 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2216 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2217 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2218 * @throws { BusinessError } 16000011 - The context does not exist. 2219 * @throws { BusinessError } 16000050 - Internal error. 2220 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2221 * @throws { BusinessError } 16000055 - Installation-free timed out. 2222 * @throws { BusinessError } 16200001 - The caller has been released. 2223 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2224 * @systemapi 2225 * @stagemodelonly 2226 * @since 10 2227 */ 2228 /** 2229 * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. 2230 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2231 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2232 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2233 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2234 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2235 * 2236 * @param { Want } want - Indicates the ability to start. 2237 * @param { StartOptions } options - Indicates the start options. 2238 * @param { AsyncCallback<void> } callback - The callback of startAbility. 2239 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2240 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2241 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2242 * 2. Incorrect parameter types; 3. Parameter verification failed. 2243 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2244 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2245 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2246 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2247 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2248 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2249 * @throws { BusinessError } 16000011 - The context does not exist. 2250 * @throws { BusinessError } 16000050 - Internal error. 2251 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2252 * @throws { BusinessError } 16000055 - Installation-free timed out. 2253 * @throws { BusinessError } 16000071 - App clone is not supported. 2254 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2255 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2256 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2257 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2258 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2259 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2260 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2261 * @throws { BusinessError } 16200001 - The caller has been released. 2262 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2263 * @systemapi 2264 * @stagemodelonly 2265 * @since 14 2266 */ 2267 startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; 2268 2269 /** 2270 * Service extension uses this method to start a specific ability, 2271 * if ability is multi instance, will start a recent instance. 2272 * 2273 * @param { Want } want - Indicates the ability to start. 2274 * @param { StartOptions } [options] - Indicates the start options. 2275 * @returns { Promise<void> } The promise returned by the function. 2276 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2277 * 2. Incorrect parameter types; 3. Parameter verification failed. 2278 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2279 * @throws { BusinessError } 16000002 - Incorrect ability type. 2280 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2281 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2282 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2283 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2284 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2285 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2286 * @throws { BusinessError } 16000011 - The context does not exist. 2287 * @throws { BusinessError } 16000050 - Internal error. 2288 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2289 * @throws { BusinessError } 16000055 - Installation-free timed out. 2290 * @throws { BusinessError } 16200001 - The caller has been released. 2291 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2292 * @systemapi 2293 * @stagemodelonly 2294 * @since 9 2295 */ 2296 /** 2297 * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. 2298 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2299 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2300 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2301 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2302 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2303 * 2304 * @param { Want } want - Indicates the ability to start. 2305 * @param { StartOptions } [options] - Indicates the start options. 2306 * @returns { Promise<void> } The promise returned by the function. 2307 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2308 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2309 * 2. Incorrect parameter types; 3. Parameter verification failed. 2310 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2311 * @throws { BusinessError } 16000002 - Incorrect ability type. 2312 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2313 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2314 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2315 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2316 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2317 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2318 * @throws { BusinessError } 16000011 - The context does not exist. 2319 * @throws { BusinessError } 16000050 - Internal error. 2320 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2321 * @throws { BusinessError } 16000055 - Installation-free timed out. 2322 * @throws { BusinessError } 16200001 - The caller has been released. 2323 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2324 * @systemapi 2325 * @stagemodelonly 2326 * @since 10 2327 */ 2328 /** 2329 * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. 2330 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2331 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2332 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2333 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2334 * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. 2335 * 2336 * @param { Want } want - Indicates the ability to start. 2337 * @param { StartOptions } [options] - Indicates the start options. 2338 * @returns { Promise<void> } The promise returned by the function. 2339 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2340 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2341 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2342 * 2. Incorrect parameter types; 3. Parameter verification failed. 2343 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2344 * @throws { BusinessError } 16000002 - Incorrect ability type. 2345 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2346 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2347 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2348 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2349 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2350 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 2351 * @throws { BusinessError } 16000011 - The context does not exist. 2352 * @throws { BusinessError } 16000050 - Internal error. 2353 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 2354 * @throws { BusinessError } 16000055 - Installation-free timed out. 2355 * @throws { BusinessError } 16000071 - App clone is not supported. 2356 * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 2357 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2358 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2359 * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. 2360 * @throws { BusinessError } 16000078 - The multi-instance is not supported. 2361 * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. 2362 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2363 * @throws { BusinessError } 16200001 - The caller has been released. 2364 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2365 * @systemapi 2366 * @stagemodelonly 2367 * @since 14 2368 */ 2369 startRecentAbility(want: Want, options?: StartOptions): Promise<void>; 2370 2371 /** 2372 * Requests the Modal UIExtensionAbility. 2373 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 2374 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 2375 * 2376 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 2377 * @param { AsyncCallback<void> } callback - The callback of requestModalUIExtension. 2378 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2379 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2380 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2381 * 2. Incorrect parameter types; 3. Parameter verification failed. 2382 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2383 * @throws { BusinessError } 16000002 - Incorrect ability type. 2384 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2385 * @throws { BusinessError } 16000050 - Internal error. 2386 * @throws { BusinessError } 16200001 - The caller has been released. 2387 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2388 * @systemapi 2389 * @stagemodelonly 2390 * @since 11 2391 */ 2392 /** 2393 * Requests the specified foreground application to start the UIExtensionAbility of the corresponding type. The foreground 2394 * application is specified by bundleName in want.parameters. If bundleName is left unspecified, or if the application 2395 * specified by bundleName is not running in the foreground or does not exist, the UIExtensionAbility is directly started 2396 * on the system interface. The UIExtensionAbility to start is determined by the combination of the bundleName, abilityName, 2397 * and moduleName fields in want, and its type is determined by the ability.want.params.uiExtensionType field in want.parameters. 2398 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 2399 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 2400 * 2401 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 2402 * @param { AsyncCallback<void> } callback - The callback of requestModalUIExtension. 2403 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2404 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2405 * 2. Incorrect parameter types; 3. Parameter verification failed. 2406 * @throws { BusinessError } 16000050 - Internal error. 2407 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2408 * @systemapi 2409 * @stagemodelonly 2410 * @since 12 2411 */ 2412 requestModalUIExtension(pickerWant: Want, callback: AsyncCallback<void>): void; 2413 2414 /** 2415 * Requests the Modal UIExtensionAbility. 2416 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 2417 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 2418 * 2419 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 2420 * @returns { Promise<void> } The promise returned by the requestModalUIExtension. 2421 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2422 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2423 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2424 * 2. Incorrect parameter types; 3. Parameter verification failed. 2425 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2426 * @throws { BusinessError } 16000002 - Incorrect ability type. 2427 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2428 * @throws { BusinessError } 16000050 - Internal error. 2429 * @throws { BusinessError } 16200001 - The caller has been released. 2430 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2431 * @systemapi 2432 * @stagemodelonly 2433 * @since 11 2434 */ 2435 /** 2436 * Requests the specified foreground application to start the UIExtensionAbility of the corresponding type. The foreground 2437 * application is specified by bundleName in want.parameters. If bundleName is left unspecified, or if the application 2438 * specified by bundleName is not running in the foreground or does not exist, the UIExtensionAbility is directly started 2439 * on the system interface. The UIExtensionAbility to start is determined by the combination of the bundleName, abilityName, 2440 * and moduleName fields in want, and its type is determined by the ability.want.params.uiExtensionType field in want.parameters. 2441 * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, 2442 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. 2443 * 2444 * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. 2445 * @returns { Promise<void> } The promise returned by the requestModalUIExtension. 2446 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2447 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2448 * 2. Incorrect parameter types; 3. Parameter verification failed. 2449 * @throws { BusinessError } 16000050 - Internal error. 2450 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2451 * @systemapi 2452 * @stagemodelonly 2453 * @since 12 2454 */ 2455 requestModalUIExtension(pickerWant: Want): Promise<void>; 2456 2457 /** 2458 * preStartMission opens an atomic service window without popping up a loading window 2459 * 2460 * @permission ohos.permission.PRE_START_ATOMIC_SERVICE 2461 * @param { string } bundleName - The bundle name of the atomic service. 2462 * @param { string } moduleName - The module name of the atomic service. 2463 * @param { string } abilityName - The ability name of the atomic service. 2464 * @param { string } startTime - The start time of the atomic service. 2465 * @returns { Promise<void> } The promise returned by the function. 2466 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2467 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2468 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2469 * 2. Incorrect parameter types; 3. Parameter verification failed. 2470 * @throws { BusinessError } 16300007 - The target free-installation task does not exist. 2471 * @throws { BusinessError } 16000011 - The context does not exist. 2472 * @throws { BusinessError } 16000050 - Internal error. 2473 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2474 * @systemapi 2475 * @stagemodelonly 2476 * @since 12 2477 */ 2478 preStartMission(bundleName: string, moduleName: string, abilityName: string, startTime: string): Promise<void>; 2479 2480 /** 2481 * Starts a UI service extension ability. 2482 * If the target UI service extension ability is visible, you can start the target UI service extension ability; 2483 * If the target UI service extension ability is invisible, 2484 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UI service extension ability. 2485 * 2486 * @param { Want } want - Indicates the want info to start. 2487 * @returns { Promise<void> } The promise returned by the function. 2488 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2489 * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. 2490 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2491 * 2. Incorrect parameter types; 3. Parameter verification failed. 2492 * @throws { BusinessError } 801 - Capability not supported. 2493 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2494 * @throws { BusinessError } 16000002 - Incorrect ability type. 2495 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2496 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2497 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2498 * @throws { BusinessError } 16000011 - The context does not exist. 2499 * @throws { BusinessError } 16000012 - The application is controlled. 2500 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 2501 * @throws { BusinessError } 16000019 - No matching ability is found. 2502 * @throws { BusinessError } 16000050 - Internal error. 2503 * @throws { BusinessError } 16200001 - The caller has been released. 2504 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2505 * @systemapi 2506 * @stagemodelonly 2507 * @since 14 2508 */ 2509 startUIServiceExtensionAbility(want: Want): Promise<void>; 2510 2511 /** 2512 * Full-screen pop-up startup atomic service. 2513 * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, 2514 * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. 2515 * If the target ability is visible, you can start the target ability; If the target ability is invisible, 2516 * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2517 * 2518 * @param { string } appId - Globally unique identifier of an application, which is allocated by the cloud. 2519 * @param { AtomicServiceOptions } [options] - Indicates the atomic service start options. 2520 * @returns { Promise<void> } The promise returned by the function. 2521 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2522 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. 2523 * @throws { BusinessError } 16000002 - Incorrect ability type. 2524 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 2525 * @throws { BusinessError } 16000011 - The context does not exist. 2526 * @throws { BusinessError } 16000012 - The application is controlled. 2527 * @throws { BusinessError } 16000050 - Internal error. 2528 * @throws { BusinessError } 16200001 - The caller has been released. 2529 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2530 * @systemapi 2531 * @stagemodelonly 2532 * @since 18 2533 */ 2534 openAtomicService(appId: string, options?: AtomicServiceOptions): Promise<void>; 2535 2536 /** 2537 * Starts multi UIAbility simultaneously. If the caller application is in foreground, you can use 2538 * this method to start abilities; If the caller application is in the background, you need to apply 2539 * for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. If the target ability is visible, 2540 * you can start the target ability; If the target ability is invisible,you need to apply for 2541 * permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. 2542 * 2543 * @param { Array<Want> } wantList - Indicates the want info list to start. 2544 * @returns { Promise<void> } The promise returned by the function. 2545 * @throws { BusinessError } 201 - The application does not have permission to call the interface. 2546 * @throws { BusinessError } 202 - Not system application. 2547 * @throws { BusinessError } 801 - Capability not supported. 2548 * @throws { BusinessError } 16000001 - The specified ability does not exist. 2549 * @throws { BusinessError } 16000004 - Failed to start the invisible ability. 2550 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 2551 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 2552 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 2553 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 2554 * @throws { BusinessError } 16000011 - The context does not exist. 2555 * @throws { BusinessError } 16000050 - Internal error. 2556 * @throws { BusinessError } 16200001 - The caller has been released. 2557 * @throws { BusinessError } 16000073 - The app clone index is invalid. 2558 * @throws { BusinessError } 16000076 - The app instance key is invalid. 2559 * @throws { BusinessError } 16000080 - Creating a new instance is not supported. 2560 * @throws { BusinessError } 16000120 - A maximum of four UIAbility instances can be started simultaneously. 2561 * The current parameter exceeds the maximum number or is less than 1. 2562 * @throws { BusinessError } 16000121 - The target component type is not a UIAbility. 2563 * @throws { BusinessError } 16000122 - The target component is blocked by the system module and 2564 * does not support startup. 2565 * @throws { BusinessError } 16000123 - Implicit startup is not supported. 2566 * @throws { BusinessError } 16000124 - Starting a remote UIAbility is not supported. 2567 * @throws { BusinessError } 16000125 - Starting a plugin UIAbility is not supported. 2568 * @throws { BusinessError } 16000126 - Starting DLP files is not supported. 2569 * @syscap SystemCapability.Ability.AbilityRuntime.Core 2570 * @systemapi 2571 * @stagemodelonly 2572 * @since 20 2573 */ 2574 startUIAbilities(wantList: Array<Want>): Promise<void>; 2575} 2576 2577export default ServiceExtensionContext;