openharmony 鸿蒙 changelog-resourceschedule

2023-02-03 浏览 (441)

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 Impacts

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, enumerations, and constants are changed in API version 9 and later versions. The @ohos.backgroundTaskManager.d.ts file is deprecated and related APIs are migrated to the newly added @ohos.resourceschedule.backgroundTaskManager.d.ts file.

ClassAPI TypeDeclarationDescription
backgroundTaskManagernamespacedeclare namespace backgroundTaskManagerThis API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction resetAllEfficiencyResources(): void;This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction applyEfficiencyResources(request: EfficiencyResourcesRequest): bool;This API is changed in API version 9 to function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction stopBackgroundRunning(context: Context): Promise;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction stopBackgroundRunning(context: Context, callback: AsyncCallback): void;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction getRemainingDelayTime(requestId: number): Promise;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction getRemainingDelayTime(requestId: number, callback: AsyncCallback): void;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManagermethodfunction cancelSuspendDelay(requestId: number): void;This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumexport enum BackgroundModeThis API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumDATA_TRANSFER = 1This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumAUDIO_PLAYBACK = 2This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumAUDIO_RECORDING = 3This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumLOCATION = 4This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumBLUETOOTH_INTERACTION = 5This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumMULTI_DEVICE_CONNECTION = 6This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumWIFI_INTERACTION = 7This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumVOIP = 8This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.BackgroundModeenumTASK_KEEPING = 9This API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.DelaySuspendInfointerfaceinterface DelaySuspendInfoThis API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.DelaySuspendInfofieldrequestId: numberThis API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.DelaySuspendInfofieldactualDelayTime: numberThis API is deprecated in API version 9 and later versions and is migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumexport enum ResourceTypeThis API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumCPU = 1This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumCOMMON_EVENT = 1 << 1This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumTIMER = 1 << 2This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumWORK_SCHEDULER = 1 << 3This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumBLUETOOTH = 1 << 4This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumGPS = 1 << 5This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.ResourceTypeenumAUDIO = 1 << 6This API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestinterfaceexport interface EfficiencyResourcesRequestThis API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldreason: stringThis API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldisProcess?: boolThis API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldisPersist?: boolThis API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldtimeOut: numberThis API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldisApply: boolThis API is changed in API version 9 and migrated to the ohos.resourceschedule.backgroundTaskManager.d.ts file.
backgroundTaskManager.EfficiencyResourcesRequestfieldresourceTypes: numberThis API is changed in API version 9 and migrated 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 Impacts

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, enumerations, 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.

