/* * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file * @kit AbilityKit */ import { AsyncCallback } from '../@ohos.base'; import { ConnectOptions } from '../ability/connectOptions'; import { Caller } from '../@ohos.app.ability.UIAbility'; import ExtensionContext from './ExtensionContext'; import Want from '../@ohos.app.ability.Want'; import StartOptions from '../@ohos.app.ability.StartOptions'; import OpenLinkOptions from '../@ohos.app.ability.OpenLinkOptions'; import type AtomicServiceOptions from '../@ohos.app.ability.AtomicServiceOptions'; /** * The context of service extension. It allows access to * serviceExtension-specific resources. * * @extends ExtensionContext * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ export default class ServiceExtensionContext extends ExtensionContext { /** * Service extension uses this method to start a specific ability. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - Can not match any component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbility(want: Want, callback: AsyncCallback): void; /** * Service extension uses this method to start a specific ability. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - Can not match any component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; /** * Service extension uses this method to start a specific ability. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - Can not match any component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension uses this method to start a specific ability. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbility(want: Want, options?: StartOptions): Promise; /** * Service extension uses this method to start a specific ability by implicit want. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { string } link - Indicates the ability to start. * @param { OpenLinkOptions } [options] - Indicates the open link options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ openLink(link: string, options?: OpenLinkOptions): Promise; /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbilityAsCaller(want: Want, callback: AsyncCallback): void; /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback): void; /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension start an ability using the original caller information. If the caller application is in * foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbilityAsCaller(want: Want, options?: StartOptions): Promise; /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - Can not match any component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; /** * Service extension uses this method to start a specific ability with account. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - Can not match any component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - Can not match any component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ /** * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, * you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the accountId to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** * Starts a new service extension ability. * * @param { Want } want - Indicates the want info to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Starts a new service extension ability. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the want info to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Starts a new service extension ability. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the want info to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; /** * Starts a new service extension ability. * * @param { Want } want - Indicates the want info to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Starts a new service extension ability. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the want info to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Starts a new service extension ability. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the want info to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ startServiceExtensionAbility(want: Want): Promise; /** * Starts a new service extension ability with account. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Starts a new service extension ability with account. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Starts a new service extension ability with account. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; /** * Starts a new service extension ability with account. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Starts a new service extension ability with account. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Starts a new service extension ability with account. * If the target service extension ability is visible, you can start the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Stops a service within the same application. * * @param { Want } want - Indicates the want info to start. * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Stops other service extension ability. * If the target service extension ability is visible, you can stop the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the want info to start. * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; /** * Stops a service within the same application. * * @param { Want } want - Indicates the want info to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Stops other service extension ability. * If the target service extension ability is visible, you can stop the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the want info to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ stopServiceExtensionAbility(want: Want): Promise; /** * Stops a service within the same application with account. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Stops other service extension ability with account. * If the target service extension ability is visible, you can stop the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; /** * Stops a service within the same application with account. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Stops other service extension ability with account. * If the target service extension ability is visible, you can stop the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Destroys this service extension. * * @param { AsyncCallback } callback - The callback of terminateSelf. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Destroys this service extension. * * @param { AsyncCallback } callback - The callback of terminateSelf. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ terminateSelf(callback: AsyncCallback): void; /** * Destroys this service extension. * * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Destroys this service extension. * * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ terminateSelf(): Promise; /** * Connects an ability to a Service extension. *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

* * @param { Want } want - Indicates the service extension to connect. * @param { ConnectOptions } options - Indicates the callback of connection. * @returns { number } Returns the connection id. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Connects an ability to a service extension ability. * If the target service extension ability is visible, you can connect the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

* * @param { Want } want - Indicates the service extension to connect. * @param { ConnectOptions } options - Indicates the callback of connection. * @returns { number } Returns the connection id. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; /** * Connects an ability to a Service extension with account. *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

* * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the service extension to connect. * @param { number } accountId - Indicates the account to connect. * @param { ConnectOptions } options - Indicates the callback of connection. * @returns { number } Returns the connection id. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Connects an ability to a service extension ability with account. * If the target service extension ability is visible, you can connect the target service extension ability; * If the target service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to connect target invisible service extension ability. * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

* * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the service extension to connect. * @param { number } accountId - Indicates the account to connect. * @param { ConnectOptions } options - Indicates the callback of connection. * @returns { number } Returns the connection id. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** * Disconnect an ability from a service extension, in contrast to {@link connectAbility}. * * @param { number } connection - the connection id returned from connectAbility api. * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; /** * Disconnect an ability from a service extension, in contrast to {@link connectAbility}. * * @param { number } connection - the connection id returned from connectAbility api. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ disconnectServiceExtensionAbility(connection: number): Promise; /** * Get the caller object of the startup capability. * * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION * @param { Want } want - Indicates the ability to start. * @returns { Promise } Returns the Caller interface. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Get the caller object of the startup capability. * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION to use this method. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION * @param { Want } want - Indicates the ability to start. * @returns { Promise } Returns the Caller interface. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ startAbilityByCall(want: Want): Promise; /** * Get the caller object that specifies the accountId startup capability * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION * and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS to use this method. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the ability to start. * @param { number } accountId - Indicates the account to start. * @returns { Promise } Returns the Caller interface. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ startAbilityByCallWithAccount(want: Want, accountId: number): Promise; /** * Service extension uses this method to start a specific ability, * if ability is multi instance, will start a recent instance. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startRecentAbility(want: Want, callback: AsyncCallback): void; /** * Service extension uses this method to start a specific ability, * if ability is multi instance, will start a recent instance. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } options - Indicates the start options. * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; /** * Service extension uses this method to start a specific ability, * if ability is multi instance, will start a recent instance. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ /** * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 10 */ /** * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. * * @param { Want } want - Indicates the ability to start. * @param { StartOptions } [options] - Indicates the start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. * @throws { BusinessError } 16000071 - App clone is not supported. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. * @throws { BusinessError } 16000073 - The app clone index is invalid. * @throws { BusinessError } 16000076 - The app instance key is invalid. * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. * @throws { BusinessError } 16000078 - The multi-instance is not supported. * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. * @throws { BusinessError } 16000080 - Creating a new instance is not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startRecentAbility(want: Want, options?: StartOptions): Promise; /** * Requests the Modal UIExtensionAbility. * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. * * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. * @param { AsyncCallback } callback - The callback of requestModalUIExtension. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 11 */ /** * Requests the specified foreground application to start the UIExtensionAbility of the corresponding type. The foreground * application is specified by bundleName in want.parameters. If bundleName is left unspecified, or if the application * specified by bundleName is not running in the foreground or does not exist, the UIExtensionAbility is directly started * on the system interface. The UIExtensionAbility to start is determined by the combination of the bundleName, abilityName, * and moduleName fields in want, and its type is determined by the ability.want.params.uiExtensionType field in want.parameters. * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. * * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. * @param { AsyncCallback } callback - The callback of requestModalUIExtension. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ requestModalUIExtension(pickerWant: Want, callback: AsyncCallback): void; /** * Requests the Modal UIExtensionAbility. * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. * * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. * @returns { Promise } The promise returned by the requestModalUIExtension. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 11 */ /** * Requests the specified foreground application to start the UIExtensionAbility of the corresponding type. The foreground * application is specified by bundleName in want.parameters. If bundleName is left unspecified, or if the application * specified by bundleName is not running in the foreground or does not exist, the UIExtensionAbility is directly started * on the system interface. The UIExtensionAbility to start is determined by the combination of the bundleName, abilityName, * and moduleName fields in want, and its type is determined by the ability.want.params.uiExtensionType field in want.parameters. * If the target UIExtensionAbility is visible, you can start the target UIExtensionAbility; If the target UIExtensionAbility is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UIExtensionAbility. * * @param { Want } pickerWant - Indicates the UIExtensionAbility to start. * @returns { Promise } The promise returned by the requestModalUIExtension. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ requestModalUIExtension(pickerWant: Want): Promise; /** * preStartMission opens an atomic service window without popping up a loading window * * @permission ohos.permission.PRE_START_ATOMIC_SERVICE * @param { string } bundleName - The bundle name of the atomic service. * @param { string } moduleName - The module name of the atomic service. * @param { string } abilityName - The ability name of the atomic service. * @param { string } startTime - The start time of the atomic service. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16300007 - The target free install task does not exist. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 12 */ preStartMission(bundleName: string, moduleName: string, abilityName: string, startTime: string): Promise; /** * Starts a UI service extension ability. * If the target UI service extension ability is visible, you can start the target UI service extension ability; * If the target UI service extension ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible UI service extension ability. * * @param { Want } want - Indicates the want info to start. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The EDM prohibits the application from launching. * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 14 */ startUIServiceExtensionAbility(want: Want): Promise; /** * Full-screen pop-up startup atomic service. * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. * * @param { string } appId - Globally unique identifier of an application, which is allocated by the cloud. * @param { AtomicServiceOptions } [options] - Indicates the atomic service start options. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000002 - Incorrect ability type. * @throws { BusinessError } 16000004 - Can not start invisible component * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 18 */ openAtomicService(appId: string, options?: AtomicServiceOptions): Promise; }