161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit AbilityKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport * as _ApplicationStateObserver from './application/ApplicationStateObserver'; 2361847f8eSopenharmony_ciimport type * as _AppForegroundStateObserver from './application/AppForegroundStateObserver'; 2461847f8eSopenharmony_ciimport * as _AbilityStateData from './application/AbilityStateData'; 2561847f8eSopenharmony_ciimport * as _AppStateData from './application/AppStateData'; 2661847f8eSopenharmony_ciimport type * as _ProcessData from './application/ProcessData'; 2761847f8eSopenharmony_ciimport { ProcessInformation as _ProcessInformation } from './application/ProcessInformation'; 2861847f8eSopenharmony_ciimport * as _AbilityFirstFrameStateObserver from './application/AbilityFirstFrameStateObserver'; 2961847f8eSopenharmony_ciimport * as _AbilityFirstFrameStateData from './application/AbilityFirstFrameStateData'; 3061847f8eSopenharmony_ciimport bundleManager from './@ohos.bundle.bundleManager'; 3161847f8eSopenharmony_ciimport { RunningMultiAppInfo as _RunningMultiAppInfo } from './application/RunningMultiAppInfo'; 3261847f8eSopenharmony_ci 3361847f8eSopenharmony_ci/** 3461847f8eSopenharmony_ci * This module provides the function of app manager service. 3561847f8eSopenharmony_ci * 3661847f8eSopenharmony_ci * @namespace appManager 3761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 3861847f8eSopenharmony_ci * @since 9 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_ci/** 4161847f8eSopenharmony_ci * This module provides the function of app manager service. 4261847f8eSopenharmony_ci * 4361847f8eSopenharmony_ci * @namespace appManager 4461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 4561847f8eSopenharmony_ci * @atomicservice 4661847f8eSopenharmony_ci * @since 11 4761847f8eSopenharmony_ci */ 4861847f8eSopenharmony_cideclare namespace appManager { 4961847f8eSopenharmony_ci /** 5061847f8eSopenharmony_ci * Enum for the application state 5161847f8eSopenharmony_ci * 5261847f8eSopenharmony_ci * @enum { number } 5361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 5461847f8eSopenharmony_ci * @systemapi 5561847f8eSopenharmony_ci * @since 9 5661847f8eSopenharmony_ci */ 5761847f8eSopenharmony_ci export enum ApplicationState { 5861847f8eSopenharmony_ci /** 5961847f8eSopenharmony_ci * The state in which the application is being created. 6061847f8eSopenharmony_ci * 6161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 6261847f8eSopenharmony_ci * @systemapi 6361847f8eSopenharmony_ci * @since 9 6461847f8eSopenharmony_ci */ 6561847f8eSopenharmony_ci STATE_CREATE, 6661847f8eSopenharmony_ci 6761847f8eSopenharmony_ci /** 6861847f8eSopenharmony_ci * The state that the application is in when it switches to the foreground. 6961847f8eSopenharmony_ci * 7061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 7161847f8eSopenharmony_ci * @systemapi 7261847f8eSopenharmony_ci * @since 9 7361847f8eSopenharmony_ci */ 7461847f8eSopenharmony_ci STATE_FOREGROUND, 7561847f8eSopenharmony_ci 7661847f8eSopenharmony_ci /** 7761847f8eSopenharmony_ci * The state in which the application is in focus. 7861847f8eSopenharmony_ci * 7961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 8061847f8eSopenharmony_ci * @systemapi 8161847f8eSopenharmony_ci * @since 9 8261847f8eSopenharmony_ci */ 8361847f8eSopenharmony_ci STATE_ACTIVE, 8461847f8eSopenharmony_ci 8561847f8eSopenharmony_ci /** 8661847f8eSopenharmony_ci * The state in which the application is invisible in the background. 8761847f8eSopenharmony_ci * 8861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 8961847f8eSopenharmony_ci * @systemapi 9061847f8eSopenharmony_ci * @since 9 9161847f8eSopenharmony_ci */ 9261847f8eSopenharmony_ci STATE_BACKGROUND, 9361847f8eSopenharmony_ci 9461847f8eSopenharmony_ci /** 9561847f8eSopenharmony_ci * The state that the application is in when it is destroyed. 9661847f8eSopenharmony_ci * 9761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 9861847f8eSopenharmony_ci * @systemapi 9961847f8eSopenharmony_ci * @since 9 10061847f8eSopenharmony_ci */ 10161847f8eSopenharmony_ci STATE_DESTROY 10261847f8eSopenharmony_ci } 10361847f8eSopenharmony_ci 10461847f8eSopenharmony_ci /** 10561847f8eSopenharmony_ci * Enum for the process state 10661847f8eSopenharmony_ci * 10761847f8eSopenharmony_ci * @enum { number } 10861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 10961847f8eSopenharmony_ci * @since 10 11061847f8eSopenharmony_ci */ 11161847f8eSopenharmony_ci /** 11261847f8eSopenharmony_ci * Enum for the process state 11361847f8eSopenharmony_ci * 11461847f8eSopenharmony_ci * @enum { number } 11561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 11661847f8eSopenharmony_ci * @atomicservice 11761847f8eSopenharmony_ci * @since 11 11861847f8eSopenharmony_ci */ 11961847f8eSopenharmony_ci export enum ProcessState { 12061847f8eSopenharmony_ci /** 12161847f8eSopenharmony_ci * The state that the process is in when it is being created. 12261847f8eSopenharmony_ci * 12361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 12461847f8eSopenharmony_ci * @since 10 12561847f8eSopenharmony_ci */ 12661847f8eSopenharmony_ci /** 12761847f8eSopenharmony_ci * The state that the process is in when it is being created. 12861847f8eSopenharmony_ci * 12961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 13061847f8eSopenharmony_ci * @atomicservice 13161847f8eSopenharmony_ci * @since 11 13261847f8eSopenharmony_ci */ 13361847f8eSopenharmony_ci STATE_CREATE, 13461847f8eSopenharmony_ci 13561847f8eSopenharmony_ci /** 13661847f8eSopenharmony_ci * The state in which the process is in when it switches to the foreground. 13761847f8eSopenharmony_ci * 13861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 13961847f8eSopenharmony_ci * @since 10 14061847f8eSopenharmony_ci */ 14161847f8eSopenharmony_ci /** 14261847f8eSopenharmony_ci * The state in which the process is in when it switches to the foreground. 14361847f8eSopenharmony_ci * 14461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 14561847f8eSopenharmony_ci * @atomicservice 14661847f8eSopenharmony_ci * @since 11 14761847f8eSopenharmony_ci */ 14861847f8eSopenharmony_ci STATE_FOREGROUND, 14961847f8eSopenharmony_ci 15061847f8eSopenharmony_ci /** 15161847f8eSopenharmony_ci * The state in which the process is in focus. 15261847f8eSopenharmony_ci * 15361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 15461847f8eSopenharmony_ci * @since 10 15561847f8eSopenharmony_ci */ 15661847f8eSopenharmony_ci /** 15761847f8eSopenharmony_ci * The state in which the process is in focus. 15861847f8eSopenharmony_ci * 15961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 16061847f8eSopenharmony_ci * @atomicservice 16161847f8eSopenharmony_ci * @since 11 16261847f8eSopenharmony_ci */ 16361847f8eSopenharmony_ci STATE_ACTIVE, 16461847f8eSopenharmony_ci 16561847f8eSopenharmony_ci /** 16661847f8eSopenharmony_ci * The state in which a process is invisible in the background. 16761847f8eSopenharmony_ci * 16861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 16961847f8eSopenharmony_ci * @since 10 17061847f8eSopenharmony_ci */ 17161847f8eSopenharmony_ci /** 17261847f8eSopenharmony_ci * The state in which a process is invisible in the background. 17361847f8eSopenharmony_ci * 17461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 17561847f8eSopenharmony_ci * @atomicservice 17661847f8eSopenharmony_ci * @since 11 17761847f8eSopenharmony_ci */ 17861847f8eSopenharmony_ci STATE_BACKGROUND, 17961847f8eSopenharmony_ci 18061847f8eSopenharmony_ci /** 18161847f8eSopenharmony_ci * The state that the process is in when it is destroyed. 18261847f8eSopenharmony_ci * 18361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 18461847f8eSopenharmony_ci * @since 10 18561847f8eSopenharmony_ci */ 18661847f8eSopenharmony_ci /** 18761847f8eSopenharmony_ci * The state that the process is in when it is destroyed. 18861847f8eSopenharmony_ci * 18961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 19061847f8eSopenharmony_ci * @atomicservice 19161847f8eSopenharmony_ci * @since 11 19261847f8eSopenharmony_ci */ 19361847f8eSopenharmony_ci STATE_DESTROY 19461847f8eSopenharmony_ci } 19561847f8eSopenharmony_ci 19661847f8eSopenharmony_ci /** 19761847f8eSopenharmony_ci * Enum for the preload mode 19861847f8eSopenharmony_ci * 19961847f8eSopenharmony_ci * @enum { number } 20061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 20161847f8eSopenharmony_ci * @systemapi 20261847f8eSopenharmony_ci * @stagemodelonly 20361847f8eSopenharmony_ci * @since 12 20461847f8eSopenharmony_ci */ 20561847f8eSopenharmony_ci export enum PreloadMode { 20661847f8eSopenharmony_ci /** 20761847f8eSopenharmony_ci * Preload application when press the app icon down. 20861847f8eSopenharmony_ci * 20961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 21061847f8eSopenharmony_ci * @systemapi 21161847f8eSopenharmony_ci * @stagemodelonly 21261847f8eSopenharmony_ci * @since 12 21361847f8eSopenharmony_ci */ 21461847f8eSopenharmony_ci PRESS_DOWN 21561847f8eSopenharmony_ci } 21661847f8eSopenharmony_ci 21761847f8eSopenharmony_ci /** 21861847f8eSopenharmony_ci * Register application state observer. 21961847f8eSopenharmony_ci * 22061847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 22161847f8eSopenharmony_ci * @param { 'applicationState' } type - applicationState. 22261847f8eSopenharmony_ci * @param { ApplicationStateObserver } observer - The application state observer. 22361847f8eSopenharmony_ci * @returns { number } Returns the number code of the observer. 22461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 22561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 22661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 22761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 22861847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 22961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 23061847f8eSopenharmony_ci * @systemapi 23161847f8eSopenharmony_ci * @since 9 23261847f8eSopenharmony_ci */ 23361847f8eSopenharmony_ci function on(type: 'applicationState', observer: ApplicationStateObserver): number; 23461847f8eSopenharmony_ci 23561847f8eSopenharmony_ci /** 23661847f8eSopenharmony_ci * Register application state observer. 23761847f8eSopenharmony_ci * 23861847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 23961847f8eSopenharmony_ci * @param { 'applicationState' } type - applicationState. 24061847f8eSopenharmony_ci * @param { ApplicationStateObserver } observer - The application state observer. 24161847f8eSopenharmony_ci * @param { Array<string> } bundleNameList - The list of bundleName. The max length is 128. 24261847f8eSopenharmony_ci * @returns { number } Returns the number code of the observer. 24361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 24461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 24561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 24661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 24761847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 24861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 24961847f8eSopenharmony_ci * @systemapi 25061847f8eSopenharmony_ci * @since 9 25161847f8eSopenharmony_ci */ 25261847f8eSopenharmony_ci function on(type: 'applicationState', observer: ApplicationStateObserver, bundleNameList: Array<string>): number; 25361847f8eSopenharmony_ci 25461847f8eSopenharmony_ci /** 25561847f8eSopenharmony_ci * Register app foreground or background state observer. 25661847f8eSopenharmony_ci * 25761847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 25861847f8eSopenharmony_ci * @param { 'appForegroundState' } type - app foreground or background state. 25961847f8eSopenharmony_ci * @param { AppForegroundStateObserver } observer - The app foreground state observer. 26061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 26161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 26261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 26361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 26461847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 26561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 26661847f8eSopenharmony_ci * @systemapi 26761847f8eSopenharmony_ci * @since 11 26861847f8eSopenharmony_ci */ 26961847f8eSopenharmony_ci function on(type: 'appForegroundState', observer: AppForegroundStateObserver): void; 27061847f8eSopenharmony_ci 27161847f8eSopenharmony_ci /** 27261847f8eSopenharmony_ci * Register ability first frame state observe. 27361847f8eSopenharmony_ci * 27461847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 27561847f8eSopenharmony_ci * @param { 'abilityFirstFrameState' } type - The ability first frame drawing state. 27661847f8eSopenharmony_ci * @param { AbilityFirstFrameStateObserver } observer - The ability first frame state observer. 27761847f8eSopenharmony_ci * @param { string } [bundleName] - The target bundle name. 27861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 27961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 28061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 28161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 28261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 28361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 28461847f8eSopenharmony_ci * @systemapi 28561847f8eSopenharmony_ci * @since 12 28661847f8eSopenharmony_ci */ 28761847f8eSopenharmony_ci function on(type: 'abilityFirstFrameState', observer: AbilityFirstFrameStateObserver, bundleName?: string): void; 28861847f8eSopenharmony_ci 28961847f8eSopenharmony_ci /** 29061847f8eSopenharmony_ci * Unregister application state observer. 29161847f8eSopenharmony_ci * 29261847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 29361847f8eSopenharmony_ci * @param { 'applicationState' } type - applicationState. 29461847f8eSopenharmony_ci * @param { number } observerId - Indicates the number code of the observer. 29561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of off. 29661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 29761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 29861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 29961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 30061847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 30161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 30261847f8eSopenharmony_ci * @systemapi 30361847f8eSopenharmony_ci * @since 9 30461847f8eSopenharmony_ci */ 30561847f8eSopenharmony_ci function off(type: 'applicationState', observerId: number, callback: AsyncCallback<void>): void; 30661847f8eSopenharmony_ci 30761847f8eSopenharmony_ci /** 30861847f8eSopenharmony_ci * Unregister application state observer. 30961847f8eSopenharmony_ci * 31061847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 31161847f8eSopenharmony_ci * @param { 'applicationState' } type - applicationState. 31261847f8eSopenharmony_ci * @param { number } observerId - Indicates the number code of the observer. 31361847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 31461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 31561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 31661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 31761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 31861847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 31961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 32061847f8eSopenharmony_ci * @systemapi 32161847f8eSopenharmony_ci * @since 9 32261847f8eSopenharmony_ci */ 32361847f8eSopenharmony_ci function off(type: 'applicationState', observerId: number): Promise<void>; 32461847f8eSopenharmony_ci 32561847f8eSopenharmony_ci /** 32661847f8eSopenharmony_ci * Unregister app foreground or background state observer. 32761847f8eSopenharmony_ci * 32861847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 32961847f8eSopenharmony_ci * @param { 'appForegroundState' } type - app foreground or background state. 33061847f8eSopenharmony_ci * @param { AppForegroundStateObserver } [observer] - The app foreground state observer. 33161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 33261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 33361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 33461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 33561847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 33661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 33761847f8eSopenharmony_ci * @systemapi 33861847f8eSopenharmony_ci * @since 11 33961847f8eSopenharmony_ci */ 34061847f8eSopenharmony_ci function off(type: 'appForegroundState', observer?: AppForegroundStateObserver): void; 34161847f8eSopenharmony_ci 34261847f8eSopenharmony_ci /** 34361847f8eSopenharmony_ci * Unregister ability first frame state observer. 34461847f8eSopenharmony_ci * 34561847f8eSopenharmony_ci * @permission ohos.permission.RUNNING_STATE_OBSERVER 34661847f8eSopenharmony_ci * @param { 'abilityFirstFrameState' } type - The ability first frame drawing state. 34761847f8eSopenharmony_ci * @param { AbilityFirstFrameStateObserver } [observer] - The ability first frame state observer. 34861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 34961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 35061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 35161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 35261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 35361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 35461847f8eSopenharmony_ci * @systemapi 35561847f8eSopenharmony_ci * @since 12 35661847f8eSopenharmony_ci */ 35761847f8eSopenharmony_ci function off(type: 'abilityFirstFrameState', observer?: AbilityFirstFrameStateObserver): void; 35861847f8eSopenharmony_ci 35961847f8eSopenharmony_ci /** 36061847f8eSopenharmony_ci * getForegroundApplications. 36161847f8eSopenharmony_ci * 36261847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 36361847f8eSopenharmony_ci * @param { AsyncCallback<Array<AppStateData>> } callback - The callback is used to return the list of AppStateData. 36461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 36561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 36661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 36761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 36861847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 36961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 37061847f8eSopenharmony_ci * @systemapi 37161847f8eSopenharmony_ci * @since 9 37261847f8eSopenharmony_ci */ 37361847f8eSopenharmony_ci function getForegroundApplications(callback: AsyncCallback<Array<AppStateData>>): void; 37461847f8eSopenharmony_ci 37561847f8eSopenharmony_ci /** 37661847f8eSopenharmony_ci * getForegroundApplications. 37761847f8eSopenharmony_ci * 37861847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 37961847f8eSopenharmony_ci * @returns { Promise<Array<AppStateData>> } Returns the list of AppStateData. 38061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 38161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 38261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 38361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 38461847f8eSopenharmony_ci * @systemapi 38561847f8eSopenharmony_ci * @since 9 38661847f8eSopenharmony_ci */ 38761847f8eSopenharmony_ci function getForegroundApplications(): Promise<Array<AppStateData>>; 38861847f8eSopenharmony_ci 38961847f8eSopenharmony_ci /** 39061847f8eSopenharmony_ci * Kill process with account. 39161847f8eSopenharmony_ci * 39261847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES 39361847f8eSopenharmony_ci * @param { string } bundleName - The process bundle name. 39461847f8eSopenharmony_ci * @param { number } accountId - The account id. 39561847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 39661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 39761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 39861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 39961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 40061847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 40161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 40261847f8eSopenharmony_ci * @systemapi 40361847f8eSopenharmony_ci * @since 9 40461847f8eSopenharmony_ci */ 40561847f8eSopenharmony_ci /** 40661847f8eSopenharmony_ci * Kill process with account. 40761847f8eSopenharmony_ci * 40861847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.KILL_APP_PROCESSES 40961847f8eSopenharmony_ci * or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES 41061847f8eSopenharmony_ci * @param { string } bundleName - The process bundle name. 41161847f8eSopenharmony_ci * @param { number } accountId - The account id. 41261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 41361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 41461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 41561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 41661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 41761847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 41861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 41961847f8eSopenharmony_ci * @systemapi 42061847f8eSopenharmony_ci * @since 12 42161847f8eSopenharmony_ci */ 42261847f8eSopenharmony_ci function killProcessWithAccount(bundleName: string, accountId: number): Promise<void>; 42361847f8eSopenharmony_ci 42461847f8eSopenharmony_ci /** 42561847f8eSopenharmony_ci * Kill process with account. 42661847f8eSopenharmony_ci * 42761847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES 42861847f8eSopenharmony_ci * @param { string } bundleName - The process bundle name. 42961847f8eSopenharmony_ci * @param { number } accountId - The account id. 43061847f8eSopenharmony_ci * @param { boolean } clearPageStack - The flag that indicates whether the page stack need to be cleared. 43161847f8eSopenharmony_ci * @param { number } [appIndex] - The application index. 43261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 43361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 43461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 43561847f8eSopenharmony_ci * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 43661847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 43761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 43861847f8eSopenharmony_ci * @systemapi 43961847f8eSopenharmony_ci * @since 13 44061847f8eSopenharmony_ci */ 44161847f8eSopenharmony_ci function killProcessWithAccount(bundleName: string, accountId: number, clearPageStack: boolean, appIndex?: number): 44261847f8eSopenharmony_ci Promise<void>; 44361847f8eSopenharmony_ci 44461847f8eSopenharmony_ci /** 44561847f8eSopenharmony_ci * Kill process with account. 44661847f8eSopenharmony_ci * 44761847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES 44861847f8eSopenharmony_ci * @param { string } bundleName - The process bundle name. 44961847f8eSopenharmony_ci * @param { number } accountId - The account id. 45061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of killProcessWithAccount. 45161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 45261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 45361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 45461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 45561847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 45661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 45761847f8eSopenharmony_ci * @systemapi 45861847f8eSopenharmony_ci * @since 9 45961847f8eSopenharmony_ci */ 46061847f8eSopenharmony_ci /** 46161847f8eSopenharmony_ci * Kill process with account. 46261847f8eSopenharmony_ci * 46361847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.KILL_APP_PROCESSES 46461847f8eSopenharmony_ci * or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES 46561847f8eSopenharmony_ci * @param { string } bundleName - The process bundle name. 46661847f8eSopenharmony_ci * @param { number } accountId - The account id. 46761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of killProcessWithAccount. 46861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 46961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 47061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 47161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 47261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 47361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 47461847f8eSopenharmony_ci * @systemapi 47561847f8eSopenharmony_ci * @since 12 47661847f8eSopenharmony_ci */ 47761847f8eSopenharmony_ci function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback<void>): void; 47861847f8eSopenharmony_ci 47961847f8eSopenharmony_ci /** 48061847f8eSopenharmony_ci * Is user running in stability test. 48161847f8eSopenharmony_ci * 48261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback is used to return true if user is running stability test. 48361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 48461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 48561847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 48661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 48761847f8eSopenharmony_ci * @since 9 48861847f8eSopenharmony_ci */ 48961847f8eSopenharmony_ci /** 49061847f8eSopenharmony_ci * Is user running in stability test. 49161847f8eSopenharmony_ci * 49261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback is used to return true if user is running stability test. 49361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 49461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 49561847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 49661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 49761847f8eSopenharmony_ci * @atomicservice 49861847f8eSopenharmony_ci * @since 11 49961847f8eSopenharmony_ci */ 50061847f8eSopenharmony_ci function isRunningInStabilityTest(callback: AsyncCallback<boolean>): void; 50161847f8eSopenharmony_ci 50261847f8eSopenharmony_ci /** 50361847f8eSopenharmony_ci * Is user running in stability test. 50461847f8eSopenharmony_ci * 50561847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns true if user is running stability test. 50661847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 50761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 50861847f8eSopenharmony_ci * @since 9 50961847f8eSopenharmony_ci */ 51061847f8eSopenharmony_ci /** 51161847f8eSopenharmony_ci * Is user running in stability test. 51261847f8eSopenharmony_ci * 51361847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns true if user is running stability test. 51461847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 51561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 51661847f8eSopenharmony_ci * @atomicservice 51761847f8eSopenharmony_ci * @since 11 51861847f8eSopenharmony_ci */ 51961847f8eSopenharmony_ci function isRunningInStabilityTest(): Promise<boolean>; 52061847f8eSopenharmony_ci 52161847f8eSopenharmony_ci /** 52261847f8eSopenharmony_ci * Kill processes by bundle name 52361847f8eSopenharmony_ci * 52461847f8eSopenharmony_ci * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES 52561847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 52661847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 52761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 52861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 52961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 53061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 53161847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 53261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 53361847f8eSopenharmony_ci * @systemapi 53461847f8eSopenharmony_ci * @since 9 53561847f8eSopenharmony_ci */ 53661847f8eSopenharmony_ci /** 53761847f8eSopenharmony_ci * Kill processes by bundle name 53861847f8eSopenharmony_ci * 53961847f8eSopenharmony_ci * @permission ohos.permission.KILL_APP_PROCESSES or ohos.permission.CLEAN_BACKGROUND_PROCESSES 54061847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 54161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 54261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 54361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 54461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 54561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 54661847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 54761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 54861847f8eSopenharmony_ci * @systemapi 54961847f8eSopenharmony_ci * @since 12 55061847f8eSopenharmony_ci */ 55161847f8eSopenharmony_ci function killProcessesByBundleName(bundleName: string): Promise<void>; 55261847f8eSopenharmony_ci 55361847f8eSopenharmony_ci /** 55461847f8eSopenharmony_ci * Kill processes by bundle name 55561847f8eSopenharmony_ci * 55661847f8eSopenharmony_ci * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES 55761847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 55861847f8eSopenharmony_ci * @param { boolean } clearPageStack - The flag that indicates whether the page stack need to be cleared. 55961847f8eSopenharmony_ci * @param { number } [appIndex] - The application index. 56061847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 56161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 56261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 56361847f8eSopenharmony_ci * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 56461847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 56561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 56661847f8eSopenharmony_ci * @systemapi 56761847f8eSopenharmony_ci * @since 13 56861847f8eSopenharmony_ci */ 56961847f8eSopenharmony_ci function killProcessesByBundleName(bundleName: string, clearPageStack: boolean, appIndex?: number): Promise<void>; 57061847f8eSopenharmony_ci 57161847f8eSopenharmony_ci /** 57261847f8eSopenharmony_ci * Kill processes by bundle name 57361847f8eSopenharmony_ci * 57461847f8eSopenharmony_ci * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES 57561847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 57661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of killProcessesByBundleName. 57761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 57861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 57961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 58061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 58161847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 58261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 58361847f8eSopenharmony_ci * @systemapi 58461847f8eSopenharmony_ci * @since 9 58561847f8eSopenharmony_ci */ 58661847f8eSopenharmony_ci /** 58761847f8eSopenharmony_ci * Kill processes by bundle name 58861847f8eSopenharmony_ci * 58961847f8eSopenharmony_ci * @permission ohos.permission.KILL_APP_PROCESSES or ohos.permission.CLEAN_BACKGROUND_PROCESSES 59061847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 59161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of killProcessesByBundleName. 59261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 59361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 59461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 59561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 59661847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 59761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 59861847f8eSopenharmony_ci * @systemapi 59961847f8eSopenharmony_ci * @since 12 60061847f8eSopenharmony_ci */ 60161847f8eSopenharmony_ci function killProcessesByBundleName(bundleName: string, callback: AsyncCallback<void>); 60261847f8eSopenharmony_ci 60361847f8eSopenharmony_ci /** 60461847f8eSopenharmony_ci * Clear up application data by bundle name 60561847f8eSopenharmony_ci * 60661847f8eSopenharmony_ci * @permission ohos.permission.CLEAN_APPLICATION_DATA 60761847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 60861847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 60961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 61061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 61161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 61261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 61361847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 61461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 61561847f8eSopenharmony_ci * @systemapi 61661847f8eSopenharmony_ci * @since 9 61761847f8eSopenharmony_ci */ 61861847f8eSopenharmony_ci function clearUpApplicationData(bundleName: string): Promise<void>; 61961847f8eSopenharmony_ci 62061847f8eSopenharmony_ci /** 62161847f8eSopenharmony_ci * Clear up application data by bundle name 62261847f8eSopenharmony_ci * 62361847f8eSopenharmony_ci * @permission ohos.permission.CLEAN_APPLICATION_DATA 62461847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 62561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of clearUpApplicationData. 62661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 62761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 62861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 62961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 63061847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 63161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 63261847f8eSopenharmony_ci * @systemapi 63361847f8eSopenharmony_ci * @since 9 63461847f8eSopenharmony_ci */ 63561847f8eSopenharmony_ci function clearUpApplicationData(bundleName: string, callback: AsyncCallback<void>); 63661847f8eSopenharmony_ci 63761847f8eSopenharmony_ci /** 63861847f8eSopenharmony_ci * Is it a ram-constrained device 63961847f8eSopenharmony_ci * 64061847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns true if the device is ram-constrained. 64161847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 64261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 64361847f8eSopenharmony_ci * @since 9 64461847f8eSopenharmony_ci */ 64561847f8eSopenharmony_ci /** 64661847f8eSopenharmony_ci * Is it a ram-constrained device 64761847f8eSopenharmony_ci * 64861847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns true if the device is ram-constrained. 64961847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 65061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 65161847f8eSopenharmony_ci * @atomicservice 65261847f8eSopenharmony_ci * @since 11 65361847f8eSopenharmony_ci */ 65461847f8eSopenharmony_ci function isRamConstrainedDevice(): Promise<boolean>; 65561847f8eSopenharmony_ci 65661847f8eSopenharmony_ci /** 65761847f8eSopenharmony_ci * Is it a ram-constrained device 65861847f8eSopenharmony_ci * 65961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback is used to return true if the device is ram-constrained. 66061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 66161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 66261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 66361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 66461847f8eSopenharmony_ci * @since 9 66561847f8eSopenharmony_ci */ 66661847f8eSopenharmony_ci /** 66761847f8eSopenharmony_ci * Is it a ram-constrained device 66861847f8eSopenharmony_ci * 66961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback is used to return true if the device is ram-constrained. 67061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 67161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 67261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 67361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 67461847f8eSopenharmony_ci * @atomicservice 67561847f8eSopenharmony_ci * @since 11 67661847f8eSopenharmony_ci */ 67761847f8eSopenharmony_ci function isRamConstrainedDevice(callback: AsyncCallback<boolean>): void; 67861847f8eSopenharmony_ci 67961847f8eSopenharmony_ci /** 68061847f8eSopenharmony_ci * Get the memory size of the application 68161847f8eSopenharmony_ci * 68261847f8eSopenharmony_ci * @returns { Promise<number> } Returns the application memory size. 68361847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 68461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 68561847f8eSopenharmony_ci * @since 9 68661847f8eSopenharmony_ci */ 68761847f8eSopenharmony_ci /** 68861847f8eSopenharmony_ci * Get the memory size of the application 68961847f8eSopenharmony_ci * 69061847f8eSopenharmony_ci * @returns { Promise<number> } Returns the application memory size. 69161847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 69261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 69361847f8eSopenharmony_ci * @atomicservice 69461847f8eSopenharmony_ci * @since 11 69561847f8eSopenharmony_ci */ 69661847f8eSopenharmony_ci function getAppMemorySize(): Promise<number>; 69761847f8eSopenharmony_ci 69861847f8eSopenharmony_ci /** 69961847f8eSopenharmony_ci * Get the memory size of the application 70061847f8eSopenharmony_ci * 70161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the application memory size. 70261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 70361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 70461847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 70561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 70661847f8eSopenharmony_ci * @since 9 70761847f8eSopenharmony_ci */ 70861847f8eSopenharmony_ci /** 70961847f8eSopenharmony_ci * Get the memory size of the application 71061847f8eSopenharmony_ci * 71161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - The callback is used to return the application memory size. 71261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 71361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 71461847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 71561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 71661847f8eSopenharmony_ci * @atomicservice 71761847f8eSopenharmony_ci * @since 11 71861847f8eSopenharmony_ci */ 71961847f8eSopenharmony_ci function getAppMemorySize(callback: AsyncCallback<number>): void; 72061847f8eSopenharmony_ci 72161847f8eSopenharmony_ci /** 72261847f8eSopenharmony_ci * If you apply for permission, you can obtain information about all running processes. 72361847f8eSopenharmony_ci * If you do not apply, you can only obtain information about the current process. 72461847f8eSopenharmony_ci * 72561847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 72661847f8eSopenharmony_ci * @returns { Promise<Array<ProcessInformation>> } Returns the array of {@link ProcessInformation}. 72761847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 72861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 72961847f8eSopenharmony_ci * @since 9 73061847f8eSopenharmony_ci */ 73161847f8eSopenharmony_ci /** 73261847f8eSopenharmony_ci * Get information about the current process. 73361847f8eSopenharmony_ci * 73461847f8eSopenharmony_ci * @returns { Promise<Array<ProcessInformation>> } Returns the array of {@link ProcessInformation}. 73561847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 73661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 73761847f8eSopenharmony_ci * @atomicservice 73861847f8eSopenharmony_ci * @since 11 73961847f8eSopenharmony_ci */ 74061847f8eSopenharmony_ci function getRunningProcessInformation(): Promise<Array<ProcessInformation>>; 74161847f8eSopenharmony_ci 74261847f8eSopenharmony_ci /** 74361847f8eSopenharmony_ci * Get running process information by bundle type. 74461847f8eSopenharmony_ci * 74561847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 74661847f8eSopenharmony_ci * @param { bundleManager.BundleType } bundleType - the bundle type of the process 74761847f8eSopenharmony_ci * @returns { Promise<Array<ProcessInformation>> } Returns the array of {@link ProcessInformation}. 74861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 74961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 75061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 75161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 75261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 75361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 75461847f8eSopenharmony_ci * @systemapi 75561847f8eSopenharmony_ci * @since 12 75661847f8eSopenharmony_ci */ 75761847f8eSopenharmony_ci function getRunningProcessInformationByBundleType( 75861847f8eSopenharmony_ci bundleType: bundleManager.BundleType): Promise<Array<ProcessInformation>>; 75961847f8eSopenharmony_ci 76061847f8eSopenharmony_ci /** 76161847f8eSopenharmony_ci * If you apply for permission, you can obtain information about all running processes. 76261847f8eSopenharmony_ci * If you do not apply, you can only obtain information about the current process. 76361847f8eSopenharmony_ci * 76461847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 76561847f8eSopenharmony_ci * @param { AsyncCallback<Array<ProcessInformation>> } callback - The callback is used to return the array of {@link ProcessInformation}. 76661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 76761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 76861847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 76961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 77061847f8eSopenharmony_ci * @since 9 77161847f8eSopenharmony_ci */ 77261847f8eSopenharmony_ci /** 77361847f8eSopenharmony_ci * Get information about the current process. 77461847f8eSopenharmony_ci * 77561847f8eSopenharmony_ci * @param { AsyncCallback<Array<ProcessInformation>> } callback - The callback is used to return the array of {@link ProcessInformation}. 77661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 77761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 77861847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 77961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 78061847f8eSopenharmony_ci * @atomicservice 78161847f8eSopenharmony_ci * @since 11 78261847f8eSopenharmony_ci */ 78361847f8eSopenharmony_ci function getRunningProcessInformation(callback: AsyncCallback<Array<ProcessInformation>>): void; 78461847f8eSopenharmony_ci 78561847f8eSopenharmony_ci /** 78661847f8eSopenharmony_ci * Check whether the shared bundle is running. 78761847f8eSopenharmony_ci * 78861847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 78961847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the shared bundle. 79061847f8eSopenharmony_ci * @param { number } versionCode - Indicates the version code of the shared bundle. 79161847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the shared bundle running result. The result is true if running, false otherwise. 79261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 79361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 79461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 79561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 79661847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 79761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 79861847f8eSopenharmony_ci * @systemapi 79961847f8eSopenharmony_ci * @since 10 80061847f8eSopenharmony_ci */ 80161847f8eSopenharmony_ci function isSharedBundleRunning(bundleName: string, versionCode: number): Promise<boolean>; 80261847f8eSopenharmony_ci 80361847f8eSopenharmony_ci /** 80461847f8eSopenharmony_ci * Check whether the shared bundle is running. 80561847f8eSopenharmony_ci * 80661847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 80761847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the shared bundle. 80861847f8eSopenharmony_ci * @param { number } versionCode - Indicates the version code of the shared bundle. 80961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback of checking the shared bundle running result. 81061847f8eSopenharmony_ci * The result is true if running, false otherwise. 81161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 81261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 81361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 81461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 81561847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 81661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 81761847f8eSopenharmony_ci * @systemapi 81861847f8eSopenharmony_ci * @since 10 81961847f8eSopenharmony_ci */ 82061847f8eSopenharmony_ci function isSharedBundleRunning(bundleName: string, versionCode: number, callback: AsyncCallback<boolean>): void; 82161847f8eSopenharmony_ci 82261847f8eSopenharmony_ci /** 82361847f8eSopenharmony_ci * Obtains memory usage of one process by its pid. 82461847f8eSopenharmony_ci * 82561847f8eSopenharmony_ci * @param { number } pid - Indicates the pid of the process. 82661847f8eSopenharmony_ci * @returns { Promise<number> } Returns the memory usage of the process in KB. 82761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 82861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 82961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 83061847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 83161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 83261847f8eSopenharmony_ci * @systemapi 83361847f8eSopenharmony_ci * @since 10 83461847f8eSopenharmony_ci */ 83561847f8eSopenharmony_ci function getProcessMemoryByPid(pid: number): Promise<number>; 83661847f8eSopenharmony_ci 83761847f8eSopenharmony_ci /** 83861847f8eSopenharmony_ci * Obtains memory usage of one process by its pid. 83961847f8eSopenharmony_ci * 84061847f8eSopenharmony_ci * @param { number } pid - Indicates the pid of the process. 84161847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - Indicates the callback of getting process memory by pid result. 84261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 84361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 84461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 84561847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 84661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 84761847f8eSopenharmony_ci * @systemapi 84861847f8eSopenharmony_ci * @since 10 84961847f8eSopenharmony_ci */ 85061847f8eSopenharmony_ci function getProcessMemoryByPid(pid: number, callback: AsyncCallback<number>): void; 85161847f8eSopenharmony_ci 85261847f8eSopenharmony_ci /** 85361847f8eSopenharmony_ci * Obtains the process information list of running processes that belong to a specific bundle of current user. 85461847f8eSopenharmony_ci * 85561847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the application to which the processes belong to. 85661847f8eSopenharmony_ci * @param { AsyncCallback<Array<ProcessInformation>> } callback - Indicates the callback of getting process information by bundleName result. 85761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 85861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 85961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 86061847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 86161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 86261847f8eSopenharmony_ci * @systemapi 86361847f8eSopenharmony_ci * @since 10 86461847f8eSopenharmony_ci */ 86561847f8eSopenharmony_ci function getRunningProcessInfoByBundleName(bundleName: string, callback: AsyncCallback<Array<ProcessInformation>>): void; 86661847f8eSopenharmony_ci 86761847f8eSopenharmony_ci /** 86861847f8eSopenharmony_ci * Obtains the process information list of running processes that belong to a specific bundle and specific user ID. 86961847f8eSopenharmony_ci * 87061847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the application to which the processes belong to. 87161847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID of the application to which the processes belong to. 87261847f8eSopenharmony_ci * @param { AsyncCallback<Array<ProcessInformation>> } callback - Indicates the callback of getting process information by bundleName result. 87361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 87461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 87561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 87661847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 87761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 87861847f8eSopenharmony_ci * @systemapi 87961847f8eSopenharmony_ci * @since 10 88061847f8eSopenharmony_ci */ 88161847f8eSopenharmony_ci function getRunningProcessInfoByBundleName(bundleName: string, userId: number, callback: AsyncCallback<Array<ProcessInformation>>): void; 88261847f8eSopenharmony_ci 88361847f8eSopenharmony_ci /** 88461847f8eSopenharmony_ci * Obtains the process information list of running processes that belong to a specific bundle of current user. 88561847f8eSopenharmony_ci * 88661847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the application to which the processes belong to. 88761847f8eSopenharmony_ci * @returns { Promise<Array<ProcessInformation>> } Returns a list of process information. 88861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 88961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 89061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 89161847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 89261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 89361847f8eSopenharmony_ci * @systemapi 89461847f8eSopenharmony_ci * @since 10 89561847f8eSopenharmony_ci */ 89661847f8eSopenharmony_ci function getRunningProcessInfoByBundleName(bundleName: string): Promise<Array<ProcessInformation>>; 89761847f8eSopenharmony_ci 89861847f8eSopenharmony_ci /** 89961847f8eSopenharmony_ci * Obtains the process information list of running processes that belong to a specific bundle and specific user ID. 90061847f8eSopenharmony_ci * 90161847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the application to which the processes belong to. 90261847f8eSopenharmony_ci * @param { number } userId - Indicates the user ID of the application to which the processes belong to. 90361847f8eSopenharmony_ci * @returns { Promise<Array<ProcessInformation>> } Returns a list of process information. 90461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 90561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 90661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 90761847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 90861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 90961847f8eSopenharmony_ci * @systemapi 91061847f8eSopenharmony_ci * @since 10 91161847f8eSopenharmony_ci */ 91261847f8eSopenharmony_ci function getRunningProcessInfoByBundleName(bundleName: string, userId: number): Promise<Array<ProcessInformation>>; 91361847f8eSopenharmony_ci 91461847f8eSopenharmony_ci /** 91561847f8eSopenharmony_ci * Check whether the bundle is running. 91661847f8eSopenharmony_ci * 91761847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 91861847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the bundle. 91961847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the bundle running result. The result is true if running, false otherwise. 92061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 92161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 92261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 92361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 92461847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 92561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 92661847f8eSopenharmony_ci * @systemapi 92761847f8eSopenharmony_ci * @since 11 92861847f8eSopenharmony_ci */ 92961847f8eSopenharmony_ci function isApplicationRunning(bundleName: string): Promise<boolean>; 93061847f8eSopenharmony_ci 93161847f8eSopenharmony_ci /** 93261847f8eSopenharmony_ci * Check whether the bundle is running. 93361847f8eSopenharmony_ci * 93461847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 93561847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the bundle. 93661847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - The callback of checking the bundle running result. 93761847f8eSopenharmony_ci * The result is true if running, false otherwise. 93861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 93961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 94061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 94161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 94261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 94361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 94461847f8eSopenharmony_ci * @systemapi 94561847f8eSopenharmony_ci * @since 11 94661847f8eSopenharmony_ci */ 94761847f8eSopenharmony_ci function isApplicationRunning(bundleName: string, callback: AsyncCallback<boolean>): void; 94861847f8eSopenharmony_ci 94961847f8eSopenharmony_ci /** 95061847f8eSopenharmony_ci * Preload the target application, create process and initialize resources. 95161847f8eSopenharmony_ci * 95261847f8eSopenharmony_ci * @permission ohos.permission.PRELOAD_APPLICATION 95361847f8eSopenharmony_ci * @param { string } bundleName - The bundle name of the application to preload. 95461847f8eSopenharmony_ci * @param { number } userId - Indicates the user identification. 95561847f8eSopenharmony_ci * @param { PreloadMode } mode - Preload application mode. 95661847f8eSopenharmony_ci * @param { number } [appIndex] - The index of application clone. 95761847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of preloadApplication. 95861847f8eSopenharmony_ci * @throws { BusinessError } 201 - The application does not have permission to call the interface. 95961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 96061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 96161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 96261847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 96361847f8eSopenharmony_ci * @throws { BusinessError } 16300005 - The target bundle does not exist. 96461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 96561847f8eSopenharmony_ci * @systemapi 96661847f8eSopenharmony_ci * @stagemodelonly 96761847f8eSopenharmony_ci * @since 12 96861847f8eSopenharmony_ci */ 96961847f8eSopenharmony_ci function preloadApplication(bundleName: string, userId: number, mode: PreloadMode, appIndex?: number): Promise<void>; 97061847f8eSopenharmony_ci 97161847f8eSopenharmony_ci /** 97261847f8eSopenharmony_ci * Get all running multi app info by bundleName 97361847f8eSopenharmony_ci * 97461847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 97561847f8eSopenharmony_ci * @param { string } bundleName - The bundle name of the application to query. 97661847f8eSopenharmony_ci * @returns { Promise<RunningMultiAppInfo> } Returns the {@link RunningMultiAppInfo} for given bundle. 97761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 97861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 97961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 98061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 98161847f8eSopenharmony_ci * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. 98261847f8eSopenharmony_ci * @throws { BusinessError } 18500001 - The bundle does not exist or no patch has been applied. 98361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 98461847f8eSopenharmony_ci * @systemapi 98561847f8eSopenharmony_ci * @stagemodelonly 98661847f8eSopenharmony_ci * @since 12 98761847f8eSopenharmony_ci */ 98861847f8eSopenharmony_ci function getRunningMultiAppInfo(bundleName: string): Promise<RunningMultiAppInfo>; 98961847f8eSopenharmony_ci 99061847f8eSopenharmony_ci /** 99161847f8eSopenharmony_ci * Check whether the bundle is running. 99261847f8eSopenharmony_ci * 99361847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 99461847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the bundle. 99561847f8eSopenharmony_ci * @param { number } [appCloneIndex] - app clone index 99661847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the bundle running result. The result is true if running, false otherwise. 99761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 99861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 99961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 100061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 100161847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 100261847f8eSopenharmony_ci * @throws { BusinessError } 16000073 - The app clone index is invalid. 100361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 100461847f8eSopenharmony_ci * @systemapi 100561847f8eSopenharmony_ci * @since 12 100661847f8eSopenharmony_ci */ 100761847f8eSopenharmony_ci function isAppRunning(bundleName: string, appCloneIndex?: number): Promise<boolean>; 100861847f8eSopenharmony_ci 100961847f8eSopenharmony_ci /** 101061847f8eSopenharmony_ci * Clear up application data by bundle name 101161847f8eSopenharmony_ci * 101261847f8eSopenharmony_ci * @permission ohos.permission.CLEAN_APPLICATION_DATA 101361847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 101461847f8eSopenharmony_ci * @param { number } [appCloneIndex] - app clone index 101561847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 101661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 101761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 101861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 101961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 102061847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 102161847f8eSopenharmony_ci * @throws { BusinessError } 16000073 - The app clone index is invalid. 102261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 102361847f8eSopenharmony_ci * @systemapi 102461847f8eSopenharmony_ci * @since 13 102561847f8eSopenharmony_ci */ 102661847f8eSopenharmony_ci function clearUpAppData(bundleName: string, appCloneIndex?: number): Promise<void>; 102761847f8eSopenharmony_ci 102861847f8eSopenharmony_ci /** 102961847f8eSopenharmony_ci * Terminate the mission of a UIAbility and back to caller. 103061847f8eSopenharmony_ci * 103161847f8eSopenharmony_ci * @permission ohos.permission.KILL_APP_PROCESSES 103261847f8eSopenharmony_ci * @param { number } missionId - The mission id of the UIAbility need to be terminated. 103361847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of terminateMission. 103461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 103561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 103661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 103761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 103861847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 103961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 104061847f8eSopenharmony_ci * @systemapi 104161847f8eSopenharmony_ci * @since 13 104261847f8eSopenharmony_ci */ 104361847f8eSopenharmony_ci function terminateMission(missionId: number): Promise<void>; 104461847f8eSopenharmony_ci 104561847f8eSopenharmony_ci /** 104661847f8eSopenharmony_ci * Get pids of processes which belong to specific bundle name and support process cache feature. 104761847f8eSopenharmony_ci * 104861847f8eSopenharmony_ci * @permission ohos.permission.GET_RUNNING_INFO 104961847f8eSopenharmony_ci * @param { string } bundleName - bundle name. 105061847f8eSopenharmony_ci * @returns { Promise<Array<number>> } Returns the list of pid. 105161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 105261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 105361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 105461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 105561847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 105661847f8eSopenharmony_ci * @throws { BusinessError } 16000050 - Internal error. 105761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 105861847f8eSopenharmony_ci * @systemapi 105961847f8eSopenharmony_ci * @stagemodelonly 106061847f8eSopenharmony_ci * @since 13 106161847f8eSopenharmony_ci */ 106261847f8eSopenharmony_ci function getSupportedProcessCachePids(bundleName : string): Promise<Array<number>>; 106361847f8eSopenharmony_ci 106461847f8eSopenharmony_ci /** 106561847f8eSopenharmony_ci * The ability or extension state data. 106661847f8eSopenharmony_ci * 106761847f8eSopenharmony_ci * @typedef { _AbilityStateData.default } 106861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 106961847f8eSopenharmony_ci * @systemapi 107061847f8eSopenharmony_ci * @since 9 107161847f8eSopenharmony_ci */ 107261847f8eSopenharmony_ci export type AbilityStateData = _AbilityStateData.default; 107361847f8eSopenharmony_ci 107461847f8eSopenharmony_ci /** 107561847f8eSopenharmony_ci * The application state data. 107661847f8eSopenharmony_ci * 107761847f8eSopenharmony_ci * @typedef { _AppStateData.default } 107861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 107961847f8eSopenharmony_ci * @systemapi 108061847f8eSopenharmony_ci * @since 9 108161847f8eSopenharmony_ci */ 108261847f8eSopenharmony_ci export type AppStateData = _AppStateData.default; 108361847f8eSopenharmony_ci 108461847f8eSopenharmony_ci /** 108561847f8eSopenharmony_ci * The application state observer. 108661847f8eSopenharmony_ci * 108761847f8eSopenharmony_ci * @typedef { _ApplicationStateObserver.default } 108861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 108961847f8eSopenharmony_ci * @systemapi 109061847f8eSopenharmony_ci * @since 9 109161847f8eSopenharmony_ci */ 109261847f8eSopenharmony_ci export type ApplicationStateObserver = _ApplicationStateObserver.default; 109361847f8eSopenharmony_ci 109461847f8eSopenharmony_ci /** 109561847f8eSopenharmony_ci * The application foreground state observer. 109661847f8eSopenharmony_ci * 109761847f8eSopenharmony_ci * @typedef { _AppForegroundStateObserver.default } 109861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 109961847f8eSopenharmony_ci * @systemapi 110061847f8eSopenharmony_ci * @since 11 110161847f8eSopenharmony_ci */ 110261847f8eSopenharmony_ci export type AppForegroundStateObserver = _AppForegroundStateObserver.default; 110361847f8eSopenharmony_ci 110461847f8eSopenharmony_ci /** 110561847f8eSopenharmony_ci * The class of a process information. 110661847f8eSopenharmony_ci * 110761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 110861847f8eSopenharmony_ci * @since 9 110961847f8eSopenharmony_ci */ 111061847f8eSopenharmony_ci /** 111161847f8eSopenharmony_ci * The class of a process information. 111261847f8eSopenharmony_ci * 111361847f8eSopenharmony_ci * @typedef { _ProcessInformation } 111461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 111561847f8eSopenharmony_ci * @atomicservice 111661847f8eSopenharmony_ci * @since 11 111761847f8eSopenharmony_ci */ 111861847f8eSopenharmony_ci export type ProcessInformation = _ProcessInformation; 111961847f8eSopenharmony_ci 112061847f8eSopenharmony_ci /** 112161847f8eSopenharmony_ci * The class of a process information. 112261847f8eSopenharmony_ci * 112361847f8eSopenharmony_ci * @typedef { _ProcessData.default } 112461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 112561847f8eSopenharmony_ci * @systemapi 112661847f8eSopenharmony_ci * @since 10 112761847f8eSopenharmony_ci */ 112861847f8eSopenharmony_ci export type ProcessData = _ProcessData.default; 112961847f8eSopenharmony_ci 113061847f8eSopenharmony_ci /** 113161847f8eSopenharmony_ci * The ability first frame state observer. 113261847f8eSopenharmony_ci * 113361847f8eSopenharmony_ci * @typedef { _AbilityFirstFrameStateObserver.default } 113461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 113561847f8eSopenharmony_ci * @systemapi 113661847f8eSopenharmony_ci * @since 12 113761847f8eSopenharmony_ci */ 113861847f8eSopenharmony_ci export type AbilityFirstFrameStateObserver = _AbilityFirstFrameStateObserver.default; 113961847f8eSopenharmony_ci 114061847f8eSopenharmony_ci /** 114161847f8eSopenharmony_ci * The class of an ability first frame state data. 114261847f8eSopenharmony_ci * 114361847f8eSopenharmony_ci * @typedef { _AbilityFirstFrameStateData.default } 114461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 114561847f8eSopenharmony_ci * @systemapi 114661847f8eSopenharmony_ci * @since 12 114761847f8eSopenharmony_ci */ 114861847f8eSopenharmony_ci export type AbilityFirstFrameStateData = _AbilityFirstFrameStateData.default; 114961847f8eSopenharmony_ci 115061847f8eSopenharmony_ci /** 115161847f8eSopenharmony_ci * The class of running multi app information. 115261847f8eSopenharmony_ci * 115361847f8eSopenharmony_ci * @typedef { _RunningMultiAppInfo } 115461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 115561847f8eSopenharmony_ci * @systemapi 115661847f8eSopenharmony_ci * @since 12 115761847f8eSopenharmony_ci */ 115861847f8eSopenharmony_ci export type RunningMultiAppInfo = _RunningMultiAppInfo; 115961847f8eSopenharmony_ci} 116061847f8eSopenharmony_ci 116161847f8eSopenharmony_ciexport default appManager; 1162