ClassAPI TypeMethod/Attribute/Enumeration/ConstantChange Type
bundleStatemethodfunction isIdleState(bundleName: string, callback: AsyncCallback): void;Deprecated and migrated to usageStatistics.isIdleState
bundleStatemethodfunction isIdleState(bundleName: string): Promise;Deprecated and migrated to usageStatistics.isIdleState
bundleStatemethodfunction queryAppUsagePriorityGroup(callback: AsyncCallback): void;Deprecated and changed to function queryAppGroup(callback: AsyncCallback): void;
bundleStatemethodfunction queryAppUsagePriorityGroup(): Promise;Deprecated and changed to function queryAppGroup(): Promise;
bundleStatemethodfunction queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void;Deprecated and changed to function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void;
bundleStatemethodfunction queryBundleStateInfos(begin: number, end: number): Promise;Deprecated and changed to function queryBundleStatsInfos(begin: number, end: number): Promise;
bundleStatemethodfunction queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array>;Deprecated and changed to function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array>;
bundleStatemethodfunction 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;
bundleStatemethodfunction queryBundleActiveStates(begin: number, end: number): Promise<Array>;Deprecated and changed to function queryBundleEvents(begin: number, end: number): Promise<Array>;
bundleStatemethodfunction queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array>): void;Deprecated and changed to function queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array>): void;
bundleStatemethodfunction queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array>;Deprecated and changed to function queryCurrentBundleEvents(begin: number, end: number): Promise<Array>;
bundleStatemethodfunction queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array>): void;Deprecated and changed to function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<Array>): void;
bundleStatemethodfunction getRecentlyUsedModules(maxNum?: number): Promise<Array>;Deprecated and changed to the following two APIs: function QueryModuleUsageRecords(maxNum: number): Promise<Array>; and function QueryModuleUsageRecords(): Promise<Array>;
bundleStatemethodfunction getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array>): void;Deprecated and changed to the following two APIs: function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array>): void; and function QueryModuleUsageRecords(callback: AsyncCallback<Array>): void;
bundleStatemethodfunction queryAppUsagePriorityGroup(bundleName? : string): Promise;Deprecated and changed to function queryAppGroup(bundleName: string): Promise;
bundleStatemethodfunction queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void;Deprecated and changed to function queryAppGroup(bundleName: string, callback: AsyncCallback): void;
bundleStatemethodfunction setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;Deprecated and changed to function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;
bundleStatemethodfunction setBundleGroup(bundleName: string, newGroup: GroupType): Promise;Deprecated and changed to function setAppGroup(bundleName: string, newGroup: GroupType): Promise;
bundleStatemethodfunction registerGroupCallBack(callback: Callback, callback: AsyncCallback): void;Deprecated and changed to function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void;
bundleStatemethodfunction registerGroupCallBack(callback: Callback): Promise;Deprecated and changed to function registerAppGroupCallBack(callback: Callback): Promise;
bundleStatemethodfunction unRegisterGroupCallBack(callback: AsyncCallback): void;Deprecated and changed to function unregisterAppGroupCallBack(): Promise;
bundleStatemethodfunction unRegisterGroupCallBack(): Promise;Deprecated and changed to function unregisterAppGroupCallBack(): Promise;
bundleStatemethodfunction queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array>): void;Changed to function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Array>): void;
bundleStatemethodfunction queryBundleActiveEventStates(begin: number, end: number): Promise<Array>;Changed in API version 9 and later versions to function queryDeviceEventStats(begin: number, end: number): Promise<Array>;
bundleStatemethodfunction queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array>): void;Changed in API version 9 and later versions to function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback<Array>): void;
bundleStatemethodfunction queryAppNotificationNumber(begin: number, end: number): Promise<Array>;Changed in API version 9 and later versions to function queryNotificationEventStats(begin: number, end: number): Promise<Array>;
bundleState.BundleActiveGroupCallbackInfointerfaceinterface BundleActiveGroupCallbackInfoChanged to usageStatistics.AppGroupCallbackInfo
bundleState.BundleActiveGroupCallbackInfofieldbundleName: stringChanged and migrated to usageStatistics.AppGroupCallbackInfo
bundleState.BundleActiveGroupCallbackInfofieldchangeReason: numberChanged and migrated to usageStatistics.AppGroupCallbackInfo
bundleState.BundleActiveGroupCallbackInfofielduserId: numberChanged and migrated to usageStatistics.AppGroupCallbackInfo
bundleState.BundleActiveGroupCallbackInfofieldappUsageNewGroup: numberDeprecated and changed to appNewGroup
bundleState.BundleActiveGroupCallbackInfofieldappUsageOldGroup: numberDeprecated and changed to appOldGroup
bundleState.BundleActiveEventStateinterfaceinterface BundleActiveEventStateDeprecated and changed to usageStatistics.DeviceEventStats
bundleState.BundleActiveEventStatefieldcount: numberChanged and migrated to usageStatistics.DeviceEventStats
bundleState.BundleActiveEventStatefieldeventId: numberChanged and migrated to usageStatistics.DeviceEventStats
bundleState.BundleActiveEventStatefieldname: stringChanged and migrated to usageStatistics.DeviceEventStats
bundleState.BundleActiveModuleInfointerfaceinterface BundleActiveModuleInfoChanged in API version 9 and later versions to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldformRecords: ArrayChanged to formRecords: Array
bundleState.BundleActiveModuleInfofieldlastModuleUsedTime: numberChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldlaunchedCount: numberChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldabilityIconId?: numberChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldabilityDescriptionId?: numberChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldabilityLableId?: numberChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofielddescriptionId?: number;Changed and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldlabelId?: numberChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldappLabelId?: numberChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldabilityName?: stringChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldmoduleName: stringChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofieldbundleName: stringChanged and migrated to usageStatistics.HapModuleInfo
bundleState.BundleActiveModuleInfofielddeviceId?: stringChanged and migrated to usageStatistics.HapModuleInfo
bundleState.GroupTypeenumenum GroupTypeChanged and migrated to usageStatistics.GroupType
bundleState.GroupTypeenumACTIVE_GROUP_ALIVEDeprecated and changed to ALIVE_GROUP
bundleState.GroupTypeenumACTIVE_GROUP_DAILYDeprecated and changed to DAILY_GROUP
bundleState.GroupTypeenumACTIVE_GROUP_FIXEDDeprecated and changed to FIXED_GROUP
bundleState.GroupTypeenumACTIVE_GROUP_RAREDeprecated and changed to RARE_GROUP
bundleState.GroupTypeenumACTIVE_GROUP_LIMITDeprecated and changed to LIMITED_GROUP
bundleState.GroupTypeenumACTIVE_GROUP_NEVERDeprecated and changed to NEVER_GROUP
bundleState.IntervalTypeenumenum IntervalTypeDeprecated and migrated to usageStatistics.IntervalType
bundleState.IntervalTypeenumBY_OPTIMIZEDDeprecated and migrated to usageStatistics.IntervalType
bundleState.IntervalTypeenumBY_DAILYDeprecated and migrated to usageStatistics.IntervalType
bundleState.IntervalTypeenumBY_WEEKLYDeprecated and migrated to usageStatistics.IntervalType
bundleState.IntervalTypeenumBY_MONTHLYDeprecated and migrated to usageStatistics.IntervalType
bundleState.IntervalTypeenumBY_ANNUALLYDeprecated and migrated to usageStatistics.IntervalType
bundleState.BundleActiveInfoResponseinterfaceinterface BundleActiveInfoResponseDeprecated and changed to usageStatistics.BundleStatsMap
bundleState.BundleActiveStateinterfaceinterface BundleActiveStateDeprecated and changed to usageStatistics.BundleEvents
bundleState.BundleActiveStatefieldstateType?: numberDeprecated and changed to eventId
bundleState.BundleActiveStatefieldstateOccurredTime?: numberDeprecated and changed to eventOccurredTime
bundleState.BundleActiveStatefieldnameOfClass?: stringDeprecated and migrated to usageStatistics.BundleEvents
bundleState.BundleActiveStatefieldindexOfLink?: stringDeprecated and migrated to usageStatistics.BundleEvents
bundleState.BundleActiveStatefieldbundleName?: stringDeprecated and migrated to usageStatistics.BundleEvents
bundleState.BundleActiveStatefieldappUsagePriorityGroup?: numberDeprecated and changed to appGroup
bundleState.BundleStateInfointerfaceinterface BundleStateInfoDeprecated and changed to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfomethodmerge(toMerge: BundleStateInfo): voidDeprecated
bundleState.BundleStateInfofieldinfosEndTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldinfosBeginTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldfgAbilityPrevAccessTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldfgAbilityAccessTotalTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldbundleName?: stringDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldabilitySeenTotalTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldabilityPrevSeenTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldabilityPrevAccessTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldabilityInFgTotalTime?: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleState.BundleStateInfofieldid: numberDeprecated and migrated to usageStatistics.BundleStatsInfo
bundleStatenamespacedeclare namespace bundleStateDeprecated and changed to usageStatistics, and migrated 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 Impacts

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, enumerations, and constants are changed in API version 9 and later versions. The @ohos.workScheduler.d.ts file is deprecated and related APIs are migrated to the newly added @ohos.resourceschedule.workScheduler.d.ts file.

