Resource Scheduler Subsystem Changelog

cl.resourceschedule.backgroundTaskManager

Rectified original APIs of backgroundTaskManager of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications.

Change Impact

The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original 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.backgroundTaskManager.d.ts file is deprecated and related APIs are moved to the newly added @ohos.resourceschedule.backgroundTaskManager.d.ts file.

Class API Type Declaration Description
backgroundTaskManager namespace declare namespace backgroundTaskManager Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function resetAllEfficiencyResources(): void; Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function 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 method function stopBackgroundRunning(context: Context): Promise; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function getRemainingDelayTime(requestId: number): Promise; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager method function cancelSuspendDelay(requestId: number): void; Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum export enum BackgroundMode Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum DATA_TRANSFER = 1 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum AUDIO_PLAYBACK = 2 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum AUDIO_RECORDING = 3 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum LOCATION = 4 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum BLUETOOTH_INTERACTION = 5 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum MULTI_DEVICE_CONNECTION = 6 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum WIFI_INTERACTION = 7 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum VOIP = 8 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundMode enum TASK_KEEPING = 9 Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.DelaySuspendInfo interface interface DelaySuspendInfo Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.DelaySuspendInfo field requestId: number Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.DelaySuspendInfo field actualDelayTime: number Deprecated in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum export enum ResourceType Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum CPU = 1 Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum COMMON_EVENT = 1 << 1 Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum TIMER = 1 << 2 Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum WORK_SCHEDULER = 1 << 3 Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum BLUETOOTH = 1 << 4 Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum GPS = 1 << 5 Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceType enum AUDIO = 1 << 6 Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequest interface export interface EfficiencyResourcesRequest Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequest field reason: string Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequest field isProcess?: bool Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequest field isPersist?: bool Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequest field timeOut: number Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequest field isApply: bool Changed in API version 9 and moved to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequest field resourceTypes: number Changed 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.usageStatistics

Rectified original APIs of deviceUsageStatistics of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications.

Change Impact

The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original 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.bundleState.d.ts file is deprecated, the @ohos.resourceschedule.usageStatistics.d.ts file is added, and the class name is changed from bundleState to usageStatistics.

