harmony 鸿蒙Resource Scheduler Subsystem Changelog
Resource Scheduler Subsystem Changelog
cl.resourceschedule.workScheduler
The WorkSchedulerExtensionAbility provides a default WorkSchedulerExtensionContext.
Change Impact
Applications developed based on OpenHarmony4.0.5.1 and later SDK versions can use the default context attribute as the context environment of a WorkSchedulerExtension.
Key API/Component Changes
The context attribute is added to @ohos.WorkSchedulerExtensionAbility.d.ts. The application/WorkSchedulerExtensionContext.d.ts file is added, which is inherited from ExtensionContext.
|Module|Class|Method/Attribute/Enum/Constant|Change Type| | –|–|–|–| |@ohos.WorkSchedulerExtensionAbility.d.ts|WorkSchedulerExtensionAbility|context: WorkSchedulerExtensionContext;|Added| |application/WorkSchedulerExtensionContext.d.ts|WorkSchedulerExtensionContext|-|Added|
Adaptation Guide
The context is obtained through a WorkSchedulerExtensionAbility child class instance.
import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility';
class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility {
onWorkStart(workInfo) {
let WorkSchedulerExtensionContext = this.context; // Obtain the WorkSchedulerExtensionContext.
}
}
你可能感兴趣的鸿蒙文章
harmony 鸿蒙OpenHarmony Docker镜像
harmony 鸿蒙OpenHarmony Docker Image
harmony 鸿蒙IDL Specifications and User Guide (for System Applications Only)
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