• 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';
20
21/**
22 * The class of an ability manager.
23 *
24 * @since 8
25 * @syscap SystemCapability.Ability.AbilityRuntime.Core
26 * @systemapi Hide this for inner system use
27 * @permission N/A
28 */
29declare namespace abilityManager {
30
31    /**
32     * @name AbilityState
33     * @since 8
34     * @syscap SystemCapability.Ability.AbilityRuntime.Core
35     * @systemapi Hide this for inner system use.
36     * @permission N/A
37     */
38    export enum AbilityState {
39        INITIAL = 0,
40        FOREGROUND = 9,
41        BACKGROUND = 10,
42        FOREGROUNDING = 11,
43        BACKGROUNDING = 12
44    }
45
46    /**
47     * Updates the configuration by modifying the configuration.
48     *
49     * @since 8
50     * @syscap SystemCapability.Ability.AbilityRuntime.Core
51     * @param config Indicates the new configuration.
52     * @systemapi Hide this for inner system use.
53     * @return -
54     * @permission ohos.permission.UPDATE_CONFIGURATION
55     */
56    function updateConfiguration(config: Configuration, callback: AsyncCallback<void>): void;
57    function updateConfiguration(config: Configuration): Promise<void>;
58
59    /**
60     * Get information about running abilitys
61     *
62     * @since 8
63     * @syscap SystemCapability.Ability.AbilityRuntime.Core
64     * @systemapi Hide this for inner system use.
65     * @return Returns the array of {@link AbilityRunningInfo}.
66     * @permission ohos.permission.GET_RUNNING_INFO
67     */
68    function getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
69    function getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;
70}
71
72export default abilityManager;
73