Class API Type Method/Attribute/Enum/Constant Change Type
bundleState method function isIdleState(bundleName: string, callback: AsyncCallback): void; Deprecated and moved to usageStatistics.isIdleState.
bundleState method function isIdleState(bundleName: string): Promise; Deprecated and moved to usageStatistics.isIdleState.
bundleState method function queryAppUsagePriorityGroup(callback: AsyncCallback): void; Deprecated and changed to function queryAppGroup(callback: AsyncCallback): void;.
bundleState method function queryAppUsagePriorityGroup(): Promise; Deprecated and changed to function queryAppGroup(): Promise;.
bundleState method function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; Deprecated and changed to function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void;.
bundleState method function queryBundleStateInfos(begin: number, end: number): Promise; Deprecated and changed to function queryBundleStatsInfos(begin: number, end: number): Promise;.
bundleState method function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array>; Deprecated and changed to function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array>;.
bundleState method function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array>): void; Deprecated and changed to function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array>): void;.
bundleState method function queryBundleActiveStates(begin: number, end: number): Promise<Array>; Deprecated and changed to function queryBundleEvents(begin: number, end: number): Promise<Array>;.
bundleState method function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array>): void; Deprecated and changed to function queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array>): void;.
bundleState method function queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array>; Deprecated and changed to function queryCurrentBundleEvents(begin: number, end: number): Promise<Array>;.
bundleState method function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array>): void; Deprecated and changed to function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<Array>): void;.
bundleState method function getRecentlyUsedModules(maxNum?: number): Promise<Array>; Deprecated and changed to function QueryModuleUsageRecords(maxNum: number): Promise<Array>; and function QueryModuleUsageRecords(): Promise<Array>;.
bundleState method function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array>): void; Deprecated and changed to function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array>): void; and function QueryModuleUsageRecords(callback: AsyncCallback<Array>): void;.
bundleState method function queryAppUsagePriorityGroup(bundleName? : string): Promise; Deprecated and changed to function queryAppGroup(bundleName: string): Promise;.
bundleState method function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; Deprecated and changed to function queryAppGroup(bundleName: string, callback: AsyncCallback): void;.
bundleState method function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; Deprecated and changed to function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;.
bundleState method function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; Deprecated and changed to function setAppGroup(bundleName: string, newGroup: GroupType): Promise;.
bundleState method function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; Deprecated and changed to function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void;.
bundleState method function registerGroupCallBack(callback: Callback): Promise; Deprecated and changed to function registerAppGroupCallBack(callback: Callback): Promise;.
bundleState method function unRegisterGroupCallBack(callback: AsyncCallback): void; Changed to function unregisterAppGroupCallBack(): Promise;.
bundleState method function unRegisterGroupCallBack(): Promise; Changed to function unregisterAppGroupCallBack(): Promise;.
bundleState method function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array>): void; Changed to function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Array>): void;
bundleState method function queryBundleActiveEventStates(begin: number, end: number): Promise<Array>; Changed in API version 9 to function queryDeviceEventStats(begin: number, end: number): Promise<Array>;.
bundleState method function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array>): void; Changed in API version 9 to function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback<Array>): void;.
bundleState method function queryAppNotificationNumber(begin: number, end: number): Promise<Array>; Changed in API version 9 to function queryNotificationEventStats(begin: number, end: number): Promise<Array>;.
bundleState.BundleActiveGroupCallbackInfo interface interface BundleActiveGroupCallbackInfo Moved to usageStatistics.AppGroupCallbackInfo.
bundleState.BundleActiveGroupCallbackInfo field bundleName: string Moved to usageStatistics.AppGroupCallbackInfo.
bundleState.BundleActiveGroupCallbackInfo field changeReason: number Moved to usageStatistics.AppGroupCallbackInfo.
bundleState.BundleActiveGroupCallbackInfo field userId: number Moved to usageStatistics.AppGroupCallbackInfo.
bundleState.BundleActiveGroupCallbackInfo field appUsageNewGroup: number Deprecated and changed to appNewGroup.
bundleState.BundleActiveGroupCallbackInfo field appUsageOldGroup: number Deprecated and changed to appOldGroup.
bundleState.BundleActiveEventState interface interface BundleActiveEventState Deprecated and changed to usageStatistics.DeviceEventStats.
bundleState.BundleActiveEventState field count: number Moved to usageStatistics.DeviceEventStats.
bundleState.BundleActiveEventState field eventId: number Moved to usageStatistics.DeviceEventStats.
bundleState.BundleActiveEventState field name: string Moved to usageStatistics.DeviceEventStats.
bundleState.BundleActiveModuleInfo interface interface BundleActiveModuleInfo Changed in API version 9 to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field formRecords: Array Changed to formRecords: Array.
bundleState.BundleActiveModuleInfo field lastModuleUsedTime: number Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field launchedCount: number Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field abilityIconId?: number Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field abilityDescriptionId?: number Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field abilityLableId?: number Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field descriptionId?: number; Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field labelId?: number Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field appLabelId?: number Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field abilityName?: string Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field moduleName: string Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field bundleName: string Moved to usageStatistics.HapModuleInfo.
bundleState.BundleActiveModuleInfo field deviceId?: string Moved to usageStatistics.HapModuleInfo.
bundleState.GroupType enum enum GroupType Moved to usageStatistics.GroupType.
bundleState.GroupType enum ACTIVE_GROUP_ALIVE Deprecated and changed to ALIVE_GROUP.
bundleState.GroupType enum ACTIVE_GROUP_DAILY Deprecated and changed to DAILY_GROUP.
bundleState.GroupType enum ACTIVE_GROUP_FIXED Deprecated and changed to FIXED_GROUP.
bundleState.GroupType enum ACTIVE_GROUP_RARE Deprecated and changed to RARE_GROUP.
bundleState.GroupType enum ACTIVE_GROUP_LIMIT Deprecated and changed to LIMITED_GROUP.
bundleState.GroupType enum ACTIVE_GROUP_NEVER Deprecated and changed to NEVER_GROUP.
bundleState.IntervalType enum enum IntervalType Deprecated and moved to usageStatistics.IntervalType.
bundleState.IntervalType enum BY_OPTIMIZED Deprecated and moved to usageStatistics.IntervalType.
bundleState.IntervalType enum BY_DAILY Deprecated and moved to usageStatistics.IntervalType.
bundleState.IntervalType enum BY_WEEKLY Deprecated and moved to usageStatistics.IntervalType.
bundleState.IntervalType enum BY_MONTHLY Deprecated and moved to usageStatistics.IntervalType.
bundleState.IntervalType enum BY_ANNUALLY Deprecated and moved to usageStatistics.IntervalType.
bundleState.BundleActiveInfoResponse interface interface BundleActiveInfoResponse Deprecated and changed to usageStatistics.BundleStatsMap.
bundleState.BundleActiveState interface interface BundleActiveState Deprecated and changed to usageStatistics.BundleEvents.
bundleState.BundleActiveState field stateType?: number Deprecated and changed to eventId.
bundleState.BundleActiveState field stateOccurredTime?: number Deprecated and changed to eventOccurredTime.
bundleState.BundleActiveState field nameOfClass?: string Deprecated and moved to usageStatistics.BundleEvents.
bundleState.BundleActiveState field indexOfLink?: string Deprecated and moved to usageStatistics.BundleEvents.
bundleState.BundleActiveState field bundleName?: string Deprecated and moved to usageStatistics.BundleEvents.
bundleState.BundleActiveState field appUsagePriorityGroup?: number Deprecated and changed to appGroup.
bundleState.BundleStateInfo interface interface BundleStateInfo Deprecated and changed to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo method merge(toMerge: BundleStateInfo): void Deprecated.
bundleState.BundleStateInfo field infosEndTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field infosBeginTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field fgAbilityPrevAccessTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field fgAbilityAccessTotalTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field bundleName?: string Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field abilitySeenTotalTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field abilityPrevSeenTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field abilityPrevAccessTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field abilityInFgTotalTime?: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState.BundleStateInfo field id: number Deprecated and moved to usageStatistics.BundleStatsInfo.
bundleState namespace declare namespace bundleState Deprecated and changed to usageStatistics, and moved to ohos.resourceschedule.usageStatistics.d.ts.

