2023-03-13 02:54:04 +00:00
|
|
|
/*
|
2024-03-12 09:19:36 +00:00
|
|
|
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
2023-03-13 02:54:04 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2024-03-09 07:34:47 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @kit AbilityKit
|
|
|
|
*/
|
|
|
|
|
2023-06-28 07:24:36 +00:00
|
|
|
import type { AbilityResult } from '../ability/abilityResult';
|
|
|
|
import type { AsyncCallback } from '../@ohos.base';
|
2023-07-05 08:17:36 +00:00
|
|
|
import type { ConnectOptions } from '../ability/connectOptions';
|
2023-03-13 02:54:04 +00:00
|
|
|
import ExtensionContext from './ExtensionContext';
|
2023-06-28 07:24:36 +00:00
|
|
|
import type Want from '../@ohos.app.ability.Want';
|
|
|
|
import type StartOptions from '../@ohos.app.ability.StartOptions';
|
2024-03-13 02:18:36 +00:00
|
|
|
import type AtomicServiceOptions from '../@ohos.app.ability.AtomicServiceOptions';
|
2024-02-22 13:35:36 +00:00
|
|
|
import OpenLinkOptions from '../@ohos.app.ability.OpenLinkOptions';
|
2023-03-13 02:54:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The context of UI extension. It allows access to UIExtension-specific resources.
|
|
|
|
*
|
|
|
|
* @extends ExtensionContext
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-03-13 02:54:04 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
export default class UIExtensionContext extends ExtensionContext {
|
2023-06-29 04:26:44 +00:00
|
|
|
/**
|
|
|
|
* UI 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<void> } callback - The callback of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-06-29 04:26:44 +00:00
|
|
|
* @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
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-06-29 04:26:44 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2024-04-16 09:27:18 +00:00
|
|
|
/**
|
|
|
|
* UI 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<void> } callback - The callback of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @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 } 16000018 - The application is not allow jumping to other applications.
|
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2024-06-03 12:40:41 +00:00
|
|
|
* @throws { BusinessError } 16000073 - The app clone index is invalid.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-06-29 04:26:44 +00:00
|
|
|
startAbility(want: Want, callback: AsyncCallback<void>): void;
|
2023-03-13 02:54:04 +00:00
|
|
|
|
2023-06-29 04:26:44 +00:00
|
|
|
/**
|
|
|
|
* UI 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<void> } callback - The callback of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-06-29 04:26:44 +00:00
|
|
|
* @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
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-06-29 04:26:44 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2024-04-16 09:27:18 +00:00
|
|
|
/**
|
|
|
|
* UI 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<void> } callback - The callback of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @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 } 16000018 - The application is not allow jumping to other applications.
|
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2024-06-03 12:40:41 +00:00
|
|
|
* @throws { BusinessError } 16000073 - The app clone index is invalid.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-06-29 04:26:44 +00:00
|
|
|
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
|
2023-03-13 02:54:04 +00:00
|
|
|
|
2023-06-29 04:26:44 +00:00
|
|
|
/**
|
|
|
|
* UI 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<void> } The promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-06-29 04:26:44 +00:00
|
|
|
* @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
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-06-29 04:26:44 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2024-04-16 09:27:18 +00:00
|
|
|
/**
|
|
|
|
* UI 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<void> } The promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @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 } 16000018 - The application is not allow jumping to other applications.
|
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2024-06-03 12:40:41 +00:00
|
|
|
* @throws { BusinessError } 16000073 - The app clone index is invalid.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-06-29 04:26:44 +00:00
|
|
|
startAbility(want: Want, options?: StartOptions): Promise<void>;
|
2023-03-13 02:54:04 +00:00
|
|
|
|
2024-02-22 13:35:36 +00:00
|
|
|
/**
|
|
|
|
* UI 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.
|
|
|
|
* @param { AsyncCallback<AbilityResult> } [callback] - The callback is used to return the ability result.
|
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-02-22 13:35:36 +00:00
|
|
|
* @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.
|
2024-04-18 02:03:06 +00:00
|
|
|
* @throws { BusinessError } 16000019 - Can not match any component.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
2024-02-22 13:35:36 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
2024-07-07 07:14:14 +00:00
|
|
|
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
|
2024-07-04 12:11:25 +00:00
|
|
|
* @throws { BusinessError } 16000054 - The installation-free service is busy.Try again later.
|
2024-02-22 13:35:36 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-04-18 02:03:06 +00:00
|
|
|
openLink(link: string, options?: OpenLinkOptions, callback?: AsyncCallback<AbilityResult>): Promise<void>;
|
2024-02-22 13:35:36 +00:00
|
|
|
|
2023-06-29 04:26:44 +00:00
|
|
|
/**
|
|
|
|
* Starts an ability and returns the execution result when the ability is destroyed.
|
|
|
|
* 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<AbilityResult> } callback - The callback is used to return the result of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-06-29 04:26:44 +00:00
|
|
|
* @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
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-06-29 04:26:44 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2024-04-16 09:27:18 +00:00
|
|
|
/**
|
|
|
|
* Starts an ability and returns the execution result when the ability is destroyed.
|
|
|
|
* 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<AbilityResult> } callback - The callback is used to return the result of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @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 } 16000018 - The application is not allow jumping to other applications.
|
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2024-06-03 12:40:41 +00:00
|
|
|
* @throws { BusinessError } 16000073 - The app clone index is invalid.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-06-29 04:26:44 +00:00
|
|
|
startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
|
2023-03-13 02:54:04 +00:00
|
|
|
|
2023-06-29 04:26:44 +00:00
|
|
|
/**
|
|
|
|
* Starts an ability and returns the execution result when the ability is destroyed.
|
|
|
|
* 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<AbilityResult> } callback - The callback is used to return the result of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-06-29 04:26:44 +00:00
|
|
|
* @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
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-06-29 04:26:44 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2024-04-16 09:27:18 +00:00
|
|
|
/**
|
|
|
|
* Starts an ability and returns the execution result when the ability is destroyed.
|
|
|
|
* 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<AbilityResult> } callback - The callback is used to return the result of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @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 } 16000018 - The application is not allow jumping to other applications.
|
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2024-06-03 12:40:41 +00:00
|
|
|
* @throws { BusinessError } 16000073 - The app clone index is invalid.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-06-29 04:26:44 +00:00
|
|
|
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
|
2023-03-13 02:54:04 +00:00
|
|
|
|
2023-06-29 04:26:44 +00:00
|
|
|
/**
|
|
|
|
* Starts an ability and returns the execution result when the ability is destroyed.
|
|
|
|
* 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<AbilityResult> } Returns the result of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-06-29 04:26:44 +00:00
|
|
|
* @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
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-06-29 04:26:44 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2024-04-16 09:27:18 +00:00
|
|
|
/**
|
|
|
|
* Starts an ability and returns the execution result when the ability is destroyed.
|
|
|
|
* 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<AbilityResult> } Returns the result of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @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 } 16000018 - The application is not allow jumping to other applications.
|
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2024-06-03 12:40:41 +00:00
|
|
|
* @throws { BusinessError } 16000073 - The app clone index is invalid.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
2024-04-16 09:27:18 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-06-29 04:26:44 +00:00
|
|
|
startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
|
2023-07-05 08:17:36 +00:00
|
|
|
|
2024-03-12 09:19:36 +00:00
|
|
|
/**
|
|
|
|
* Starts a new ability using the original caller information, and returns the execution result when the ability
|
|
|
|
* is destroyed.
|
|
|
|
* 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 { Want } want - Indicates the ability to start.
|
|
|
|
* @param { StartOptions } [options] - Indicates the start options.
|
|
|
|
* @returns { Promise<AbilityResult> } Returns the result of startAbility.
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
|
|
|
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-03-12 09:19:36 +00:00
|
|
|
* @throws { BusinessError } 16000001 - The specified ability does not exist.
|
|
|
|
* @throws { BusinessError } 16000004 - Can not start invisible component.
|
|
|
|
* @throws { BusinessError } 16000050 - Internal error.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2024-06-03 12:40:41 +00:00
|
|
|
* @throws { BusinessError } 16000073 - The app clone index is invalid.
|
2024-03-12 09:19:36 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
startAbilityForResultAsCaller(want: Want, options?: StartOptions): Promise<AbilityResult>;
|
|
|
|
|
2023-07-05 08:17:36 +00:00
|
|
|
/**
|
2024-06-15 09:31:39 +00:00
|
|
|
* Connects the current ability to an service extension ability.
|
2023-07-05 08:17:36 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @param { Want } want - The element name of the service ability
|
|
|
|
* @param { ConnectOptions } options - The remote object instance
|
|
|
|
* @returns { number } Returns the number code of the ability connected
|
|
|
|
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-07-05 08:17:36 +00:00
|
|
|
* @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.
|
2023-08-21 03:08:59 +00:00
|
|
|
* @throws { BusinessError } 16000011 - The context does not exist.
|
2023-07-05 08:17:36 +00:00
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000070 - The extension cannot start the service.
|
2023-07-05 08:17:36 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-07-05 08:17:36 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disconnect an ability from a service extension, in contrast to {@link connectAbility}.
|
|
|
|
*
|
|
|
|
* @param { number } connection - The number code of the ability connected
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback of disconnectAbility.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-08-21 03:08:59 +00:00
|
|
|
* @throws { BusinessError } 16000011 - The context does not exist.
|
2023-07-05 08:17:36 +00:00
|
|
|
* @throws { BusinessError } 16000050 - Internal error.
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-07-05 08:17:36 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disconnect an ability from a service extension, in contrast to {@link connectAbility}.
|
|
|
|
*
|
|
|
|
* @param { number } connection - The number code of the ability connected
|
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2023-08-21 03:08:59 +00:00
|
|
|
* @throws { BusinessError } 16000011 - The context does not exist.
|
2023-07-05 08:17:36 +00:00
|
|
|
* @throws { BusinessError } 16000050 - Internal error.
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-12 09:19:36 +00:00
|
|
|
* @stagemodelonly
|
2023-07-05 08:17:36 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
disconnectServiceExtensionAbility(connection: number): Promise<void>;
|
2024-02-21 01:30:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Report to system when the extension is drawn completed.
|
|
|
|
*
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback of startUIExtensionAbility.
|
|
|
|
* @throws { BusinessError } 16000011 - The context does not exist.
|
|
|
|
* @throws { BusinessError } 16000050 - Internal error.
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-13 06:47:30 +00:00
|
|
|
* @stagemodelonly
|
2024-02-21 01:30:31 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
reportDrawnCompleted(callback: AsyncCallback<void>): void;
|
2024-02-19 09:15:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the UI extension.
|
|
|
|
*
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback of terminateSelf.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-02-19 09:15:55 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-13 06:47:30 +00:00
|
|
|
* @stagemodelonly
|
2024-02-19 09:15:55 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
terminateSelf(callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the UI extension.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-13 06:47:30 +00:00
|
|
|
* @stagemodelonly
|
2024-02-19 09:15:55 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
terminateSelf(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the UI extension while returning the specified result code and data to the caller.
|
|
|
|
*
|
|
|
|
* @param { AbilityResult } parameter - Indicates the result to return.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback of terminateSelfWithResult.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-02-19 09:15:55 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-13 06:47:30 +00:00
|
|
|
* @stagemodelonly
|
2024-02-19 09:15:55 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the UI extension while returning the specified result code and data to the caller.
|
|
|
|
*
|
|
|
|
* @param { AbilityResult } parameter - Indicates the result to return.
|
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-02-19 09:15:55 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-13 06:47:30 +00:00
|
|
|
* @stagemodelonly
|
2024-02-19 09:15:55 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
|
2024-02-29 11:16:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Full-screen pop-us startup atomic service.
|
|
|
|
*
|
2024-04-01 03:11:37 +00:00
|
|
|
* @param { string } appId - Globally unique identifier of an application, which is allocated by the cloud.
|
2024-03-13 06:47:30 +00:00
|
|
|
* @param { AtomicServiceOptions } [options] - Indicates the atomic service start options.
|
2024-02-29 11:16:27 +00:00
|
|
|
* @returns { Promise<AbilityResult> } Returns the result of openAtomicService.
|
2024-06-01 06:59:37 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
|
2024-02-29 11:16:27 +00:00
|
|
|
* @throws { BusinessError } 16000002 - Incorrect ability type.
|
|
|
|
* @throws { BusinessError } 16000003 - The appId does not exist.
|
|
|
|
* @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.
|
2024-05-27 11:30:30 +00:00
|
|
|
* @throws { BusinessError } 16000069 - The extension cannot start the third party application.
|
2024-02-29 11:16:27 +00:00
|
|
|
* @throws { BusinessError } 16200001 - The caller has been released.
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2024-03-13 06:47:30 +00:00
|
|
|
* @stagemodelonly
|
2024-02-29 11:16:27 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
2024-03-13 06:47:30 +00:00
|
|
|
openAtomicService(appId: string, options?: AtomicServiceOptions): Promise<AbilityResult>;
|
2024-02-19 09:15:55 +00:00
|
|
|
}
|