public interface IAbilityMonitor
Ability objects that meet specified
conditions. The most recently matched Ability objects will be saved in the
IAbilityMonitor object.
You can call IAbilityDelegator#addAbilityMonitor(String) to add the Ability objects to be
monitored and then use methods provided in IAbilityMonitor to obtain the monitored Ability
objects when newAbility objects are started or the lifecycle states of monitored abilities have changed.
SystemCapability.Aafwk#ABILITY| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Ability |
waitForAbility() |
Waits for and returns the state-changing
Ability object that matches the conditions specified in this
monitor within 5 seconds. |
Ability |
waitForAbility(long timeoutMillisecond) |
Waits for and returns the state-changing
Ability object that matches the conditions specified in this
monitor within the specified time. |
Ability waitForAbility(long timeoutMillisecond)
Ability object that matches the conditions specified in this
monitor within the specified time.
The current thread will be blocked until the timer specified by timeoutMillisecond expires.
timeoutMillisecond - Indicates the maximum amount of time to wait, in milliseconds. The value must be a
positive integer.Ability object if any object whose lifecycle state has changed is matched within the
specified time; returns null otherwise.Ability waitForAbility()
Ability object that matches the conditions specified in this
monitor within 5 seconds.
The current thread will be blocked until the 5-second default timer expires.
Ability object if any object whose lifecycle state has changed is matched within 5
seconds; returns null otherwise.