ClassAPI TypeDeclarationChange Type
workSchedulernamespacedeclare namespace workSchedulerChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfointerfaceexport interface WorkInfoChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldparameters?: {[key: string]: any}Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldidleWaitTime?: numberChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldisDeepIdle?: booleanChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldrepeatCount?: numberChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldisRepeat?: booleanChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldrepeatCycleTime?: numberChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldstorageRequest?: StorageRequestChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldbatteryStatus?: BatteryStatusChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldbatteryLevel?: numberChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldchargerType?: ChargingTypeChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldisCharging?: booleanChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldnetworkType?: NetworkTypeChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldisPersisted?: booleanChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldabilityName: stringChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldbundleName: stringChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.WorkInfofieldworkId: numberChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction isLastWorkTimeOut(workId: number): Promise;Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean;Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction stopAndClearWorks(): boolean;Changed in API version 8 to function stopAndClearWorks(): boolean; and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction obtainAllWorks(): Promise<Array>;Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction obtainAllWorks(callback: AsyncCallback): Array;Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction getWorkStatus(workId: number): Promise;Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workSchedulermethodfunction getWorkStatus(workId: number, callback: AsyncCallback): void;Changed in API version 9 and migrated 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 migrated 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 migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumexport enum NetworkTypeChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumNETWORK_TYPE_ANY = 0Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumNETWORK_TYPE_MOBILEChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumNETWORK_TYPE_WIFIChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumNETWORK_TYPE_BLUETOOTHChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumNETWORK_TYPE_WIFI_P2PChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.NetworkTypeenumNETWORK_TYPE_ETHERNETChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.ChargingTypeenumexport enum ChargingTypeChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.ChargingTypeenumCHARGING_PLUGGED_ANY = 0Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.ChargingTypeenumCHARGING_PLUGGED_ACChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.ChargingTypeenumCHARGING_PLUGGED_USBChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.ChargingTypeenumCHARGING_PLUGGED_WIRELESSChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.BatteryStatusenumexport enum BatteryStatusChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.BatteryStatusenumBATTERY_STATUS_LOW = 0Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.BatteryStatusenumBATTERY_STATUS_OKAYChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.BatteryStatusenumBATTERY_STATUS_LOW_OR_OKAYChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.StorageRequestenumexport enum StorageRequestChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.BatteryStatusenumSTORAGE_LEVEL_LOW = 0Changed in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.BatteryStatusenumSTORAGE_LEVEL_OKAYChanged in API version 9 and migrated to the ohos.resourceschedule.workScheduler.d.ts file
workScheduler.BatteryStatusenumSTORAGE_LEVEL_LOW_OR_OKAYChanged in API version 9 and migrated 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 Impacts

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, enumerations, 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.