Adaptation Guide

Import the usageStatistics module.

import bundle form '@ohos.resourceschedule.usageStatistics'

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

c3.resourceschedule.workScheduler

Rectified original APIs of workScheduler of the resource scheduler subsystem. The original APIs in API version 9 are changed to new APIs in API version 9. The new APIs in API version 9 comply with the error code specifications.

Change Impact

The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original 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 deprecated and related APIs are moved to the newly added @ohos.resourceschedule.workScheduler.d.ts file.

Class API Type Declaration Change Type
workScheduler namespace declare namespace workScheduler Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo interface export interface WorkInfo Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field parameters?: {[key: string]: any} Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field idleWaitTime?: number Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field isDeepIdle?: boolean Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field repeatCount?: number Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field isRepeat?: boolean Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field repeatCycleTime?: number Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field storageRequest?: StorageRequest Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field batteryStatus?: BatteryStatus Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field batteryLevel?: number Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field chargerType?: ChargingType Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field isCharging?: boolean Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field networkType?: NetworkType Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field isPersisted?: boolean Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field abilityName: string Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field bundleName: string Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.WorkInfo field workId: number Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function isLastWorkTimeOut(workId: number): Promise; Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function stopAndClearWorks(): boolean; Changed in API version 8 to function stopAndClearWorks(): boolean; and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function obtainAllWorks(): Promise<Array>; Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function obtainAllWorks(callback: AsyncCallback): Array; Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function getWorkStatus(workId: number): Promise; Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function getWorkStatus(workId: number, callback: AsyncCallback): void; Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler method function 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.
workScheduler method function 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.NetworkType enum export enum NetworkType Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkType enum NETWORK_TYPE_ANY = 0 Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkType enum NETWORK_TYPE_MOBILE Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkType enum NETWORK_TYPE_WIFI Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkType enum NETWORK_TYPE_BLUETOOTH Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkType enum NETWORK_TYPE_WIFI_P2P Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.NetworkType enum NETWORK_TYPE_ETHERNET Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingType enum export enum ChargingType Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingType enum CHARGING_PLUGGED_ANY = 0 Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingType enum CHARGING_PLUGGED_AC Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingType enum CHARGING_PLUGGED_USB Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.ChargingType enum CHARGING_PLUGGED_WIRELESS Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatus enum export enum BatteryStatus Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatus enum BATTERY_STATUS_LOW = 0 Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatus enum BATTERY_STATUS_OKAY Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatus enum BATTERY_STATUS_LOW_OR_OKAY Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.StorageRequest enum export enum StorageRequest Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatus enum STORAGE_LEVEL_LOW = 0 Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatus enum STORAGE_LEVEL_OKAY Changed in API version 9 and moved to the ohos.resourceschedule.workScheduler.d.ts file.
workScheduler.BatteryStatus enum STORAGE_LEVEL_LOW_OR_OKAY Changed 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.

c4.resourceschedule.reminderAgent

Rectified original APIs of reminderAgent of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications.

Change Impact

The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original 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.reminderAgent.d.ts file is deprecated, the @ohos.reminderAgentManager.d.ts file is added, and the class name is changed from reminderAgent to reminderAgentManager.

