2022-01-21 16:26:28 +00:00
|
|
|
/*
|
2022-03-07 08:23:08 +00:00
|
|
|
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
2022-01-21 16:26:28 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import { AsyncCallback } from './basic';
|
2022-02-08 13:11:33 +00:00
|
|
|
import { Configuration } from './@ohos.application.Configuration';
|
2022-12-24 09:07:10 +00:00
|
|
|
import { AbilityRunningInfo } from './application/AbilityRunningInfo';
|
|
|
|
import { ExtensionRunningInfo } from './application/ExtensionRunningInfo';
|
2022-04-24 06:03:33 +00:00
|
|
|
import { ElementName } from './bundle/elementName';
|
2022-01-21 16:26:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The class of an ability manager.
|
|
|
|
*
|
|
|
|
* @since 8
|
2022-03-01 11:50:02 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2022-08-06 06:51:55 +00:00
|
|
|
* @systemapi Hide this for inner system use
|
2022-01-21 16:26:28 +00:00
|
|
|
* @permission N/A
|
2022-09-19 08:22:54 +00:00
|
|
|
* @deprecated since 9
|
2022-10-17 11:30:40 +00:00
|
|
|
* @useinstead ohos.app.ability.abilityManager
|
2022-01-21 16:26:28 +00:00
|
|
|
*/
|
|
|
|
declare namespace abilityManager {
|
2022-02-08 13:11:33 +00:00
|
|
|
/**
|
|
|
|
* @name AbilityState
|
|
|
|
* @since 8
|
2022-03-01 11:50:02 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2022-03-16 11:23:05 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2022-02-08 13:11:33 +00:00
|
|
|
* @permission N/A
|
|
|
|
*/
|
|
|
|
export enum AbilityState {
|
|
|
|
INITIAL = 0,
|
|
|
|
FOREGROUND = 9,
|
|
|
|
BACKGROUND = 10,
|
|
|
|
FOREGROUNDING = 11,
|
|
|
|
BACKGROUNDING = 12
|
|
|
|
}
|
|
|
|
|
2022-01-21 16:26:28 +00:00
|
|
|
/**
|
|
|
|
* Updates the configuration by modifying the configuration.
|
|
|
|
*
|
|
|
|
* @since 8
|
2022-03-01 11:50:02 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2022-01-21 16:26:28 +00:00
|
|
|
* @param config Indicates the new configuration.
|
|
|
|
* @systemapi Hide this for inner system use.
|
2022-11-16 02:44:42 +00:00
|
|
|
* @returns -
|
2022-03-07 08:23:08 +00:00
|
|
|
* @permission ohos.permission.UPDATE_CONFIGURATION
|
2022-01-21 16:26:28 +00:00
|
|
|
*/
|
|
|
|
function updateConfiguration(config: Configuration, callback: AsyncCallback<void>): void;
|
|
|
|
function updateConfiguration(config: Configuration): Promise<void>;
|
2022-02-08 13:11:33 +00:00
|
|
|
|
|
|
|
/**
|
2022-11-16 03:20:21 +00:00
|
|
|
* Get information about running abilities
|
2022-02-08 13:11:33 +00:00
|
|
|
*
|
|
|
|
* @since 8
|
2022-03-01 11:50:02 +00:00
|
|
|
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
2022-02-08 13:11:33 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2022-11-16 02:44:42 +00:00
|
|
|
* @returns Returns the array of {@link AbilityRunningInfo}.
|
2022-03-07 08:23:08 +00:00
|
|
|
* @permission ohos.permission.GET_RUNNING_INFO
|
2022-02-08 13:11:33 +00:00
|
|
|
*/
|
|
|
|
function getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
|
|
|
|
function getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default abilityManager;
|