ClassAPI TypeMethod/Attribute/Enumeration/ConstantChange Type
reminderAgentmethodpublishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void;Deprecated and migrated to reminderAgentManager
reminderAgentmethodpublishReminder(reminderReq: ReminderRequest): Promise;Deprecated and migrated to reminderAgentManager
reminderAgentmethodcancelReminder(reminderId: number, callback: AsyncCallback): void;Deprecated and migrated to reminderAgentManager
reminderAgentmethodcancelReminder(reminderId: number): Promise;Deprecated and migrated to reminderAgentManager
reminderAgentmethodgetValidReminders(callback: AsyncCallback<Array>): void;Deprecated and migrated to reminderAgentManager
reminderAgentmethodgetValidReminders(): Promise<Array>;Deprecated and migrated to reminderAgentManager
reminderAgentmethodcancelAllReminders(callback: AsyncCallback): void;Deprecated and migrated to reminderAgentManager
reminderAgentmethodcancelAllReminders(): Promise;Deprecated and migrated to reminderAgentManager
reminderAgentmethodaddNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void;Deprecated and migrated to reminderAgentManager
reminderAgentmethodaddNotificationSlot(slot: NotificationSlot): Promise;Deprecated and migrated to reminderAgentManager
reminderAgentmethodremoveNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void;Deprecated and migrated to reminderAgentManager
reminderAgentmethodremoveNotificationSlot(slotType: notification.SlotType): Promise;Deprecated and migrated to reminderAgentManager
reminderAgent.ActionButtonTypeenumACTION_BUTTON_TYPE_CLOSEDeprecated and migrated to reminderAgentManager.ActionButtonType
reminderAgent.ActionButtonTypeenumACTION_BUTTON_TYPE_SNOOZEDeprecated and migrated to reminderAgentManager.ActionButtonType
reminderAgent.ReminderTypeenumREMINDER_TYPE_TIMERDeprecated and migrated to reminderAgentManager.ReminderType
reminderAgent.ReminderTypeenumREMINDER_TYPE_CALENDARDeprecated and migrated to reminderAgentManager.ReminderType
reminderAgent.ReminderTypeenumREMINDER_TYPE_CALENDARDeprecated and migrated to reminderAgentManager.ReminderType
reminderAgent.ActionButtonfieldtitle:stringDeprecated and migrated to reminderAgentManager.ActionButton
reminderAgent.ActionButtonfieldtype:ActionButtonTypeDeprecated and migrated to reminderAgentManager.ActionButton
reminderAgent.WantAgentfieldpkgName:stringDeprecated and migrated to reminderAgentManager.WantAgent
reminderAgent.WantAgentfieldabilityName:stringDeprecated and migrated to reminderAgentManager.WantAgent
reminderAgent.MaxScreenWantAgentfieldpkgName:stringDeprecated and migrated to reminderAgentManager.MaxScreenWantAgent
reminderAgent.MaxScreenWantAgentfieldabilityName:stringDeprecated and migrated to reminderAgentManager.MaxScreenWantAgent
reminderAgent.ReminderRequestfieldreminderType:ReminderTypeDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldactionButton?:ActionButtonDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldwantAgent?:WantAgentDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldmaxScreenWantAgent?:MaxScreenWantAgentDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldringDuration?:numberDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldsnoozeTimes?:numberDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldtimeInterval?:numberDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldtitle?:stringDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldcontent?:stringDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldexpiredContent?:stringDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldsnoozeContent?:stringDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldnotificationId?:numberDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestfieldslotType?: notification.SlotTypeDeprecated and migrated to reminderAgentManager.ReminderRequest
reminderAgent.ReminderRequestCalendarfielddateTime:LocalDateTimeDeprecated and migrated to reminderAgentManager.ReminderRequestCalendar
reminderAgent.ReminderRequestCalendarfieldrepeatMonths?:ArrayDeprecated and migrated to reminderAgentManager.ReminderRequestCalendar
reminderAgent.ReminderRequestCalendarfieldrepeatDays?:ArrayDeprecated and migrated to reminderAgentManager.ReminderRequestCalendar
reminderAgent.ReminderRequestAlarmfieldhour:numberDeprecated and migrated to reminderAgentManager.ReminderRequestAlarm
reminderAgent.ReminderRequestAlarmfieldminute:numberDeprecated and migrated to reminderAgentManager.ReminderRequestAlarm
reminderAgent.ReminderRequestAlarmfielddaysOfWeek?:ArrayDeprecated and migrated to reminderAgentManager.ReminderRequestAlarm
reminderAgent.ReminderRequestTimerfieldtriggerTimeInSeconds:numberDeprecated and migrated to reminderAgentManager.ReminderRequestTimer
reminderAgent.LocalDateTimefieldyear:numberDeprecated and migrated to reminderAgentManager.LocalDateTime
reminderAgent.LocalDateTimefieldmonth:numberDeprecated and migrated to reminderAgentManager.LocalDateTime
reminderAgent.LocalDateTimefieldday:numberDeprecated and migrated to reminderAgentManager.LocalDateTime
reminderAgent.LocalDateTimefieldhour:numberDeprecated and migrated to reminderAgentManager.LocalDateTime
reminderAgent.LocalDateTimefieldminute:numberDeprecated and migrated to reminderAgentManager.LocalDateTime
reminderAgent.LocalDateTimefieldsecond?:numberDeprecated and migrated 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.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Bundle Manager Subsystem ChangeLog

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