openharmony 鸿蒙 changelogs-resourceschedule

2023-06-24 浏览 (513)

Resource Scheduler Subsystem Changelog

cl.resourceschedule.backgroundTaskManager

Rectified the original APIs of backgroundTaskManager of the resource scheduler subsystem. All APIs of API version 9 in the @ohos.backgroundTaskManager.d.ts file are deleted, and the APIs of API version 9 in the @ohos.resourceschedule.backgroundTaskManager.d.ts file are used. The new APIs in API version 9 comply with the error code specifications.

Change Impacts

If your application is developed based on the SDK versions of OpenHarmony 3.2.10.5 and later, adapt to the modules and APIs in API version 9 and the pattern for returning error codes. Otherwise, the service logic will be affected.

Key API/Component Changes

The following methods, attributes, enums, and constants are changed in API version 9 and later versions. All the APIs in the @ohos.backgroundTaskManager.d.ts file are migrated to the @ohos.resourceschedule.backgroundTaskManager.d.ts file.

ClassAPI TypeDeclarationDescription
backgroundTaskManagermethodfunction resetAllEfficiencyResources(): void;Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction applyEfficiencyResources(request: EfficiencyResourcesRequest): bool;Changed in API version 9 to function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumexport enum ResourceTypeDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumCPU = 1Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumCOMMON_EVENT = 1 << 1Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumTIMER = 1 << 2Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumWORK_SCHEDULER = 1 << 3Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumBLUETOOTH = 1 << 4Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumGPS = 1 << 5Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumAUDIO = 1 << 6Deleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestinterfaceexport interface EfficiencyResourcesRequestDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldreason: stringDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldisProcess?: boolDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldisPersist?: boolDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldtimeOut: numberDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldisApply: boolDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldresourceTypes: numberDeleted in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.

Adaptation Guide

Import the backgroundTaskManager module.

import bundle form '@ohos.resourceschedule.backgroundTaskManager'

Exception handling also needs to be adapted. For details, see the backgroundTaskManager API reference.

c2.resourceschedule.workScheduler

Rectified the original APIs of workScheduler of the resource scheduler subsystem. All APIs of API version 9 in the @ohos.workScheduler.d.ts file are deleted, and the APIs of API version 9 in the @ohos.resourceschedule.workScheduler.d.ts file are used. The new APIs in API version 9 comply with the error code specifications.

Change Impacts

If your application is developed based on the SDK versions of OpenHarmony 3.2.10.5 and later, adapt to the modules and APIs in API version 9 and the pattern for returning error codes. Otherwise, the service logic will be affected.

Key API/Component Changes

The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The @ohos.workScheduler.d.ts file is deleted, and all the APIs in it are moved to the @ohos.resourceschedule.workScheduler.d.ts file.

ClassAPI TypeDeclarationChange Type
workSchedulernamespacedeclare namespace workSchedulerDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfointerfaceexport interface WorkInfoDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldparameters?: {[key: string]: any}Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldidleWaitTime?: numberDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldisDeepIdle?: booleanDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldrepeatCount?: numberDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldisRepeat?: booleanDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldrepeatCycleTime?: numberDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldstorageRequest?: StorageRequestDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldbatteryStatus?: BatteryStatusDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldbatteryLevel?: numberDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldchargerType?: ChargingTypeDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldisCharging?: booleanDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldnetworkType?: NetworkTypeDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldisPersisted?: booleanDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldabilityName: stringDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldbundleName: stringDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfofieldworkId: numberDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction isLastWorkTimeOut(workId: number): Promise;Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean;Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction stopAndClearWorks(): boolean;Changed in API version 8 to function stopAndClearWorks(): boolean; and moved to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction obtainAllWorks(): Promise<Array>;Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction obtainAllWorks(callback: AsyncCallback): Array;Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction getWorkStatus(workId: number): Promise;Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction getWorkStatus(workId: number, callback: AsyncCallback): void;Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction stopWork(work: WorkInfo, needCancel?: boolean): boolean;Changed in API version 8 to function stopWork(work: WorkInfo, needCancel?: boolean): void; and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workSchedulermethodfunction startWork(work: WorkInfo): boolean;Changed in API version 9 to function startWork(work: WorkInfo): void; and moved to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumexport enum NetworkTypeDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkTypeenumNETWORK_TYPE_ANY = 0Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkTypeenumNETWORK_TYPE_MOBILEDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkTypeenumNETWORK_TYPE_WIFIDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkTypeenumNETWORK_TYPE_BLUETOOTHDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkTypeenumNETWORK_TYPE_WIFI_P2PDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkTypeenumNETWORK_TYPE_ETHERNETDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingTypeenumexport enum ChargingTypeDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingTypeenumCHARGING_PLUGGED_ANY = 0Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingTypeenumCHARGING_PLUGGED_ACDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingTypeenumCHARGING_PLUGGED_USBDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingTypeenumCHARGING_PLUGGED_WIRELESSDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatusenumexport enum BatteryStatusDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatusenumBATTERY_STATUS_LOW = 0Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatusenumBATTERY_STATUS_OKAYDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatusenumBATTERY_STATUS_LOW_OR_OKAYDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.StorageRequestenumexport enum StorageRequestDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatusenumSTORAGE_LEVEL_LOW = 0Deleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatusenumSTORAGE_LEVEL_OKAYDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatusenumSTORAGE_LEVEL_LOW_OR_OKAYDeleted in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.

Adaptation Guide

Import the workScheduler module.

import bundle form '@ohos.resourceschedule.workScheduler'

Exception handling also needs to be adapted. For details, see the workScheduler API reference.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Readme

harmony 鸿蒙Example Subsystem Changelog

harmony 鸿蒙Ability Framework Changelog

harmony 鸿蒙Account Subsystem Changelog

harmony 鸿蒙ArkUI Subsystem ChangeLog

harmony 鸿蒙Multimedia Subsystem Changelog

harmony 鸿蒙Common Library Subsystem Changelog

harmony 鸿蒙Distributed Data Management Subsystem JS API Changelog

harmony 鸿蒙File Management Subsystem Changelog

harmony 鸿蒙Input Method Framework ChangeLog

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