harmony 鸿蒙Resource Scheduler Subsystem Changelog

  • 2023-06-24
  • 浏览 (284)

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 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙OpenHarmony Docker镜像

harmony 鸿蒙OpenHarmony Docker Image

harmony 鸿蒙Legal Notices

harmony 鸿蒙OpenHarmony Project

harmony 鸿蒙IDL Specifications and User Guide (for System Applications Only)

harmony 鸿蒙Application Development

harmony 鸿蒙OAID Service

harmony 鸿蒙AI

0  赞