2023-05-06 06:59:50 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021-2023 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.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
2024-01-08 07:25:39 +00:00
|
|
|
* @kit AbilityKit
|
2023-12-11 09:08:03 +00:00
|
|
|
*/
|
|
|
|
|
2023-05-06 06:59:50 +00:00
|
|
|
import { AsyncCallback } from './@ohos.base';
|
|
|
|
import { Configuration } from './@ohos.application.Configuration';
|
|
|
|
import { AbilityRunningInfo } from './application/AbilityRunningInfo';
|
|
|
|
import { ExtensionRunningInfo } from './application/ExtensionRunningInfo';
|
|
|
|
import { ElementName } from './bundle/elementName';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The class of an ability manager.
|
|
|
|
*
|
|
|
|
* @namespace abilityManager
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
|
|
|
declare namespace abilityManager {
|
|
|
|
/**
|
2023-05-18 01:11:57 +00:00
|
|
|
* Status information for the Ability.
|
|
|
|
*
|
2023-05-06 06:59:50 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager#AbilityState
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
|
|
|
export enum AbilityState {
|
2023-05-18 01:11:57 +00:00
|
|
|
/**
|
|
|
|
* Indicates that the ability is initial.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager.AbilityState#INITIAL
|
2023-05-18 01:11:57 +00:00
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
INITIAL = 0,
|
2023-05-18 01:11:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates that the ability is foreground.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager.AbilityState#FOREGROUND
|
2023-05-18 01:11:57 +00:00
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
FOREGROUND = 9,
|
2023-05-18 01:11:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates that the ability is background.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager.AbilityState#BACKGROUND
|
2023-05-18 01:11:57 +00:00
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
BACKGROUND = 10,
|
2023-05-18 01:11:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates that the ability is foregrounding.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager.AbilityState#FOREGROUNDING
|
2023-05-18 01:11:57 +00:00
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
FOREGROUNDING = 11,
|
2023-05-18 01:11:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates that the ability is backgrounding.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager.AbilityState#BACKGROUNDING
|
2023-05-18 01:11:57 +00:00
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
BACKGROUNDING = 12
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the configuration by modifying the configuration.
|
|
|
|
*
|
|
|
|
* @permission ohos.permission.UPDATE_CONFIGURATION
|
2023-06-15 12:02:15 +00:00
|
|
|
* @param { Configuration } config - Indicates the new configuration.
|
|
|
|
* @param { AsyncCallback<void> } callback - The specified callback method.
|
2023-05-06 06:59:50 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager#updateConfiguration
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
|
|
|
function updateConfiguration(config: Configuration, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the configuration by modifying the configuration.
|
|
|
|
*
|
|
|
|
* @permission ohos.permission.UPDATE_CONFIGURATION
|
2023-06-15 12:02:15 +00:00
|
|
|
* @param { Configuration } config - Indicates the new configuration.
|
2023-05-06 06:59:50 +00:00
|
|
|
* @returns { Promise<void> } The promise returned by the function.
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager#updateConfiguration
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
|
|
|
function updateConfiguration(config: Configuration): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about running abilities
|
|
|
|
*
|
|
|
|
* @permission ohos.permission.GET_RUNNING_INFO
|
|
|
|
* @returns { Promise<Array<AbilityRunningInfo>> } Returns the array of {@link AbilityRunningInfo}.
|
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager#getAbilityRunningInfos
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
|
|
|
function getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get information about running abilities
|
|
|
|
*
|
|
|
|
* @permission ohos.permission.GET_RUNNING_INFO
|
2023-06-15 12:02:15 +00:00
|
|
|
* @param { AsyncCallback<Array<AbilityRunningInfo>> } callback - The specified callback method.
|
2023-05-06 06:59:50 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-05-26 02:24:08 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager/abilityManager#getAbilityRunningInfos
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
|
|
|
function getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default abilityManager;
|