harmony(鸿蒙)AbilityDelegatorRegistry

2022-08-09 浏览 (791)

AbilityDelegatorRegistry

The AbilityDelegatorRegistry module provides APIs for storing the global registers of the registered AbilityDelegator and AbilityDelegatorArgs objects. You can use the APIs to obtain the AbilityDelegator and AbilityDelegatorArgs objects of an application.

NOTE

The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'

AbilityLifecycleState

Enumerates the ability lifecycle states.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameValueDescription
UNINITIALIZED0The ability is in an invalid state.
CREATE1The ability is created.
FOREGROUND2The ability is running in the foreground.
BACKGROUND3The ability is running in the background.
DESTROY4The ability is destroyed.

AbilityDelegatorRegistry.getAbilityDelegator

getAbilityDelegator(): AbilityDelegator

Obtains the AbilityDelegator object of the application.

System capability: SystemCapability.Ability.AbilityRuntime.Core

Return value

TypeDescription
AbilityDelegatorAbilityDelegator object, which can be used to schedule functions related to the test framework.

Example

var abilityDelegator;

abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();

AbilityDelegatorRegistry.getArguments

getArguments(): AbilityDelegatorArgs

Obtains the AbilityDelegatorArgs object of the application.

System capability: SystemCapability.Ability.AbilityRuntime.Core

Return value

TypeDescription
AbilityDelegatorArgsAbilityDelegatorArgs object, which can be used to obtain test parameters.

Example

var args = AbilityDelegatorRegistry.getArguments();
console.info("getArguments bundleName:" + args.bundleName);
console.info("getArguments testCaseNames:" + args.testCaseNames);
console.info("getArguments testRunnerClassName:" + args.testRunnerClassName);

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)APIs

harmony(鸿蒙)API Reference Document Description

harmony(鸿蒙)BundleStatusCallback

harmony(鸿蒙)innerBundleManager(deprecated)

harmony(鸿蒙)distributedBundle

harmony(鸿蒙)Bundle

harmony(鸿蒙)Context

harmony(鸿蒙)DataUriUtils

harmony(鸿蒙)EnterpriseAdminExtensionAbility

harmony(鸿蒙)Work Scheduler Callbacks

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/44d70d71911c4bc082a8634d7ce0e76b