!10297 首帧完成事件接口定义

Merge pull request !10297 from 孙旭辉/master
This commit is contained in:
openharmony_ci 2024-04-11 16:16:06 +00:00 committed by Gitee
commit b35f0929f1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 176 additions and 0 deletions

View File

@ -25,6 +25,8 @@ import * as _AbilityStateData from './application/AbilityStateData';
import * as _AppStateData from './application/AppStateData';
import type * as _ProcessData from './application/ProcessData';
import { ProcessInformation as _ProcessInformation } from './application/ProcessInformation';
import * as _AbilityFirstFrameStateObserver from './application/AbilityFirstFrameStateObserver';
import * as _AbilityFirstFrameStateData from './application/AbilityFirstFrameStateData';
/**
* This module provides the function of app manager service.
@ -239,6 +241,23 @@ declare namespace appManager {
* @since 11
*/
function on(type: 'appForegroundState', observer: AppForegroundStateObserver): void;
/**
* Register ability first frame state observe.
*
* @permission ohos.permission.RUNNING_STATE_OBSERVER
* @param { 'abilityFirstFrameState' } type - The ability first frame drawing state.
* @param { AbilityFirstFrameStateObserver } observer - The ability first frame state observer.
* @param { string } [bundleName] - The target bundle name.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
function on(type: 'abilityFirstFrameState', observer: AbilityFirstFrameStateObserver, bundleName?: string): void;
/**
* Unregister application state observer.
@ -289,6 +308,22 @@ declare namespace appManager {
* @since 11
*/
function off(type: 'appForegroundState', observer?: AppForegroundStateObserver): void;
/**
* Unregister ability first frame state observer.
*
* @permission ohos.permission.RUNNING_STATE_OBSERVER
* @param { 'abilityFirstFrameState' } type - The ability first frame drawing state.
* @param { AbilityFirstFrameStateObserver } [observer] - The ability first frame state observer.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
function off(type: 'abilityFirstFrameState', observer?: AbilityFirstFrameStateObserver): void;
/**
* getForegroundApplications.
@ -794,6 +829,24 @@ declare namespace appManager {
* @since 10
*/
export type ProcessData = _ProcessData.default;
/**
* The ability first frame state observer.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
export type AbilityFirstFrameStateObserver = _AbilityFirstFrameStateObserver.default;
/**
* The class of an ability first frame state data.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
export type AbilityFirstFrameStateData = _AbilityStateData.default;
}
export default appManager;

View File

@ -0,0 +1,81 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"),
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit AbilityKit
*/
/**
* The ability first frame state data.
*
* @typedef AbilityFirstFrameStateData
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
export interface AbilityFirstFrameStateData {
/**
* The bundle name.
*
* @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
bundleName: string;
/**
* The module name.
*
* @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
moduleName: string;
/**
* The ability name.
*
* @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
abilityName: string;
/**
* The index of DLP sandbox.
*
* @type { number }
* @default 0
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
appIndex: number;
/**
* The entry ability of application is cold-start return true, others false.
*
* @type { boolean }
* @default false
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
isColdStart: boolean;
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityFirstFrameStateData from './AbilityFirstFrameStateData';
/**
* @file
* @kit AbilityKit
*/
/**
* The ability first frame state observer.
*
* @interface AbilityFirstFrameStateObserver
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
export interface AbilityFirstFrameStateObserver {
/**
* Will be called when an ability first frame drawing completed.
*
* @param { AbilityFirstFrameStateData } data - The ability first frame state data.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
onAbilityFirstFrameDrawn(data: AbilityFirstFrameStateData): void;
}