• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License"),
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import { AsyncCallback } from './basic';
17import { Configuration } from './@ohos.application.Configuration';
18import { AbilityRunningInfo } from './application/AbilityRunningInfo';
19import { ExtensionRunningInfo } from './application/ExtensionRunningInfo';
20import { ElementName }  from './bundle/elementName';
21
22/**
23 * The class of an ability manager.
24 *
25 * @since 8
26 * @syscap SystemCapability.Ability.AbilityRuntime.Core
27 * @systemapi Hide this for inner system use
28 * @permission N/A
29 * @deprecated since 9
30 * @useinstead ohos.app.ability.abilityManager
31 */
32declare namespace abilityManager {
33    /**
34     * @name AbilityState
35     * @since 8
36     * @syscap SystemCapability.Ability.AbilityRuntime.Core
37     * @systemapi Hide this for inner system use.
38     * @permission N/A
39     */
40    export enum AbilityState {
41        INITIAL = 0,
42        FOREGROUND = 9,
43        BACKGROUND = 10,
44        FOREGROUNDING = 11,
45        BACKGROUNDING = 12
46    }
47
48    /**
49     * Updates the configuration by modifying the configuration.
50     *
51     * @since 8
52     * @syscap SystemCapability.Ability.AbilityRuntime.Core
53     * @param config Indicates the new configuration.
54     * @systemapi Hide this for inner system use.
55     * @returns -
56     * @permission ohos.permission.UPDATE_CONFIGURATION
57     */
58    function updateConfiguration(config: Configuration, callback: AsyncCallback<void>): void;
59    function updateConfiguration(config: Configuration): Promise<void>;
60
61    /**
62     * Get information about running abilities
63     *
64     * @since 8
65     * @syscap SystemCapability.Ability.AbilityRuntime.Core
66     * @systemapi Hide this for inner system use.
67     * @returns Returns the array of {@link AbilityRunningInfo}.
68     * @permission ohos.permission.GET_RUNNING_INFO
69     */
70    function getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
71    function getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;
72}
73
74export default abilityManager;