Class API Type Method/Attribute/Enum/Constant Change Type
reminderAgent method publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; Deprecated and moved to reminderAgentManager.
reminderAgent method publishReminder(reminderReq: ReminderRequest): Promise; Deprecated and moved to reminderAgentManager.
reminderAgent method cancelReminder(reminderId: number, callback: AsyncCallback): void; Deprecated and moved to reminderAgentManager.
reminderAgent method cancelReminder(reminderId: number): Promise; Deprecated and moved to reminderAgentManager.
reminderAgent method getValidReminders(callback: AsyncCallback<Array>): void; Deprecated and moved to reminderAgentManager.
reminderAgent method getValidReminders(): Promise<Array>; Deprecated and moved to reminderAgentManager.
reminderAgent method cancelAllReminders(callback: AsyncCallback): void; Deprecated and moved to reminderAgentManager.
reminderAgent method cancelAllReminders(): Promise; Deprecated and moved to reminderAgentManager.
reminderAgent method addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; Deprecated and moved to reminderAgentManager.
reminderAgent method addNotificationSlot(slot: NotificationSlot): Promise; Deprecated and moved to reminderAgentManager.
reminderAgent method removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; Deprecated and moved to reminderAgentManager.
reminderAgent method removeNotificationSlot(slotType: notification.SlotType): Promise; Deprecated and moved to reminderAgentManager.
reminderAgent.ActionButtonType enum ACTION_BUTTON_TYPE_CLOSE Deprecated and moved to reminderAgentManager.ActionButtonType.
reminderAgent.ActionButtonType enum ACTION_BUTTON_TYPE_SNOOZE Deprecated and moved to reminderAgentManager.ActionButtonType.
reminderAgent.ReminderType enum REMINDER_TYPE_TIMER Deprecated and moved to reminderAgentManager.ReminderType.
reminderAgent.ReminderType enum REMINDER_TYPE_CALENDAR Deprecated and moved to reminderAgentManager.ReminderType.
reminderAgent.ReminderType enum REMINDER_TYPE_CALENDAR Deprecated and moved to reminderAgentManager.ReminderType.
reminderAgent.ActionButton field title:string Deprecated and moved to reminderAgentManager.ActionButton.
reminderAgent.ActionButton field type:ActionButtonType Deprecated and moved to reminderAgentManager.ActionButton.
reminderAgent.WantAgent field pkgName:string Deprecated and moved to reminderAgentManager.WantAgent.
reminderAgent.WantAgent field abilityName:string Deprecated and moved to reminderAgentManager.WantAgent.
reminderAgent.MaxScreenWantAgent field pkgName:string Deprecated and moved to reminderAgentManager.MaxScreenWantAgent.
reminderAgent.MaxScreenWantAgent field abilityName:string Deprecated and moved to reminderAgentManager.MaxScreenWantAgent.
reminderAgent.ReminderRequest field reminderType:ReminderType Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field actionButton?:ActionButton Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field wantAgent?:WantAgent Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field maxScreenWantAgent?:MaxScreenWantAgent Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field ringDuration?:number Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field snoozeTimes?:number Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field timeInterval?:number Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field title?:string Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field content?:string Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field expiredContent?:string Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field snoozeContent?:string Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field notificationId?:number Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequest field slotType?: notification.SlotType Deprecated and moved to reminderAgentManager.ReminderRequest.
reminderAgent.ReminderRequestCalendar field dateTime:LocalDateTime Deprecated and moved to reminderAgentManager.ReminderRequestCalendar.
reminderAgent.ReminderRequestCalendar field repeatMonths?:Array Deprecated and moved to reminderAgentManager.ReminderRequestCalendar.
reminderAgent.ReminderRequestCalendar field repeatDays?:Array Deprecated and moved to reminderAgentManager.ReminderRequestCalendar.
reminderAgent.ReminderRequestAlarm field hour:number Deprecated and moved to reminderAgentManager.ReminderRequestAlarm.
reminderAgent.ReminderRequestAlarm field minute:number Deprecated and moved to reminderAgentManager.ReminderRequestAlarm.
reminderAgent.ReminderRequestAlarm field daysOfWeek?:Array Deprecated and moved to reminderAgentManager.ReminderRequestAlarm.
reminderAgent.ReminderRequestTimer field triggerTimeInSeconds:number Deprecated and moved to reminderAgentManager.ReminderRequestTimer.
reminderAgent.LocalDateTime field year:number Deprecated and moved to reminderAgentManager.LocalDateTime.
reminderAgent.LocalDateTime field month:number Deprecated and moved to reminderAgentManager.LocalDateTime.
reminderAgent.LocalDateTime field day:number Deprecated and moved to reminderAgentManager.LocalDateTime.
reminderAgent.LocalDateTime field hour:number Deprecated and moved to reminderAgentManager.LocalDateTime.
reminderAgent.LocalDateTime field minute:number Deprecated and moved to reminderAgentManager.LocalDateTime.
reminderAgent.LocalDateTime field second?:number Deprecated and moved to reminderAgentManager.LocalDateTime.

Adaptation Guide

Import the reminderAgentManager module.

import bundle form '@ohos.reminderAgentManager'

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