!4153 更新元能力AbilityManager和AppManager相关接口

Merge pull request !4153 from dy/UpdateAbilityApi
This commit is contained in:
openharmony_ci 2023-02-07 13:21:35 +00:00 committed by Gitee
commit 299d914230
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 30 additions and 38 deletions

View File

@ -104,6 +104,7 @@ declare namespace AbilityConstant {
* Type of window mode.
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @StageModelOnly
* @since 9
*/

View File

@ -16,12 +16,13 @@
/**
* StartOptions is the basic communication component of the system.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @StageModelOnly
* @since 9
*/
export default class StartOptions {
/**
* windowMode
* The type of {@link ohos.app.ability.AbilityConstant#WindowMode}
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9

View File

@ -28,7 +28,7 @@ import { ElementName } from './bundleManager/elementName';
*/
declare namespace abilityManager {
/**
* Enum for the ability state
* Enum for the ability state.
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
@ -36,6 +36,7 @@ declare namespace abilityManager {
*/
export enum AbilityState {
INITIAL = 0,
FOCUS = 2,
FOREGROUND = 9,
BACKGROUND = 10,
FOREGROUNDING = 11,
@ -67,7 +68,7 @@ declare namespace abilityManager {
function updateConfiguration(config: Configuration): Promise<void>;
/**
* Get information about running abilities
* Get information about running UI abilities.
* @permission ohos.permission.GET_RUNNING_INFO
* @returns { Promise<Array<AbilityRunningInfo>> } Returns the array of AbilityRunningInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
@ -78,7 +79,7 @@ declare namespace abilityManager {
function getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
/**
* Get information about the running ability
* Get information about running UI abilities.
* @permission ohos.permission.GET_RUNNING_INFO
* @param { AsyncCallback<Array<AbilityRunningInfo>> } callback - The callback is used to return the array of AbilityRunningInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
@ -89,7 +90,7 @@ declare namespace abilityManager {
function getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;
/**
* Get information about running extensions
* Get information about running extensions.
* @permission ohos.permission.GET_RUNNING_INFO
* @param { number } upperLimit - Get the maximum limit of the number of messages.
* @returns { Promise<Array<ExtensionRunningInfo>> } Returns the array of ExtensionRunningInfo.
@ -101,7 +102,7 @@ declare namespace abilityManager {
function getExtensionRunningInfos(upperLimit: number): Promise<Array<ExtensionRunningInfo>>;
/**
* Get information about running extensions
* Get information about running extensions.
* @permission ohos.permission.GET_RUNNING_INFO
* @param { number } upperLimit - Get the maximum limit of the number of messages.
* @param { AsyncCallback<Array<ExtensionRunningInfo>> } callback - The callback is used to return the array of ExtensionRunningInfo.

View File

@ -17,8 +17,7 @@ import { AsyncCallback } from './basic';
import * as _ApplicationStateObserver from './application/ApplicationStateObserver';
import * as _AbilityStateData from './application/AbilityStateData';
import * as _AppStateData from './application/AppStateData';
import { ProcessRunningInfo as _ProcessRunningInfo } from './application/ProcessRunningInfo';
import { ProcessRunningInformation as _ProcessRunningInformation } from './application/ProcessRunningInformation';
import { ProcessInformation as _ProcessInformation } from './application/ProcessInformation';
/**
* This module provides the function of app manager service.
@ -264,24 +263,22 @@ declare namespace appManager {
/**
* Get information about running processes
* @permission ohos.permission.GET_RUNNING_INFO
* @returns { Promise<Array<ProcessRunningInformation>> } Returns the array of {@link ProcessRunningInformation}.
* @returns { Promise<Array<ProcessInformation>> } Returns the array of {@link ProcessInformation}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 9
*/
function getProcessRunningInformation(): Promise<Array<ProcessRunningInformation>>;
function getRunningProcessInformation(): Promise<Array<ProcessInformation>>;
/**
* Get information about running processes
* @permission ohos.permission.GET_RUNNING_INFO
* @param { AsyncCallback<Array<ProcessRunningInformation>> } callback - The callback is used to return the array of {@link ProcessRunningInformation}.
* @param { AsyncCallback<Array<ProcessInformation>> } callback - The callback is used to return the array of {@link ProcessInformation}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 9
*/
function getProcessRunningInformation(callback: AsyncCallback<Array<ProcessRunningInformation>>): void;
function getRunningProcessInformation(callback: AsyncCallback<Array<ProcessInformation>>): void;
/**
* The ability or extension state data.
@ -308,18 +305,11 @@ declare namespace appManager {
export type ApplicationStateObserver = _ApplicationStateObserver.default
/**
* The class of an process running information.
* The class of a process information.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 9
*/
export type ProcessRunningInfo = _ProcessRunningInfo
/**
* The class of a process running information.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 9
*/
export type ProcessRunningInformation = _ProcessRunningInformation
export type ProcessInformation = _ProcessInformation
}
export default appManager;

View File

@ -27,7 +27,7 @@ import { AbilityResult as _AbilityResult } from "./ability/abilityResult";
import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions";
/**
* The context of an application. It allows access to application-specific resources.
* This module provides application context classes and common data structures.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9

View File

@ -18,7 +18,6 @@ import ApplicationStateObserver from './application/ApplicationStateObserver';
import AbilityStateData from './application/AbilityStateData';
import AppStateData from './application/AppStateData';
import { ProcessRunningInfo } from './application/ProcessRunningInfo';
import { ProcessRunningInformation } from './application/ProcessRunningInformation';
/**
* This module provides the function of app manager service.
@ -100,7 +99,7 @@ declare namespace appManager {
* @returns Returns the array of {@link ProcessRunningInfo}.
* @permission ohos.permission.GET_RUNNING_INFO
* @deprecated since 9
* @useinstead getProcessRunningInformation
* @useinstead ohos.app.ability.appManager#getRunningProcessInformation
*/
function getProcessRunningInfos(): Promise<Array<ProcessRunningInfo>>;
function getProcessRunningInfos(callback: AsyncCallback<Array<ProcessRunningInfo>>): void;

View File

@ -17,7 +17,7 @@ import { AsyncCallback } from "../basic";
import Context from "./Context";
import AbilityLifecycleCallback from "../@ohos.app.ability.AbilityLifecycleCallback";
import EnvironmentCallback from "../@ohos.app.ability.EnvironmentCallback";
import { ProcessRunningInformation } from "./ProcessRunningInformation";
import { ProcessInformation } from "./ProcessInformation";
/**
* The context of an application. It allows access to application-specific resources.
@ -100,23 +100,23 @@ export default class ApplicationContext extends Context {
/**
* Get information about running processes
* @returns { Promise<Array<ProcessRunningInformation>> } Returns the array of {@link ProcessRunningInformation}.
* @returns { Promise<Array<ProcessInformation>> } Returns the array of {@link ProcessInformation}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
getProcessRunningInformation(): Promise<Array<ProcessRunningInformation>>;
getRunningProcessInformation(): Promise<Array<ProcessInformation>>;
/**
* Get information about running processes
* @param { AsyncCallback<Array<ProcessRunningInformation>> } callback - The callback is used to return the array of {@link ProcessRunningInformation}.
* @param { AsyncCallback<Array<ProcessInformation>> } callback - The callback is used to return the array of {@link ProcessInformation}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
getProcessRunningInformation(callback: AsyncCallback<Array<ProcessRunningInformation>>): void;
getRunningProcessInformation(callback: AsyncCallback<Array<ProcessInformation>>): void;
/**
* Kill all processes of the application

View File

@ -14,12 +14,12 @@
*/
/**
* The class of an process running information.
* The class of an process information.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
*/
export interface ProcessRunningInformation {
export interface ProcessInformation {
/**
* @default process id
* @since 9

View File

@ -20,7 +20,7 @@
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @permission N/A
* @deprecated since 9
* @useinstead ProcessRunningInformation
* @useinstead ProcessInformation
*/
export interface ProcessRunningInfo {
/**
@ -28,7 +28,7 @@ export interface ProcessRunningInfo {
* @since 8
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @deprecated since 9
* @useinstead ProcessRunningInformation.pid
* @useinstead ProcessInformation.pid
*/
pid: number;
@ -37,7 +37,7 @@ export interface ProcessRunningInfo {
* @since 8
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @deprecated since 9
* @useinstead ProcessRunningInformation.uid
* @useinstead ProcessInformation.uid
*/
uid: number;
@ -46,7 +46,7 @@ export interface ProcessRunningInfo {
* @since 8
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @deprecated since 9
* @useinstead ProcessRunningInformation.processName
* @useinstead ProcessInformation.processName
*/
processName: string;
@ -55,7 +55,7 @@ export interface ProcessRunningInfo {
* @since 8
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @deprecated since 9
* @useinstead ProcessRunningInformation.bundleNames
* @useinstead ProcessInformation.bundleNames
*/
bundleNames: Array<string>;
}